<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Hi <br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
I have been working with gst-rtsp-server libraries to demux an udpsrc to audio and video gchar *pipeline. Have modelled after the example in test_mp4.c</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<a href="https://github.com/GStreamer/gst-rtsp-server/blob/master/examples/test-mp4.c" id="LPlnk870136"> "https://github.com/GStreamer/gst-rtsp-server/blob/master/examples/test-mp4.c</a>"<br>
<div> <br>
</div>
<div>Code:<br>
</div>
<div><b> g_strdup_printf ("( udpsrc port=%d name=src0 "</b></div>
<div><b> "! queue ! rtpmp2tdepay ! video/mpegts, systemstream=true, packetsize=188 ! aiurdemux name=dm "</b></div>
<div><b> " dm.video_0 ! queue ! h264parse name=video ! rtph264pay config-interval=1 name=pay0 pt=96 "</b></div>
<div><b> " dm.audio_0 ! queue ! aacparse name=audio ! rtpmp4gpay name=pay1 pt=97 )",</b></div>
<div><b> </b><b>5678);</b></div>
<div><b> gst_rtsp_media_factory_set_launch (factory,pipeline );</b></div>
<div><b><br>
</b></div>
<div><b> // to configure pipeline<br>
</b></div>
<div><b> g_signal_connect (factory, "media-configure",
<div> (GCallback) media_configure_cb, NULL<b>);</b><br>
</div>
</b></div>
<div><b><br>
</b></div>
<div>And I have added a callback when pad is added for the demuxer at media_configure_cb function (much like in normal gstreamer),
<br>
</div>
<div><br>
</div>
<div> <b>void</b>
<div><b> l_media_configure_cb (GstRTSPMediaFactory * factory,</b></div>
<div><b> GstRTSPMedia * media,</b></div>
<div><b> NULL)</b></div>
<b> {</b></div>
<div><b> // other code to configure</b></div>
<div><b> pipeline = gst_rtsp_media_get_element (media); <br>
</b></div>
<div><b> GstElement* demuxer = gst_bin_get_by_name_recurse_up (GST_BIN (pipeline ), "dm");<br>
</b></div>
<div><b> g_signal_connect (demuxer, "pad-added", G_CALLBACK (on_rtsp_pad_added),rtsp_app.pipeline);</b><b><br>
</b></div>
<div><b><br>
</b></div>
<div><b> }</b></div>
<div><br>
</div>
<div>The problem I have is that the demuxer only has pad added inconsistently (ie sometimes adding them and sometimes not adding them). Just wondering the following question.</div>
<div><br>
</div>
<div> 1. When is pad-added for this case? the example seem to suggest pad adding is taken care of by system<br>
</div>
<div> 2. Should I instead watch for the signal <span class="pl-en">media_prepared</span> ( I believed it is too late?) or other signal ?</div>
<div> 3. What should I do otherwise... checking the bus and take appropriate action</div>
<div><br>
</div>
<div>I am using Gstreamer 1.14</div>
<div><br>
</div>
<div>Regards<br>
</div>
</div>
</body>
</html>