Gstreamer RTSP src element name
Tarun Tej K
tarun4690 at gmail.com
Tue Jan 24 12:48:31 UTC 2017
Try g_strstr instead of g_str_has_prefix
On 24-Jan-2017 6:16 PM, "rajvik" <kamdar.rajvi at gmail.com> wrote:
The problem is it is not getting into the if else statement.
if (g_str_has_prefix(capsName,"audio"))
{
g_print("Here 6th .....\n");
GstPad *dynamic_pad = gst_element_get_static_pad(audioQueue,
"sink");
gst_pad_link(pad, dynamic_pad);
}
else if (g_str_has_prefix(capsName, "video"))
{
g_print("Here 7th .....\n");
GstPad *video_dynamic_pad =
gst_element_get_static_pad(videoQueue,
"sink");
gst_pad_link(pad, video_dynamic_pad);
}
g_free(capsName);
Reason being the prefix of capsName is :
name of caps string: application/x-rtp, media=(string)audio,
payload=(int)96, clock-rate=(int)44100, encoding-name=(string)MPEG4-GENERIC,
encoding-params=(string)2, streamtype=(string)5,
profile-level-id=(string)15, m
ode=(string)AAC-hbr, config=(string)1210, sizelength=(string)13,
indexlength=(string)3, indexdeltalength=(string)3, profile=(string)1,
a-tool=(string)"vlc\ 2.1.6", a-recvonly=(string)"",
a-type=(string)broadcast, a-ch
arset=(string)UTF-8, ssrc=(uint)398000458, clock-base=(uint)687408962,
seqnum-base=(uint)15402, npt-start=(guint64)4219024000,
play-speed=(double)1, play-scale=(double)1
Any API which would do a string compare for 1 word from the whole string?
On Tue, Jan 24, 2017 at 5:14 PM, Tarun Tej K [via GStreamer-devel] <[hidden
email] <http:///user/SendEmail.jtp?type=node&node=4681616&i=0>> wrote:
> I am not sure, but can you try without having the queues? Can you please
> see how it works when link the pads with audioDepay and videoDepay directly?
>
> Tarun
>
> On 24-Jan-2017 4:31 PM, "rajvik" <[hidden email]
> <http:///user/SendEmail.jtp?type=node&node=4681615&i=0>> wrote:
>
> 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(aud
> ioQueue,
> "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.
> _______________________________________________
> gstreamer-devel mailing list
> [hidden email] <http:///user/SendEmail.jtp?type=node&node=4681615&i=1>
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>
>
>
> _______________________________________________
> gstreamer-devel mailing list
> [hidden email] <http:///user/SendEmail.jtp?type=node&node=4681615&i=2>
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>
>
> ------------------------------
> If you reply to this email, your message will be added to the discussion
> below:
> http://gstreamer-devel.966125.n4.nabble.com/Gstreamer-RTSP-s
> rc-element-name-tp4681595p4681615.html
> To unsubscribe from Gstreamer RTSP src element name, click here.
> NAML
> <http://gstreamer-devel.966125.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>
------------------------------
View this message in context: Re: Gstreamer RTSP src element name
<http://gstreamer-devel.966125.n4.nabble.com/Gstreamer-RTSP-src-element-name-tp4681595p4681616.html>
Sent from the GStreamer-devel mailing list archive
<http://gstreamer-devel.966125.n4.nabble.com/> at Nabble.com.
_______________________________________________
gstreamer-devel mailing list
gstreamer-devel at lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20170124/cdc1bd09/attachment-0001.html>
More information about the gstreamer-devel
mailing list