相关连接:https://blog.csdn.net/knowledgebao/article/details/84621238
Properties
GstPad * | alloc-pad | Read / Write | 已弃用DEPRECATED |
gboolean | has-chain | Read / Write / Construct | If the element can operate in push mode.是否支持push模式 |
gchar * | last-message | Read | The message describing current status.收到数据通过last-message消息抛出来。 |
gint | num-src-pads | Read | The number of source pads.有多少个srd pad |
GstTeePullMode | pull-mode | Read / Write / Construct | Behavior of tee in pull mode.是否支持pull模式 |
gboolean | silent | Read / Write / Construct | Don't produce last_message events.不使用last-message |
gboolean | allow-not-linked | Read / 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
struct | GstTee | Opaque GstTee data structure.透明结构体,无需了解 |
enum | GstTeePullMode | GST_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
| |
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 |
参考资料:
- tee
- 源码,所在目录(核心库):gstreamer\plugins\elements\gsttee.c
- Gstreamer-element-queue/queue2/multiqueue
有任何问题,请联系:knowledgebao@163.com