简体   繁体   English

Gstreamer:如何链接请求板(接收器)和 static 板(源)

[英]Gstreamer: How to link a request pad (sink) and static pad (source)

Trying to do the linking for tee to a queue.尝试将 tee 链接到队列。 Here is what i do in the program codes这是我在程序代码中所做的

Program snippets /// create the tee pad template tee_src_pad_template = gst_element_class_get_pad_template (GST_ELEMENT_GET_CLASS (tee), "src_%u");程序片段 /// 创建 tee pad 模板 tee_src_pad_template = gst_element_class_get_pad_template (GST_ELEMENT_GET_CLASS (tee), "src_%u");

if(!tee_src_pad_template)
    g_print("thread Live: no tee_src_pad_template \n");

/// request the 2 pad
tee_pad = gst_element_request_pad (tee,
                                   tee_src_pad_template,
                                   NULL,
                                   NULL);
queue_pad = gst_element_get_static_pad (queue, "sink");

/// verify the object is created
if(!tee_pad)
    g_print(" no tee_pad \n");

if(!queue_pad)
    g_print("no queue_pad \n");

/// link the pads together
GstPadLinkReturn  ret  = gst_pad_link (tee_stream_pad, queue_stream_pad);
g_print(" Link return %d \n", ret);

The program compiles but there is error at the link pad stage, the value returned is -4程序编译但在连接板阶段有错误,返回值为-4

 Link return -4

Check out on the meaning of GstPadLinkReturn value.查看 GstPadLinkReturn 值的含义。 Just wonder what causes the following只是想知道是什么原因导致以下

GST_PAD_LINK_NOFORMAT (-4) – pads do not have common format

And what does it mean they do not have common format?这意味着它们没有通用格式是什么意思? Aren't they neutral linkers?它们不是中性链接器吗?

Regards问候

Manage to figure out the common problem as I linked the wrong element type当我链接错误的元素类型时,设法找出常见问题

GST_PAD_LINK_NOFORMAT (-4) – pads do not have common format

means exactly what it is, that the pads type is compatible意味着它是什么,垫类型是兼容的

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM