<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">This is the pseudocode, where the app invoke RtpSink::loop and RtpSource::loop in two different threads(description of my pipeline is as described in the previous mail), it is based on these two example<div><ul><li><a href="http://cgit.freedesktop.org/gstreamer/gst-plugins-good/tree/tests/examples/rtp/server-alsasrc-PCMA.c">http://cgit.freedesktop.org/gstreamer/gst-plugins-good/tree/tests/examples/rtp/server-alsasrc-PCMA.c</a></li><li><a href="http://cgit.freedesktop.org/gstreamer/gst-plugins-good/tree/tests/examples/rtp/client-PCMA.c">http://cgit.freedesktop.org/gstreamer/gst-plugins-good/tree/tests/examples/rtp/client-PCMA.c</a> </li></ul><div>I was expecting to create multiple pipelines each one with their structures and with our interaction, I think I’m in wrong :-)</div></div><div><div><br></div><div>RtpSink::loop() </div><div>{</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>…</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>//create the pipeline:</div><div><br></div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(0, 132, 0);"><span style="color: #000000"> </span>/* the pipeline to hold everything */</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(61, 29, 129);"><span style="color: #000000"> </span><span style="color: #4f8187">pipeline</span><span style="color: #000000"> = </span>gst_pipeline_new<span style="color: #000000"> (</span><span style="color: #bb2ca2">NULL</span><span style="color: #000000">);</span></div><div><span style="font-family: Menlo; font-size: 11px;"> </span><span style="font-family: Menlo; font-size: 11px; color: rgb(120, 73, 42);">g_assert</span><span style="font-family: Menlo; font-size: 11px;"> (</span><span style="font-family: Menlo; font-size: 11px; color: rgb(79, 129, 135);">pipeline</span><span style="font-family: Menlo; font-size: 11px;">);</span></div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre"> </span>// initialise the pipeline to receive audio content</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>…</div><div><font color="#008400" face="Menlo"><span style="font-size: 11px;"> </span></font></div><div><font color="#008400" face="Menlo"><span style="font-size: 11px;"> //start the gmail loop thread</span></font></div><div><font color="#008400" face="Menlo"><span style="font-size: 11px;"><br></span></font></div><div><span style="color: rgb(0, 132, 0); font-family: Menlo; font-size: 11px;"> /* we need to run a GLib main loop to get the messages */</span></div><div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(0, 132, 0);"> <span style="color: rgb(79, 129, 135);">pLoop</span> = <span style="color: rgb(61, 29, 129);">g_main_loop_new</span> (<span style="color: rgb(187, 44, 162);">NULL</span>, <span style="color: rgb(187, 44, 162);">FALSE</span>);</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(61, 29, 129);"><span style="color: #000000"> </span>g_main_loop_run<span style="color: #000000"> (</span><span style="color: #4f8187">pLoop</span><span style="color: #000000">);</span></div><p style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px;"> <br class="webkit-block-placeholder"></p><div style="margin: 0px; font-size: 11px; font-family: Menlo;"> g_print<span style="color: rgb(0, 0, 0);"> (</span><font color="#d12f1b">"stopping receiver pipeline\n"</font><span style="color: rgb(0, 0, 0);">);</span></div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(61, 29, 129);"><span style="color: #000000"> </span>gst_element_set_state<span style="color: #000000"> (</span><span style="color: #4f8187">pipeline</span><span style="color: #000000">, </span>GST_STATE_NULL<span style="color: #000000">);</span></div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(61, 29, 129);"><span style="color: #000000"> </span>gst_object_unref<span style="color: #000000"> (</span><span style="color: #4f8187">pipeline</span><span style="color: #000000">);</span></div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(61, 29, 129);"><span style="color: #000000"> </span>g_main_loop_unref<span style="color: #000000">(</span><span style="color: #4f8187">pLoop</span><span style="color: #000000">);</span></div></div><div><span style="color: #000000"><br></span></div><div>}</div><div><br></div><div><div>RtpSource::loop() </div><div>{</div><div><span class="Apple-tab-span" style="white-space: pre;"> </span>…</div><div><span class="Apple-tab-span" style="white-space: pre;"> </span>//create the pipeline:</div><div><br></div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(0, 132, 0);"><span style="color: rgb(0, 0, 0);"> </span>/* the pipeline to hold everything */</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(61, 29, 129);"><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(79, 129, 135);">pipeline</span><span style="color: rgb(0, 0, 0);"> = </span>gst_pipeline_new<span style="color: rgb(0, 0, 0);"> (</span><span style="color: rgb(187, 44, 162);">NULL</span><span style="color: rgb(0, 0, 0);">);</span></div><div><span style="font-family: Menlo; font-size: 11px;"> </span><span style="font-family: Menlo; font-size: 11px; color: rgb(120, 73, 42);">g_assert</span><span style="font-family: Menlo; font-size: 11px;"> (</span><span style="font-family: Menlo; font-size: 11px; color: rgb(79, 129, 135);">pipeline</span><span style="font-family: Menlo; font-size: 11px;">);</span></div><div><br></div><div><span class="Apple-tab-span" style="white-space: pre;"> </span>// initialise the pipeline to *transmit audio content* </div><div><span class="Apple-tab-span" style="white-space: pre;"> </span>…</div><div><font color="#008400" face="Menlo"><span style="font-size: 11px;"> </span></font></div><div><font color="#008400" face="Menlo"><span style="font-size: 11px;"> //start the gmail loop thread</span></font></div><div><font color="#008400" face="Menlo"><span style="font-size: 11px;"><br></span></font></div><div><span style="color: rgb(0, 132, 0); font-family: Menlo; font-size: 11px;"> /* we need to run a GLib main loop to get the messages */</span></div><div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(0, 132, 0);"> <span style="color: rgb(79, 129, 135);">pLoop</span> = <span style="color: rgb(61, 29, 129);">g_main_loop_new</span> (<span style="color: rgb(187, 44, 162);">NULL</span>, <span style="color: rgb(187, 44, 162);">FALSE</span>);</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(61, 29, 129);"><span style="color: rgb(0, 0, 0);"> </span>g_main_loop_run<span style="color: rgb(0, 0, 0);"> (</span><span style="color: rgb(79, 129, 135);">pLoop</span><span style="color: rgb(0, 0, 0);">);</span></div><div style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px;"> <br class="webkit-block-placeholder"></div><div style="margin: 0px; font-size: 11px; font-family: Menlo;"> g_print (<font color="#d12f1b">"stopping receiver pipeline\n"</font>);</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(61, 29, 129);"><span style="color: rgb(0, 0, 0);"> </span>gst_element_set_state<span style="color: rgb(0, 0, 0);"> (</span><span style="color: rgb(79, 129, 135);">pipeline</span><span style="color: rgb(0, 0, 0);">, </span>GST_STATE_NULL<span style="color: rgb(0, 0, 0);">);</span></div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(61, 29, 129);"><span style="color: rgb(0, 0, 0);"> </span>gst_object_unref<span style="color: rgb(0, 0, 0);"> (</span><span style="color: rgb(79, 129, 135);">pipeline</span><span style="color: rgb(0, 0, 0);">);</span></div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(61, 29, 129);"><span style="color: rgb(0, 0, 0);"> </span>g_main_loop_unref<span style="color: rgb(0, 0, 0);">(</span><span style="color: rgb(79, 129, 135);">pLoop</span><span style="color: rgb(0, 0, 0);">);</span></div></div><div><br></div><div>}</div><div><br></div><div>If I understood these pipelines are executed in thread that GStreamer starts, how is ti working? I read something about queue to create a producer/consumer model to handle data between elements. Do you think I should implement it to solve my issue?</div><div><br></div><div><div>On 31 Oct 2013, at 12:17, Sebastian Dröge <<a href="mailto:sebastian@centricular.com">sebastian@centricular.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">On Do, 2013-10-31 at 10:40 +0100, elio francesconi wrote:<br><blockquote type="cite">Hi all,<br><br>I'm creating an app to send and receive RTP audio streams, below I<br>attached pipeline's schemas.<br><br> I did these steps:<br><br><br> 1. I wrote a pipeline to *receive audio content* and I created a<br>thread to handle this stream.<br> 2. I wrote a second pipeline to send audio content and I created a<br>thread to handle this stream<br><br>These two pipelines work (I tested them separately) but in the same app no.<br><br><br>It seems a MultiThread issue, but I'm not aware how GStreamer works,<br>can someone give me some hints to handle this scenario?<br></blockquote><br>How do you run them in separate threads and what exactly happens?<br><br>You don't need to run them in separate threads yourself, GStreamer will<br>take care of that internally already for you.<br><br>-- <br>Sebastian Dröge <<a href="mailto:sebastian@centricular.com">sebastian@centricular.com</a>><br>Centricular Ltd - <a href="http://www.centricular.com">http://www.centricular.com</a><br>Expertise, Straight from the Source<br>_______________________________________________<br>gstreamer-devel mailing list<br><a href="mailto:gstreamer-devel@lists.freedesktop.org">gstreamer-devel@lists.freedesktop.org</a><br>http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel<br></blockquote></div><br></div></div></body></html>