<div dir="ltr">Hi.<div><br>Im currently trying to get an rtsp stream to play in my code using the gstreamer C libraries and am experiencing a crash of the application when the stream is set to playing.</div><div><br></div><div>The crash does not happen when I launch gstreamer through the command line using any of the following:</div><div><br></div><div><span style="font-family:monospace"><span style="color:rgb(0,0,0)">gst-launch-1.0 uridecodebin uri="rtsp://localhost:8554/slamtv60.264" ! autovideosink</span><br></span></div><div><br></div><div><span style="font-family:monospace"><span style="color:rgb(0,0,0)">gst-launch-1.0 playbin uri="rtsp://localhost:8554/slamtv60.264"</span><br>
<br></span></div><div><span style="font-family:monospace"><span style="color:rgb(0,0,0)">gst-launch-1.0 rtspsrc location=rtsp://localhost:8554/slamtv60.264 ! decodebin ! autovideosink</span><br></span></div><div><span style="font-family:monospace"><span style="color:rgb(0,0,0)"><br></span></span></div><div>The code I have used that causes the crash is at the bottom of this message. Its basically a modified version of the example code with me using the uridecodebin instead of the standard playbin. I've also tried to use the playbin and set the uri property but the application still crashes at what I think is the same place.</div><div><br></div><div>I've run the code with GST_DEBUG=4 set and attached the a txt file with the output to this message in case it will help.</div><div><br></div><div>My OS is SuSE linux-leap 42.1 and I'm using the latest gstreamer libraries from the pacman repo.</div><div><br></div><div>Thanks in advance for any help that you can provide.</div><div><br></div><div>Dave</div><div>
<pre style="margin-top:0px;margin-bottom:0px"><pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(0,0,128)">#include</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)"><gst/gst.h></span></pre><pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(0,128,0)"><br></span></pre></pre><pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(128,128,0)">struct</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,0,128)">PipelineData</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">{</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,0,128)">GstElement</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">*</span><span style="color:rgb(128,0,0)">pipeline</span><span style="color:rgb(0,0,0)">;</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,0,128)">GstElement</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">*</span><span style="color:rgb(128,0,0)">source</span><span style="color:rgb(0,0,0)">;</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,0,128)">GstElement</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">*</span><span style="color:rgb(128,0,0)">sink</span><span style="color:rgb(0,0,0)">;</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(0,0,0)">};</span></pre><pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(0,0,0)"><br></span></pre></div><div>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(128,128,0)">int</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">main</span><span style="color:rgb(0,0,0)">(</span><span style="color:rgb(128,128,0)">int</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">argc</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,128,0)">char</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">*</span><span style="color:rgb(0,0,0)">argv</span><span style="color:rgb(0,0,0)">[])</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(0,0,0)">{</span></pre></div><div>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">/*</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">Initialize</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">GStreamer</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">*/</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,0,128)">PipelineData</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">data</span><span style="color:rgb(0,0,0)">;</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,0,128)">GstBus</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">*</span><span style="color:rgb(0,0,0)">bus</span><span style="color:rgb(0,0,0)">;</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,0,128)">GstMessage</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">*</span><span style="color:rgb(0,0,0)">msg</span><span style="color:rgb(0,0,0)">;</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,0,128)">GstStateChangeReturn</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">ret</span><span style="color:rgb(0,0,0)">;</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,0,128)">gboolean</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">terminate</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">=</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">FALSE</span><span style="color:rgb(0,0,0)">;</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><br></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">/*</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">Initialize</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">GStreamer</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">*/</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">gst_init</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">(&</span><span style="color:rgb(0,0,0)">argc</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">&</span><span style="color:rgb(0,0,0)">argv</span><span style="color:rgb(0,0,0)">);</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><br></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">/*</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">Create</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">the</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">elements</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">*/</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">data</span><span style="color:rgb(0,0,0)">.</span><span style="color:rgb(128,0,0)">source</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">=</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">gst_element_factory_make</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">(</span><span style="color:rgb(0,128,0)">"uridecodebin"</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">"source"</span><span style="color:rgb(0,0,0)">);</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">data</span><span style="color:rgb(0,0,0)">.</span><span style="color:rgb(128,0,0)">sink</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">=</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">gst_element_factory_make</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">(</span><span style="color:rgb(0,128,0)">"autovideosink"</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">"sink"</span><span style="color:rgb(0,0,0)">);</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><br></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">/*</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">Create</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">the</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">empty</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">pipeline</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">*/</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">data</span><span style="color:rgb(0,0,0)">.</span><span style="color:rgb(128,0,0)">pipeline</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">=</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">gst_pipeline_new</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">(</span><span style="color:rgb(0,128,0)">"test-pipeline"</span><span style="color:rgb(0,0,0)">);</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><br></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,128,0)">if</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">(!</span><span style="color:rgb(0,0,0)">data</span><span style="color:rgb(0,0,0)">.</span><span style="color:rgb(128,0,0)">pipeline</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">||</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">!</span><span style="color:rgb(0,0,0)">data</span><span style="color:rgb(0,0,0)">.</span><span style="color:rgb(128,0,0)">source</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">||</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">!</span><span style="color:rgb(0,0,0)">data</span><span style="color:rgb(0,0,0)">.</span><span style="color:rgb(128,0,0)">sink</span><span style="color:rgb(0,0,0)">)</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">{</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">g_printerr</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">(</span><span style="color:rgb(0,128,0)">"Not</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">all</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">elements</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">could</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">be</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">created.\n"</span><span style="color:rgb(0,0,0)">);</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,128,0)">return</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">-</span><span style="color:rgb(0,0,128)">1</span><span style="color:rgb(0,0,0)">;</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">}</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><br></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">/*</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">Build</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">the</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">pipeline</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">*/</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">gst_bin_add_many</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">(</span><span style="color:rgb(0,0,128)">GST_BIN</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">(</span><span style="color:rgb(0,0,0)">data</span><span style="color:rgb(0,0,0)">.</span><span style="color:rgb(128,0,0)">pipeline</span><span style="color:rgb(0,0,0)">),</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">data</span><span style="color:rgb(0,0,0)">.</span><span style="color:rgb(128,0,0)">source</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">data</span><span style="color:rgb(0,0,0)">.</span><span style="color:rgb(128,0,0)">sink</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">NULL</span><span style="color:rgb(0,0,0)">);</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">/*if</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">(gst_element_link</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">(data.source,</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">data.sink)</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">!=</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">TRUE)</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">{</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">g_printerr</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">("Elements</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">could</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">not</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">be</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">linked.\n");</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">gst_object_unref</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">(data.pipeline);</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">return</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">-1;</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">}*/</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><br></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">/*</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">Modify</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">the</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">source's</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">properties</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">*/</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">g_object_set</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">(</span><span style="color:rgb(0,0,0)">data</span><span style="color:rgb(0,0,0)">.</span><span style="color:rgb(128,0,0)">source</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">"uri"</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">"rtsp://localhost:8554/slamtv60.264"</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">NULL</span><span style="color:rgb(0,0,0)">);</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><br></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">/*</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">Connect</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">to</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">the</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">pad-added</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">signal</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">*/</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">g_signal_connect</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">(</span><span style="color:rgb(0,0,0)">data</span><span style="color:rgb(0,0,0)">.</span><span style="color:rgb(128,0,0)">source</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">"pad-added"</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">G_CALLBACK</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">(</span>pad_added_handler<span style="color:rgb(0,0,0)">),</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">&</span><span style="color:rgb(0,0,0)">data</span><span style="color:rgb(0,0,0)">);</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><br></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">/*</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">Start</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">playing</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">*/</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">ret</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">=</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">gst_element_set_state</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">(</span><span style="color:rgb(0,0,0)">data</span><span style="color:rgb(0,0,0)">.</span><span style="color:rgb(128,0,0)">pipeline</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,0,128)">GST_STATE_PLAYING</span><span style="color:rgb(0,0,0)">);</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,128,0)">if</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">(</span><span style="color:rgb(0,0,0)">ret</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">==</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,0,128)">GST_STATE_CHANGE_FAILURE</span><span style="color:rgb(0,0,0)">)</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">{</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">g_printerr</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">(</span><span style="color:rgb(0,128,0)">"Unable</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">to</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">set</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">the</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">pipeline</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">to</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">the</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">playing</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">state.\n"</span><span style="color:rgb(0,0,0)">);</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">gst_object_unref</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">(</span><span style="color:rgb(0,0,0)">data</span><span style="color:rgb(0,0,0)">.</span><span style="color:rgb(128,0,0)">pipeline</span><span style="color:rgb(0,0,0)">);</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,128,0)">return</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">-</span><span style="color:rgb(0,0,128)">1</span><span style="color:rgb(0,0,0)">;</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">}</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><br></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">/*</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">Listen</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">to</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">the</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">bus</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">*/</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">bus</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">=</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">gst_element_get_bus</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">(</span><span style="color:rgb(0,0,0)">data</span><span style="color:rgb(0,0,0)">.</span><span style="color:rgb(128,0,0)">pipeline</span><span style="color:rgb(0,0,0)">);</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,128,0)">do</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">{</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">msg</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">=</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">gst_bus_timed_pop_filtered</span><span style="color:rgb(0,0,0)">(</span><span style="color:rgb(0,0,0)">bus</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">GST_CLOCK_TIME_NONE</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,0,128)">GST_MESSAGE_ERROR</span><span style="color:rgb(0,0,0)">);</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><br></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">/*</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">Parse</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">message</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">*/</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,128,0)">if</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">(</span><span style="color:rgb(0,0,0)">msg</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">!=</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">NULL</span><span style="color:rgb(0,0,0)">)</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">{</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,0,128)">GError</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">*</span><span style="color:rgb(0,0,0)">err</span><span style="color:rgb(0,0,0)">;</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,0,128)">gchar</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">*</span><span style="color:rgb(0,0,0)">debug_info</span><span style="color:rgb(0,0,0)">;</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><br></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,128,0)">switch</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">(</span><span style="color:rgb(0,0,128)">GST_MESSAGE_TYPE</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">(</span><span style="color:rgb(0,0,0)">msg</span><span style="color:rgb(0,0,0)">))</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">{</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,128,0)">case</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,0,128)">GST_MESSAGE_ERROR</span><span style="color:rgb(0,0,0)">:</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span>gst_message_parse_error<span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">(</span><span style="color:rgb(0,0,0)">msg</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">&</span><span style="color:rgb(0,0,0)">err</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">&</span><span style="color:rgb(0,0,0)">debug_info</span><span style="color:rgb(0,0,0)">);</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">g_printerr</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">(</span><span style="color:rgb(0,128,0)">"Error</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">received</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">from</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">element</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">%s:</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">%s\n"</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">GST_OBJECT_NAME</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">(</span><span style="color:rgb(0,0,0)">msg</span><span style="color:rgb(0,0,0)">-></span><span style="color:rgb(128,0,0)">src</span><span style="color:rgb(0,0,0)">),</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">err</span><span style="color:rgb(0,0,0)">-></span><span style="color:rgb(128,0,0)">message</span><span style="color:rgb(0,0,0)">);</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">g_printerr</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">(</span><span style="color:rgb(0,128,0)">"Debugging</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">information:</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">%s\n"</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">debug_info</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">?</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">debug_info</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">:</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">"none"</span><span style="color:rgb(0,0,0)">);</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span>g_clear_error<span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">(&</span><span style="color:rgb(0,0,0)">err</span><span style="color:rgb(0,0,0)">);</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">g_free</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">(</span><span style="color:rgb(0,0,0)">debug_info</span><span style="color:rgb(0,0,0)">);</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">terminate</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">=</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">TRUE</span><span style="color:rgb(0,0,0)">;</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,128,0)">break</span><span style="color:rgb(0,0,0)">;</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,128,0)">case</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,0,128)">GST_MESSAGE_EOS</span><span style="color:rgb(0,0,0)">:</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">g_print</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">(</span><span style="color:rgb(0,128,0)">"End-Of-Stream</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">reached.\n"</span><span style="color:rgb(0,0,0)">);</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">terminate</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">=</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">TRUE</span><span style="color:rgb(0,0,0)">;</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,128,0)">break</span><span style="color:rgb(0,0,0)">;</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,128,0)">case</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,0,128)">GST_MESSAGE_STATE_CHANGED</span><span style="color:rgb(0,0,0)">:</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">/*</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">We</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">are</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">only</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">interested</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">in</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">state-changed</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">messages</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">from</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">the</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">pipeline</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">*/</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,128,0)">if</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">(</span><span style="color:rgb(0,0,128)">GST_MESSAGE_SRC</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">(</span><span style="color:rgb(0,0,0)">msg</span><span style="color:rgb(0,0,0)">)</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">==</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">GST_OBJECT</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">(</span><span style="color:rgb(0,0,0)">data</span><span style="color:rgb(0,0,0)">.</span><span style="color:rgb(128,0,0)">pipeline</span><span style="color:rgb(0,0,0)">))</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">{</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,0,128)">GstState</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">old_state</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">new_state</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">pending_state</span><span style="color:rgb(0,0,0)">;</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span>gst_message_parse_state_changed<span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">(</span><span style="color:rgb(0,0,0)">msg</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">&</span><span style="color:rgb(0,0,0)">old_state</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">&</span><span style="color:rgb(0,0,0)">new_state</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">&</span><span style="color:rgb(0,0,0)">pending_state</span><span style="color:rgb(0,0,0)">);</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">g_print</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">(</span><span style="color:rgb(0,128,0)">"Pipeline</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">state</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">changed</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">from</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">%s</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">to</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">%s:\n"</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">gst_element_state_get_name</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">(</span><span style="color:rgb(0,0,0)">old_state</span><span style="color:rgb(0,0,0)">),</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">gst_element_state_get_name</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">(</span><span style="color:rgb(0,0,0)">new_state</span><span style="color:rgb(0,0,0)">));</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">}</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,128,0)">break</span><span style="color:rgb(0,0,0)">;</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,128,0)">default</span><span style="color:rgb(0,0,0)">:</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">/*</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">We</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">should</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">not</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">reach</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">here</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">*/</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">g_printerr</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">(</span><span style="color:rgb(0,128,0)">"Unexpected</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">message</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">received.\n"</span><span style="color:rgb(0,0,0)">);</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,128,0)">break</span><span style="color:rgb(0,0,0)">;</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">}</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><br></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">gst_message_unref</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">(</span><span style="color:rgb(0,0,0)">msg</span><span style="color:rgb(0,0,0)">);</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">}</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">}</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,128,0)">while</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">(!</span><span style="color:rgb(0,0,0)">terminate</span><span style="color:rgb(0,0,0)">);</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><br></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,128,0)">return</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">0</span><span style="color:rgb(0,0,0)">;</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(0,0,0)">}</span></pre><pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(0,0,0)"><br></span></pre><pre style="margin-top:0px;margin-bottom:0px">
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(0,128,0)">/*</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">This</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">function</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">will</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">be</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">called</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">by</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">the</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">pad-added</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">signal</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">*/</span></pre><pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(128,128,0)">static</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,128,0)">void</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">pad_added_handler</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">(</span><span style="color:rgb(128,0,128)">GstElement</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">*</span><span style="color:rgb(0,0,0)">src</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,0,128)">GstPad</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">*</span><span style="color:rgb(0,0,0)">new_pad</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,0,128)">PipelineData</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">*</span><span style="color:rgb(0,0,0)">data</span><span style="color:rgb(0,0,0)">)</span></pre><pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(0,0,0)">{</span></pre><pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,0,128)">GstPad</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">*</span><span style="color:rgb(0,0,0)">sink_pad</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">=</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">gst_element_get_static_pad</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">(</span><span style="color:rgb(0,0,0)">data</span><span style="color:rgb(0,0,0)">-></span><span style="color:rgb(128,0,0)">sink</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">"sink"</span><span style="color:rgb(0,0,0)">);</span></pre><pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,0,128)">GstPadLinkReturn</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">ret</span><span style="color:rgb(0,0,0)">;</span></pre><pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,0,128)">GstCaps</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">*</span><span style="color:rgb(0,0,0)">new_pad_caps</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">=</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">NULL</span><span style="color:rgb(0,0,0)">;</span></pre><pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,128,0)">const</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,0,128)">gchar</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">*</span><span style="color:rgb(0,0,0)">new_pad_type</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">=</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">NULL</span><span style="color:rgb(0,0,0)">;</span></pre><pre style="margin-top:0px;margin-bottom:0px"><br></pre><pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">g_print</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">(</span><span style="color:rgb(0,128,0)">"Received</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">new</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">pad</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">'%s'</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">from</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">'%s':\n"</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">GST_PAD_NAME</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">(</span><span style="color:rgb(0,0,0)">new_pad</span><span style="color:rgb(0,0,0)">),</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">GST_ELEMENT_NAME</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">(</span><span style="color:rgb(0,0,0)">src</span><span style="color:rgb(0,0,0)">));</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">/*</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">If</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">our</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">converter</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">is</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">already</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">linked,</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">we</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">have</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">nothing</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">to</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">do</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">here</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">*/</span></pre><pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,128,0)">if</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">(</span>gst_pad_is_linked<span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">(</span><span style="color:rgb(0,0,0)">sink_pad</span><span style="color:rgb(0,0,0)">))</span></pre><pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">{</span></pre><pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">g_print</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">(</span><span style="color:rgb(0,128,0)">"</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">We</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">are</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">already</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">linked.</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">Ignoring.\n"</span><span style="color:rgb(0,0,0)">);</span></pre><pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,128,0)">goto</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,0,0)">exit</span><span style="color:rgb(0,0,0)">;</span></pre><pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">}</span></pre><pre style="margin-top:0px;margin-bottom:0px"><br></pre><pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">/*</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">Attempt</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">the</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">link</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">*/</span></pre><pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">ret</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">=</span><span style="color:rgb(192,192,192)"> </span>gst_pad_link<span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">(</span><span style="color:rgb(0,0,0)">new_pad</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">sink_pad</span><span style="color:rgb(0,0,0)">);</span></pre><pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,128,0)">if</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">(</span><span style="color:rgb(0,0,128)">GST_PAD_LINK_FAILED</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">(</span><span style="color:rgb(0,0,0)">ret</span><span style="color:rgb(0,0,0)">))</span></pre><pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">g_print</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">(</span><span style="color:rgb(0,128,0)">"</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">Type</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">is</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">'%s'</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">but</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">link</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">failed.\n"</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">new_pad_type</span><span style="color:rgb(0,0,0)">);</span></pre><pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,128,0)">else</span></pre><pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">g_print</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">(</span><span style="color:rgb(0,128,0)">"</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">Link</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">succeeded</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">(type</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">'%s').\n"</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">new_pad_type</span><span style="color:rgb(0,0,0)">);</span></pre><pre style="margin-top:0px;margin-bottom:0px"><br></pre><pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,0,0)">exit</span><span style="color:rgb(0,0,0)">:</span></pre><pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">/*</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">Unreference</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">the</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">new</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">pad's</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">caps,</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">if</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">we</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">got</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">them</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">*/</span></pre><pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,128,0)">if</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">(</span><span style="color:rgb(0,0,0)">new_pad_caps</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">!=</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">NULL</span><span style="color:rgb(0,0,0)">)</span></pre><pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">gst_caps_unref</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">(</span><span style="color:rgb(0,0,0)">new_pad_caps</span><span style="color:rgb(0,0,0)">);</span></pre><pre style="margin-top:0px;margin-bottom:0px"><br></pre><pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">/*</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">Unreference</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">the</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">sink</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">pad</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">*/</span></pre><pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">gst_object_unref</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">(</span><span style="color:rgb(0,0,0)">sink_pad</span><span style="color:rgb(0,0,0)">);</span></pre><pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(0,0,0)">}</span></pre></pre></div></div>