1.参考范例
官方文档
#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://gstreamer.freedesktop.org/data/media/sintel_trailer-480p.webm",
NULL);
/* Start playing */
gst_element_set_state (pipeline, GST_STATE_PLAYING);
/* Wait until error or EOS */
bus = gst_element_get_bus (pipeline);
msg =
gst_bus_timed_pop_filtered (bus, GST_CLOCK_TIME_NONE,
GST_MESSAGE_ERROR | GST_MESSAGE_EOS);
/* See next tutorial for proper error message handling/parsing */
if (GST_MESSAGE_TYPE (msg) == GST_MESSAGE_ERROR) {
g_error ("An error occurred! Re-run with the GST_DEBUG=*:WARN environment "
"variable se

本文介绍了如何使用GStreamer库进行多媒体流处理。通过gst_init()初始化,gst_parse_launch()构建包含playbin元素的简单管道来播放在线视频。文章强调了playbin的自动管理特性和gst_element_set_state()用于开始播放的重要性,同时展示了等待错误或流结束的基本方法以及资源清理。
——播放一个视频&spm=1001.2101.3001.5002&articleId=130479496&d=1&t=3&u=c42ada85b91e49f1a73a6fc32f05884d)
2764

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



