1、GSteamer的基本API的使用
gst_init()初始化GStreamer 。
gst_parse_launch()从文本描述快速构建管道 。
playbin创建自动播放管道。
gst_element_set_state()通知GStreamer开始播放 。
gst_element_get_bus()和gst_bus_timed_pop_filtered()来释放资源
#include <iostream>
#include <gst/gst.h>
#include <glib.h>
int main(int argc, char *argv[]) {
GstElement *pipeline;
GstBus *bus;
GstMessage *msg;
/* Initialize GStreamer */
gst_init(&argc, &argv);
//初始化gstream
/* Build the pipeline */
pipeline =gst_parse_launch("playbin uri=file:///D:/gstream/1.mp4",NULL);
//gst_parse_launch使用系统预设的管道来处理流媒体。gst_parse_launch创建的是一个由playbin单元素组成的管道
/* Start playing */
gst_element_set_state(pipeline, GST_STATE_PLAYING);
//将我们的元素设置为playing状态才能开始播放
/* Wait until error or EOS */
bus = gst_element_g