Gstreamer开发环境安装与测试
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Gstreamer开发环境安装与测试相关的知识,希望对你有一定的参考价值。
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已成功安装
以上是关于Gstreamer开发环境安装与测试的主要内容,如果未能解决你的问题,请参考以下文章