gst_element_get_request_pad与gst_element_request_pad的区别

相关索引:https://blog.csdn.net/knowledgebao/article/details/84621238


GstPad *gst_element_get_request_pad (GstElement *element, const gchar *name);

  • 功能:获取指定element中的指定pad,此接口仅适用于request pads,使用后必须调用gst_element_release_request_pad()释放。
  • 参数element:指定的element。
  • 参数name:请求的pad名称,必须是这样的格式"src_%d"。
  • 返回值:成功返回对应的pad,失败返回NULL。
GstPad *gst_element_get_request_pad (GstElement *element,
                             const gchar *name);
Retrieves a pad from the element by name (e.g. "src_%d"). This version only retrieves request pads. The pad should be released with gst_element_release_request_pad().

This method is slower than manually getting the pad template and calling gst_element_request_pad() if the pads should have a specific name (e.g. name is "src_1" instead of "src_%u").

Parameters
element:a GstElement to find a request pad of.
name:the name of the request GstPad to retrieve.
 
Returns
requested GstPad if found, otherwise NULL. Release after usage.

GstPad *gst_element_request_pad (GstElement *element,GstPadTemplate *templ,const gchar *name,const GstCaps *caps);

  • 功能:通过模板获取指定element的pad。此接口仅适用于request pads,使用后必须调用gst_element_release_request_pad()释放。比gst_element_get_request_pad快一些
  • 参数element:指定的element。
  • 参数templ:对应的模板,可以通过函数gst_element_factory_get_static_pad_templates().获取
  • 参数name:查询的pad名称,可以为空。如果不为空,必须是类似这样的格式"src_1"。
  • 参数caps:查询pad具有的能力集,可以为空。
  • 返回值:成功返回对应的pad,失败返回NULL。
GstPad *
gst_element_request_pad (GstElement *element,
                         GstPadTemplate *templ,
                         const gchar *name,
                         const GstCaps *caps);
Retrieves a request pad from the element according to the provided template. Pad templates can be looked up using gst_element_factory_get_static_pad_templates().

The pad should be released with gst_element_release_request_pad().

Parameters
element:a GstElement to find a request pad of.
templ:a GstPadTemplate of which we want a pad of.
name:the name of the request GstPad to retrieve. Can be NULL.
caps:the caps of the pad we want to request. Can be NULL.

Returns
requested GstPad if found, otherwise NULL. Release after usage.

待完善。

 

参考文章:

  1. gst_element_get_request_pad ()
  2. gst_element_request_pad ()

 


有任何问题,请联系:knowledgebao@163.com

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值