文中部分图片来自网络,侵权必删!
前言
GStreamer(Gst)最初做为一个多媒体框架在业界闻名,基于插件(plugins)的流水线(Pipeline)管理使得其在多媒体处理中极其灵活。插件化的需求在AI领域也有应用场景,GStreamer在AI领域(Nvidia AI 框架DeepStream)的应用也非常广泛。
一、GStreamer框架
https://juejin.cn/post/7025435937500823582
1. gstreamer tools:gst-inspect用于查看插件的相关信息,gst-launch用于命令行启动创建一个应用链路,gst-editor没有用过;
2. gstreamer core framework:GStreamer核心框架,体统整个框架的管理,核心模块包括element,event,buffer,bus,pipeline,clock,synchronization等;
类型 | 发送 | 接收 | 应答 |
---|---|---|---|
message | element | bus | |
event | Application, element | element | |
query | application | element | Application |
buffer | element | element |
3. gstreamer plugins:多种类型的插件,包括协议类,数据源,格式转换,编解码,滤波,数据宿,以及三方插件(AI插件).
二、基础概念
在使用Gst之前,我们先熟悉几个基础概念,以便更好地了解GStreamer工作原理。
1. Element
Gstreamer- 元素(Elements)_gstreamer 释放element-优快云博客
/**
* GstElement:
* @state_lock: Used to serialize execution of gst_element_set_state()
* @state_cond: Used to signal completion of a state change
* @state_cookie: Used to detect concurrent execution of
* gst_element_set_state() and gst_element_get_state()
* @target_state: the target state of an element as set by the application
* @current_state: the current state of an element
* @next_state: the next state of an element, can be #GST_STATE_VOID_PENDING if
* the element is in the correct state.
* @pending_state: the final state the element should go to, can be
* #GST_STATE_VOID_PENDING if the element is in the correct state
* @last_return: the last return value of an element state change
* @bus: the bus of the element. This bus is provided to the element by the
* parent element or the application. A #GstPipeline has a bus of its own.
* @clock: the clock of the element. This clock is usually provided to the
* element by the toplevel #GstPipeline.
* @base_time: the time of the clock right before the element is set to
* PLAYING. Subtracting @base_time from the current clock time in the PLAYING
* state will yield the running_tim