Gstreamer API

Gstreamer API

官网tutorial basic tutorial

element

GstElementFactory *gst_element_factory_find (const gchar * name)根据给定的名称查找GstElementFactory
GstElement *gst_element_factory_create (GstElementFactory * factory, const gchar * name)创建由factory定义的GstElement
GstElement *gst_pipeline_new (const gchar * name)创建pipeline, pipeline 是一种GstElement

Bus

A bus is a simple system that takes care of forwarding messages from the streaming threads to an application in its own thread context.
每一个pipeline都有带有一个默认的bus,所以应用程序不需要去创建bus。
应用程序要做的事情是创建bus上的消息处理程序。
消息处理程序的机制是,在mainloop中会周期性的检查是否有新消息。当消息可用时,回调函数触发。

GstBus *gst_pipeline_get_bus (GstPipeline * pipeline)Gets the GstBus of pipeline
guint gst_bus_add_watch (GstBus * bus, GstBusFunc func, gpointer user_data)Adds a bus watch to the default main context with the default priority ( G_PRIORITY_DEFAULT )
gst_bus_add_signal_watch_full (GstBus * bus, gint priority)Adds a bus signal watch to the default main context with the given priority (e.g. G_PRIORITY_DEFAULT).

6 Pad&Capabilities

pad 是element通向外部世界的接口。element可以出处理的特定类型的媒体信息通过pad 的capability 呈现出来。

Pad

pad 由两个属性定义,方向和可用性 direction and its availability。gstreamer定义了两个方向 source pad 和sink pad。element 从source pad上产生数据,从sink pad上接收数据。source pad 画在element的左边表示产生数据的接口,sink pad画在element的右边表示接收数据的接口。这样把element连接起来,表示数据流从左向右流动。
pad有三种可用性,always,sometimes 和 on request。always表示一直可用,sometimes 表示在某些条件下可用,on request 表示必须在应用程序申请时可用。

guint gst_element_factory_get_num_pad_templates (GstElementFactory * factory)获取factory 内的pad_templates数量
const GList *gst_element_factory_get_static_pad_templates (GstElementFactory * factory)获取factory内的 GstStaticPadTemplate list
GstCaps *gst_static_caps_get (GstStaticCaps * static_caps)将GstStaticCaps转化为GstCaps
GstPad *gst_element_get_static_pad (GstElement * element, const gchar * name)从element中根据名字获取GstPad
GstCaps *gst_pad_get_current_caps (GstPad * pad)从GstPad中获取GstCaps
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值