码迷,mamicode.com
首页 > 其他好文 > 详细

Gstreamer开发环境安装与测试

时间:2016-09-23 23:21:00      阅读:338      评论:0      收藏:0      [点我收藏+]

标签:

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, &micro, &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开发环境安装与测试

标签:

原文地址:http://www.cnblogs.com/glimpse1995/p/5901751.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!