Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1062853
  • 博文数量: 77
  • 博客积分: 821
  • 博客等级: 军士长
  • 技术积分: 1905
  • 用 户 组: 普通用户
  • 注册时间: 2011-10-23 16:17
个人简介

学校:上海交通大学软件工程 学历:硕士 行业:从事流媒体移动开发 QQ: 412595942 邮箱:yiikai1987910@gmail.com

文章分类

全部博文(77)

文章存档

2016年(4)

2015年(15)

2014年(16)

2013年(12)

2012年(21)

2011年(9)

分类: C/C++

2012-03-15 16:39:20

Here it is a "hello world" gstreamer application which simply plays the video stream coming from the videotestsrc.

#include
#include
 
int main(int argc, char *argv[])
{
QCoreApplication a(argc, argv);
 
gst_init (NULL,NULL);
 
GstElement *bin = gst_pipeline_new ("pipeline");
g_assert(bin);
 
GstElement *testSrc = gst_element_factory_make("videotestsrc", "source");
g_assert(testSrc);
 
GstElement *videoOut = gst_element_factory_make("autovideosink", "video out");
g_assert(videoOut);
 
gst_bin_add_many(GST_BIN(bin), testSrc, videoOut, NULL);
gst_element_link_many(testSrc, videoOut, NULL);
 
gst_element_set_state(GST_ELEMENT(bin), GST_STATE_PLAYING);
 
return a.exec();
}

Here tit is the project file needed to compile the code above

QT += core
QT -= gui
 
TARGET = untitled
CONFIG += console
CONFIG -= app_bundle
 
TEMPLATE = app
 
SOURCES += main.cpp
 
unix {
CONFIG += link_pkgconfig
PKGCONFIG += gstreamer-0.10
}
阅读(5055) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~