标签:
Gstreamer开发环境安装与测试
1)安装:
sudo apt-get install libgstreamer0.10-dev gstreamer-tools gstreamer0.10-tools gstreamer0.10-doc
sudo apt-get install gstreamer0.10-plugins-base gstreamer0.10-plugins-good gstreamer0.10-plugins-ugly gstreamer0.10-plugins-bad gstreamer0.10-plugins-bad-multiverse
apt-get install libgstreamer* // 该命令的目的是安装头文件;注意’*’
2)测试gstreamer开发库:
#include <gst/gst.h>
int main (int argc,char *argv[])
{
const gchar *nano_str;
guint major, minor, micro, nano;
gst_init (&argc, &argv);
gst_version (&major, &minor, µ, &nano);
if (nano == 1)
nano_str = "(CVS)";
else if (nano == 2)
nano_str = "(Prerelease)";
else
nano_str = "";
printf ("This program is linked against GStreamer %d.%d.%d %s\n",
major, minor, micro, nano_str);
return 0;
}
将上述代码保存为hello.c
gcc -Wall hello.c -o hello $(pkg-config --cflags --libs gstreamer-0.10) //编译,生成hello的可执行文件
sudo ./hello //执行该文件
运行结果:This program is linked against GStreamer 0.10.22 //若运行出该结果,说明Gstreamer已成功安装
标签:
原文地址:http://www.cnblogs.com/glimpse1995/p/5901751.html