Gstreamer-element-tee

相关连接:https://blog.csdn.net/knowledgebao/article/details/84621238


Properties

GstPad *alloc-padRead / Write已弃用DEPRECATED
gbooleanhas-chainRead / Write / ConstructIf the element can operate in push mode.是否支持push模式
gchar *last-messageReadThe message describing current status.收到数据通过last-message消息抛出来。
gintnum-src-padsReadThe number of source pads.有多少个srd pad
GstTeePullModepull-modeRead / Write / ConstructBehavior of tee in pull mode.是否支持pull模式
gbooleansilentRead / Write / ConstructDon't produce last_message events.不使用last-message
gbooleanallow-not-linkedRead / Write / Construct

This property makes sink pad return GST_FLOW_OK even if there are no source pads or any of them is linked.

当 没有src的时候,sink返回GST_FLOW_OK而不是GST_ERR.

Types and Values

structGstTee

Opaque GstTee data structure.透明结构体,无需了解

enumGstTeePullModeGST_TEE_PULL_MODE_NEVER(不允许pull模式)、GST_TEE_PULL_MODE_SINGLE(允许一个src使用pull模式)

Object Hierarchy

    GObject
    ╰── GInitiallyUnowned
        ╰── GstObject
            ╰── GstElement
                ╰── GstTee

Description

sink pad数据发送多份到多个src pad中。这里没有独立线程,所以在分发的过程中,和src pad连接的下游sink pad处理速度等会影响数据的发送,如果想要规避这种互相影响,需要使用queue、或mutiqueue(详见参考资料3)。tee只是把一份数据gst_pad_push到多个src pad中,不涉及拷贝等操作。也就是说tee中sink的数据,会通过src pad发送给下游的多个sink pad,由下游的多个sink pad共享数据。

GST_OBJECT_LOCK (tee);
pads = GST_ELEMENT_CAST (tee)->srcpads;
if (!pads->next) {
    GstPad *pad = GST_PAD_CAST (pads->data);

    /* Keep another ref around, a pad probe
     * might release and destroy the pad */
    gst_object_ref (pad);
    GST_OBJECT_UNLOCK (tee);
   
    ret = gst_pad_push (pad, GST_BUFFER_CAST (data));
    gst_object_unref (pad);

    return ret;
  }

Split data to multiple pads. Branching the data flow is useful when e.g. capturing a video where the video is shown on the screen and also encoded and written to a file. Another example is playing music and hooking up a visualisation module.

One needs to use separate queue elements (or a multiqueue) in each branch to provide separate threads for each branch. Otherwise a blocked dataflow in one branch would stall the other branches.

Example launch line

1
gst-launch-1.0 filesrc location=song.ogg ! decodebin ! tee name=t ! queue ! audioconvert ! audioresample ! autoaudiosink t. ! queue ! audioconvert ! goom ! videoconvert ! autovideosink

Play song.ogg audio file which must be in the current working directory and render visualisations using the goom element (this can be easier done using the playbin element, this is just an example pipeline).

Synopsis

Element Information

plugin

coreelements

author

Erik Walthinsen <omega@cse.ogi.edu>, Wim Taymans <wim@fluendo.com>

class

Generic

Element Pads

name

sink

direction

sink

presence

always

details

ANY

name

src_%u

direction

source

presence

request

details

ANY

 

参考资料:

  1. tee
  2. 源码,所在目录(核心库):gstreamer\plugins\elements\gsttee.c
  3. Gstreamer-element-queue/queue2/multiqueue

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

 

  • 2
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值