linking pads from multiqueue to splitmuxsink?
killerrats
koreysjunkmail at gmail.com
Mon Sep 9 16:59:37 UTC 2019
I have successfully linked the pads. when I use the "pad-added" signal for
video and audio will not link. If i use the "pad-added" for audio only and
link the video pad before the signal will work like i was doing before. for
example:
setup the main pipeline
link the main pipeline including the multiqueue to splitmuxsink for video
setup the signal for splitmuxsink
void cb_new_Multiqueue_pad(GstElement* element, GstPad* pad, gpointer data)
{
gchar *name;
gchar *fromCaps;
GstPad* sinkPad = NULL;
GstCaps * p_caps;
GstElement* nextElement = nullptr;
DvtelPipeline* pipe = static_cast<DvtelPipeline*>(data);
name = gst_pad_get_name(pad);
p_caps = gst_pad_get_pad_template_caps(pad);
fromCaps = gst_caps_to_string(p_caps);
g_print("A new pad %s was created\n", name);
g_print("\r\ncaps are %" GST_PTR_FORMAT, fromCaps);
g_print("\r\n");
if (strstr(name, "src") == NULL)
goto End;
if (strstr(name, "src_2") != NULL)
{
std::cout << "\n------------------------ multiqueue audio
-------------------------------\n";
nextElement = gst_bin_get_by_name(GST_BIN(pipe->srcPipeline),
"splitmuxsink");
if (nextElement != NULL)
{
sinkPad = pipe->RequestingPadFromElement(nextElement, "audio_1");
pipe->LinkingThePads(pad,sinkPad);
gst_object_unref(nextElement);
}
}
else
{
g_print("Couldn't find video or audio in caps from string\n");
}
End:
{
g_free(fromCaps);
g_free(name);
gst_caps_unref(p_caps);
gst_object_unref(sinkPad);
}
}
-----
------------------------------
Gstreamer 1.14.3
------------------------------
Windows
--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
More information about the gstreamer-devel
mailing list