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

 

### 回答1: gstreamer teegstreamer中的一个插件,用于将数据流分发到多个不同的插件中进行处理,并为每个插件提供独立的数据源。在视频和音频流的处理中,tee插件可以用来同时进行录制,直播等多种处理操作。 它的工作原理是在pipeline(管道)中插入一个tee元素,然后将数据流连接到tee的输入端口。然后,使用不同的queue元素将多个数据流分离出来,并将其分别连接到不同的处理器中进行处理。这使得我们可以在相同的输入源上同时执行不同的任务,比如只处理音频同时录制视频等等。 使用gstreamer tee,我们可以在不同的处理器中使用不同的组件进行音频、视频等的处理,而不需要在每个组件中都从头开始进行数据流处理。同时,它还可以增强流的可靠性,如果其中一个组件出现问题,不会影响整体的数据流处理。在gstreamer中,tee是一个非常有用的工具,可以使我们更高效地处理多种不同类型的数据流。 ### 回答2: Gstreamer是一种开源的多媒体框架,可以实现实时音视频的播放和处理。而在Gstreamer中的tee,则是一个用于将一个输入流复制为多个输出流的元件。 在Gstreamer中,使用tee元件可以将一个输入流同时输出到多个输出流中,这些输出流可以被连接到其他的元件,从而实现不同的功能,如视频录制、实时传输等。tee元件可以多次使用,每次使用时可以将输入流的复制品再次输出,实现更加复杂的流程。 实际应用中,tee元件经常被用于同步处理音视频流。通常,在音视频处理中,一个流可能会被多个元件同时处理,而使用tee元件可以将多个元件所需要的流同时从同一输入流中获取,从而实现同步处理。 除此之外,tee元件还可以用于测试和调试媒体流的处理过程,方便开发人员查看各个元件处理后的效果。同时,由于tee元件在Gstreamer中的高效性能和实用性,许多Gstreamer的插件也将其作为底层组件,来实现诸如视频框架解析、图像识别等更加复杂的功能。 总的来说,Gstreamer tee元件是一种非常实用的元件,能够在音视频处理中,实现多元件同步处理,同时也有实用性强、应用范围广泛等优点,深受开发人员的青睐。 ### 回答3: gstreamer teegstreamer框架中的一个元素(element),它允许将一个数据流分成两个或多个流,并将数据同时传送到多个接收器。 teegstreamer中是一个非常重要的元素,因为它可以解决数据流在多个目的地的复制问题。它的功能类似于管道中的Y形管道,可以将流分成两个分支,并将数据同时传输到多个接收器,这样就可以在不改变数据流结构的情况下实现多路转发。这在实时视频流、音频流等媒体数据的处理和传输中非常有用。 使用tee元素时,用户可以自定义输出节点的数量和类型,这些节点可以是转码器、解码器、显示器、录制器等其他处理数据流的元素。在实际应用中,可以使用tee将数据复制到两个不同的分支来进行视频会议、多路转发等操作。 同时,tee元素还有一个重要的功能,即使其中一个分支输入出现错误,其他分支仍可以继续工作,从而保证了处理数据流的连续性和稳健性。 总的来说,gstreamer tee元素可以实现多路转发媒体数据流的处理和传输,为实时视频、音频等场景提供了重要支持,是gstreamer框架中一个非常重要的元素。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值