Gstreamer基础教程1:Hello world
1. Goal
播放一段视频。
2. Code
编译运行
gcc basic-tutorial-1.c -o basic-tutorial-1 `pkg-config --cflags --libs gstreamer-1.0`
./basic-tutorial-1
basic-tutorial-1.c
#include <gst/gst.h>
int
main (int argc, char *argv[])
{
GstElement *pipeline;
GstBus *bus;
GstMessage *msg;
/* Initialize GStreamer */
gst_init (&argc, &argv);
/* Build the pipeline */
pipeline =
gst_parse_launch
("playbin uri=https://www.freedesktop.org/software/gstreamer-sdk/data/media/sintel_trailer-480p.webm",
NULL

本文是Gstreamer基础教程的第一部分,目标是播放视频。讲解了gst_init初始化库,gst_parse_launch创建管道,playbin元素的作用,gst_element_set_state设置播放状态,以及gst_element_get_bus获取总线和释放资源的方法。
最低0.47元/天 解锁文章
2458

被折叠的 条评论
为什么被折叠?



