Gstreamer RTSP src element name
rajvik
kamdar.rajvi at gmail.com
Tue Jan 24 10:42:35 UTC 2017
Thank you so much for the insights. I did incorporate what you asked me to,
but still I am getting error:
*0:00:00.602211533 2055 0x188380 WARN basesrc
gstbasesrc.c:2933:gst_base_src_loop:<udpsrc3> error: Internal data flow
error.
0:00:00.618291500 2055 0x188380 WARN basesrc
gstbasesrc.c:2933:gst_base_src_loop:<udpsrc3> error: streaming task paused,
reason not-linked (-1)
0:00:00.638866649 2055 0x188430 WARN basesrc
gstbasesrc.c:2933:gst_base_src_loop:<udpsrc0> error: Internal data flow
error.
0:00:00.655050073 2055 0x188430 WARN basesrc
gstbasesrc.c:2933:gst_base_src_loop:<udpsrc0> error: streaming task paused,
reason not-linked (-1)*
Please find the below code snippet:
*Taken audioQueue and VideoQueue as global variables and find the below cb
function: *
static void onPadAdded(GstElement *element, GstPad *pad, gpointer data)
{
GstCaps *caps;
const char *name;
char *capsName;
caps = gst_pad_get_current_caps(pad);
GstStructure *str = gst_caps_get_structure(caps, 0);
name = gst_structure_get_name(str);
g_debug("name of caps struct string: %s", name);
capsName = gst_caps_to_string(caps);
g_debug("name of caps string: %s", capsName);
if (g_str_has_prefix(capsName,"audio"))
{
GstPad *dynamic_pad = gst_element_get_static_pad(audioQueue,
"sink");
gst_pad_link(pad, dynamic_pad);
}
else if (g_str_has_prefix(capsName, "video"))
{
GstPad *video_dynamic_pad =
gst_element_get_static_pad(videoQueue, "sink");
gst_pad_link(pad, video_dynamic_pad);
}
g_free(capsName);
}
*Following is the g_signal_connect operation:*
gst_bin_add(GST_BIN(pipeline), source);
gst_bin_add_many(GST_BIN(pipeline),
audioQueue, audioDepay, audioParse, audioDecode,
audioConvert, audioResample, audioSink,
videoQueue, videoDepay, videoParser, videoDecode,
videoConvert, videoScale, videoSink, NULL);
if (!gst_element_link_many(audioQueue, audioDepay, NULL ))
{
g_printerr("Cannot link audioqueue and audioDepay \n");
return 0;
}
if (!gst_element_link_many(audioParse, audioDecode,NULL ))
{
g_printerr("Cannot link audioParse and audiodecode \n");
return 0;
}
if (!gst_element_link_many(audioConvert, audioResample, audioSink,
NULL ))
{
g_printerr("Cannot link audioConvert, audioParse, audioSink
\n");
return 0;
}
/*Linking filter element to videoScale and videoSink */
link_ok = gst_element_link_filtered(videoScale,videoSink,
capsFilter);
gst_caps_unref (capsFilter);
if (!link_ok) {
g_warning ("Failed to link element1 and element2!");
}
/* Linking video elements internally */
if (!gst_element_link_many(videoQueue, videoDepay, NULL))
{
g_printerr("Cannot link videoQueue and videoDepay \n");
return 0;
}
if (!gst_element_link_many( videoParser, videoDecode, videoConvert,
NULL))
{
g_printerr("Cannot link videoParser, videoDecode,
videoConvert \n");
return 0;
}
g_signal_connect(source, "pad-added", G_CALLBACK(onPadAdded), NULL);
--
View this message in context: http://gstreamer-devel.966125.n4.nabble.com/Gstreamer-RTSP-src-element-name-tp4681595p4681613.html
Sent from the GStreamer-devel mailing list archive at Nabble.com.
More information about the gstreamer-devel
mailing list