<div dir="ltr">Hi Team , <div>I have integrated GStreamer library 1.12.2 version in my ios application that supports audio and video streaming through raspberry pi device . Functionality that has been implemeted is as follows:</div><div>1. Video streaming has to run all time in my application once the application is launched and on main screen.</div><div>2. There are one button one  for receiving audio along with video streaming that shoud run seamlessly</div><div> For which i created two  pipelines one for video and one for audio from raspberry pi device to my ios application.</div><div><br></div><div>I have facing a crash as Attempted to dereference garbage pointer when toggling audio i.e play and pause audio or keeping my app still for couple of minutes it gets a crash . </div><div><br></div><div>I am attaching some code which i used to create pipeline for video and audio.</div><div>







<p class="gmail-p1" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,132,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">/* for video and audio du to app */</span></p>
<p class="gmail-p2" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">-(</span><span class="gmail-s2" style="font-variant-ligatures:no-common-ligatures;color:rgb(186,45,162)">void</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">) app_function</span></p>
<p class="gmail-p2" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">{</span></p>
<p class="gmail-p2" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">    </span><span class="gmail-s3" style="font-variant-ligatures:no-common-ligatures;color:rgb(112,61,170)">GstBus</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"> *bus;</span></p>
<p class="gmail-p2" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">    </span><span class="gmail-s3" style="font-variant-ligatures:no-common-ligatures;color:rgb(112,61,170)">GSource</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"> *bus_source;</span></p>
<p class="gmail-p2" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">    </span><span class="gmail-s3" style="font-variant-ligatures:no-common-ligatures;color:rgb(112,61,170)">GError</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"> *error = </span><span class="gmail-s2" style="font-variant-ligatures:no-common-ligatures;color:rgb(186,45,162)">NULL</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">;</span></p>
<p class="gmail-p3" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0);min-height:13px"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">    </span></p>
<p class="gmail-p2" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">    </span><span class="gmail-s3" style="font-variant-ligatures:no-common-ligatures;color:rgb(112,61,170)">GstBus</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"> *bus1;</span></p>
<p class="gmail-p2" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">    </span><span class="gmail-s3" style="font-variant-ligatures:no-common-ligatures;color:rgb(112,61,170)">GSource</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"> *bus_source1;</span></p>
<p class="gmail-p3" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0);min-height:13px"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">    </span></p>
<p class="gmail-p4" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(209,47,27)"><span class="gmail-s4" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">    </span><span class="gmail-s5" style="font-variant-ligatures:no-common-ligatures;color:rgb(120,73,42)">GST_DEBUG</span><span class="gmail-s4" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)"> (</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">"Creating pipeline"</span><span class="gmail-s4" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">);</span></p>
<p class="gmail-p3" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0);min-height:13px"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">    </span></p>
<p class="gmail-p1" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,132,0)"><span class="gmail-s4" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">    </span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">/* Create our own GLib Main Context and make it the default one */</span></p>
<p class="gmail-p5" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(62,30,129)"><span class="gmail-s4" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">    </span><span class="gmail-s6" style="font-variant-ligatures:no-common-ligatures;color:rgb(79,129,135)">context</span><span class="gmail-s4" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)"> = </span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">g_main_context_new</span><span class="gmail-s4" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)"> ();</span></p>
<p class="gmail-p5" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(62,30,129)"><span class="gmail-s4" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">    </span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">g_main_context_push_thread_default</span><span class="gmail-s4" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">(</span><span class="gmail-s6" style="font-variant-ligatures:no-common-ligatures;color:rgb(79,129,135)">context</span><span class="gmail-s4" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">);</span></p>
<p class="gmail-p3" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0);min-height:13px"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">    </span></p>
<p class="gmail-p1" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,132,0)"><span class="gmail-s4" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">    </span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">// du to app recieve working fine</span></p>
<p class="gmail-p4" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(209,47,27)"><span class="gmail-s4" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">    </span><span class="gmail-s6" style="font-variant-ligatures:no-common-ligatures;color:rgb(79,129,135)">audiopipeline</span><span class="gmail-s4" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)"> = </span><span class="gmail-s7" style="font-variant-ligatures:no-common-ligatures;color:rgb(62,30,129)">gst_parse_launch</span><span class="gmail-s4" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">(</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">"udpsrc port=5001 caps=\"audio/x-raw, rate = 8000, format=S16LE, channels=2\"<span class="gmail-Apple-converted-space">  </span>!audioconvert ! audioresample ! autoaudiosink sync=false"</span><span class="gmail-s4" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">, &error);</span></p>
<p class="gmail-p2" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">    </span><span class="gmail-s2" style="font-variant-ligatures:no-common-ligatures;color:rgb(186,45,162)">if</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"> (error) {</span></p>
<p class="gmail-p4" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(209,47,27)"><span class="gmail-s4" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">        </span><span class="gmail-s3" style="font-variant-ligatures:no-common-ligatures;color:rgb(112,61,170)">gchar</span><span class="gmail-s4" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)"> *message = </span><span class="gmail-s7" style="font-variant-ligatures:no-common-ligatures;color:rgb(62,30,129)">g_strdup_printf</span><span class="gmail-s4" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">(</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">"Unable to build audio pipeline: %s"</span><span class="gmail-s4" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">, error-></span><span class="gmail-s3" style="font-variant-ligatures:no-common-ligatures;color:rgb(112,61,170)">message</span><span class="gmail-s4" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">);</span></p>
<p class="gmail-p2" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">        </span><span class="gmail-s7" style="font-variant-ligatures:no-common-ligatures;color:rgb(62,30,129)">g_clear_error</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"> (&error);</span></p>
<p class="gmail-p2" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">        </span>[</span><span class="gmail-s2" style="font-variant-ligatures:no-common-ligatures;color:rgb(186,45,162)">self</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"> </span><span class="gmail-s8" style="font-variant-ligatures:no-common-ligatures;color:rgb(49,89,93)">setUIMessage</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">:message];</span></p>
<p class="gmail-p2" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">        </span><span class="gmail-s7" style="font-variant-ligatures:no-common-ligatures;color:rgb(62,30,129)">g_free</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"> (message);</span></p>
<p class="gmail-p2" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">        </span><span class="gmail-s2" style="font-variant-ligatures:no-common-ligatures;color:rgb(186,45,162)">return</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">;</span></p>
<p class="gmail-p2" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">    </span>}</span></p>
<p class="gmail-p2" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">    </span>error = </span><span class="gmail-s2" style="font-variant-ligatures:no-common-ligatures;color:rgb(186,45,162)">NULL</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">;</span></p>
<p class="gmail-p1" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,132,0)"><span class="gmail-s4" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">    </span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">// Runing<span class="gmail-Apple-converted-space">  </span>video pipeline</span></p>
<p class="gmail-p4" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(209,47,27)"><span class="gmail-s4" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">    </span><span class="gmail-s6" style="font-variant-ligatures:no-common-ligatures;color:rgb(79,129,135)">pipeline</span><span class="gmail-s4" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)"> =<span class="gmail-Apple-converted-space">  </span></span><span class="gmail-s7" style="font-variant-ligatures:no-common-ligatures;color:rgb(62,30,129)">gst_parse_launch</span><span class="gmail-s4" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">(</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">"udpsrc port=5000 ! application/x-rtp, payload=96 ! rtph264depay ! avdec_h264 ! autovideosink sync=false text-overlay=false"</span><span class="gmail-s4" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">, &error);</span></p>
<p class="gmail-p2" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">    </span><span class="gmail-s2" style="font-variant-ligatures:no-common-ligatures;color:rgb(186,45,162)">if</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"> (error) {</span></p>
<p class="gmail-p4" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(209,47,27)"><span class="gmail-s4" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">        </span><span class="gmail-s3" style="font-variant-ligatures:no-common-ligatures;color:rgb(112,61,170)">gchar</span><span class="gmail-s4" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)"> *message = </span><span class="gmail-s7" style="font-variant-ligatures:no-common-ligatures;color:rgb(62,30,129)">g_strdup_printf</span><span class="gmail-s4" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">(</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">"Unable to build video pipeline: %s"</span><span class="gmail-s4" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">, error-></span><span class="gmail-s3" style="font-variant-ligatures:no-common-ligatures;color:rgb(112,61,170)">message</span><span class="gmail-s4" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">);</span></p>
<p class="gmail-p2" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">        </span><span class="gmail-s7" style="font-variant-ligatures:no-common-ligatures;color:rgb(62,30,129)">g_clear_error</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"> (&error);</span></p>
<p class="gmail-p2" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">        </span>[</span><span class="gmail-s2" style="font-variant-ligatures:no-common-ligatures;color:rgb(186,45,162)">self</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"> </span><span class="gmail-s8" style="font-variant-ligatures:no-common-ligatures;color:rgb(49,89,93)">setUIMessage</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">:message];</span></p>
<p class="gmail-p2" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">        </span><span class="gmail-s7" style="font-variant-ligatures:no-common-ligatures;color:rgb(62,30,129)">g_free</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"> (message);</span></p>
<p class="gmail-p2" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">        </span><span class="gmail-s2" style="font-variant-ligatures:no-common-ligatures;color:rgb(186,45,162)">return</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">;</span></p>
<p class="gmail-p2" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">    </span>}</span></p>
<p class="gmail-p3" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0);min-height:13px"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">    </span></p>
<p class="gmail-p1" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,132,0)"><span class="gmail-s4" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">    </span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">/**************** for video<span class="gmail-Apple-converted-space">  </span>*****************/</span></p>
<p class="gmail-p1" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,132,0)"><span class="gmail-s4" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">    </span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">/* Set the pipeline to READY, so it can already accept a window handle */</span></p>
<p class="gmail-p5" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(62,30,129)"><span class="gmail-s4" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">    </span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">gst_element_set_state</span><span class="gmail-s4" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">(</span><span class="gmail-s6" style="font-variant-ligatures:no-common-ligatures;color:rgb(79,129,135)">pipeline</span><span class="gmail-s4" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">, </span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">GST_STATE_READY</span><span class="gmail-s4" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">);</span></p>
<p class="gmail-p3" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0);min-height:13px"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">    </span></p>
<p class="gmail-p6" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(120,73,42)"><span class="gmail-s4" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">    </span><span class="gmail-s6" style="font-variant-ligatures:no-common-ligatures;color:rgb(79,129,135)">video_sink</span><span class="gmail-s4" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)"> = </span><span class="gmail-s7" style="font-variant-ligatures:no-common-ligatures;color:rgb(62,30,129)">gst_bin_get_by_interface</span><span class="gmail-s4" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">(</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">GST_BIN</span><span class="gmail-s4" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">(</span><span class="gmail-s6" style="font-variant-ligatures:no-common-ligatures;color:rgb(79,129,135)">pipeline</span><span class="gmail-s4" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">), </span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">GST_TYPE_VIDEO_OVERLAY</span><span class="gmail-s4" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">);</span></p>
<p class="gmail-p2" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">    </span><span class="gmail-s2" style="font-variant-ligatures:no-common-ligatures;color:rgb(186,45,162)">if</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"> (!</span><span class="gmail-s6" style="font-variant-ligatures:no-common-ligatures;color:rgb(79,129,135)">video_sink</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">) {</span></p>
<p class="gmail-p4" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(209,47,27)"><span class="gmail-s4" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">        </span><span class="gmail-s5" style="font-variant-ligatures:no-common-ligatures;color:rgb(120,73,42)">GST_ERROR</span><span class="gmail-s4" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)"> (</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">"Could not retrieve video sink"</span><span class="gmail-s4" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">);</span></p>
<p class="gmail-p2" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">        </span><span class="gmail-s2" style="font-variant-ligatures:no-common-ligatures;color:rgb(186,45,162)">return</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">;</span></p>
<p class="gmail-p2" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">    </span>}</span></p>
<p class="gmail-p5" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(62,30,129)"><span class="gmail-s4" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">    </span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">gst_video_overlay_set_window_handle</span><span class="gmail-s4" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">(</span><span class="gmail-s5" style="font-variant-ligatures:no-common-ligatures;color:rgb(120,73,42)">GST_VIDEO_OVERLAY</span><span class="gmail-s4" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">(</span><span class="gmail-s6" style="font-variant-ligatures:no-common-ligatures;color:rgb(79,129,135)">video_sink</span><span class="gmail-s4" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">), (</span><span class="gmail-s3" style="font-variant-ligatures:no-common-ligatures;color:rgb(112,61,170)">guintptr</span><span class="gmail-s4" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">) (</span><span class="gmail-s2" style="font-variant-ligatures:no-common-ligatures;color:rgb(186,45,162)">id</span><span class="gmail-s4" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">) </span><span class="gmail-s6" style="font-variant-ligatures:no-common-ligatures;color:rgb(79,129,135)">ui_video_view</span><span class="gmail-s4" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">);</span></p>
<p class="gmail-p3" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0);min-height:13px"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">    </span></p>
<p class="gmail-p1" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,132,0)"><span class="gmail-s4" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">    </span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">/* Instruct the bus to emit signals for each received message, and connect to the interesting signals */</span></p>
<p class="gmail-p5" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(62,30,129)"><span class="gmail-s4" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)"><span class="gmail-Apple-converted-space">    </span>bus = </span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">gst_element_get_bus</span><span class="gmail-s4" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)"> (</span><span class="gmail-s6" style="font-variant-ligatures:no-common-ligatures;color:rgb(79,129,135)">pipeline</span><span class="gmail-s4" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">);</span></p>
<p class="gmail-p2" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">    </span>bus_source = </span><span class="gmail-s7" style="font-variant-ligatures:no-common-ligatures;color:rgb(62,30,129)">gst_bus_create_watch</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"> (bus);</span></p>
<p class="gmail-p5" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(62,30,129)"><span class="gmail-s4" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">    </span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">g_source_set_callback</span><span class="gmail-s4" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)"> (bus_source, (</span><span class="gmail-s3" style="font-variant-ligatures:no-common-ligatures;color:rgb(112,61,170)">GSourceFunc</span><span class="gmail-s4" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">) </span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">gst_bus_async_signal_func</span><span class="gmail-s4" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">, </span><span class="gmail-s2" style="font-variant-ligatures:no-common-ligatures;color:rgb(186,45,162)">NULL</span><span class="gmail-s4" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">, </span><span class="gmail-s2" style="font-variant-ligatures:no-common-ligatures;color:rgb(186,45,162)">NULL</span><span class="gmail-s4" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">);</span></p>
<p class="gmail-p2" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">    </span><span class="gmail-s7" style="font-variant-ligatures:no-common-ligatures;color:rgb(62,30,129)">g_source_attach</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"> (bus_source, </span><span class="gmail-s6" style="font-variant-ligatures:no-common-ligatures;color:rgb(79,129,135)">context</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">);</span></p>
<p class="gmail-p2" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">    </span><span class="gmail-s7" style="font-variant-ligatures:no-common-ligatures;color:rgb(62,30,129)">g_source_unref</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"> (bus_source);</span></p>
<p class="gmail-p2" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">    </span><span class="gmail-s5" style="font-variant-ligatures:no-common-ligatures;color:rgb(120,73,42)">g_signal_connect</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"> (</span><span class="gmail-s5" style="font-variant-ligatures:no-common-ligatures;color:rgb(120,73,42)">G_OBJECT</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"> (bus), </span><span class="gmail-s9" style="font-variant-ligatures:no-common-ligatures;color:rgb(209,47,27)">"message::error"</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">, (</span><span class="gmail-s3" style="font-variant-ligatures:no-common-ligatures;color:rgb(112,61,170)">GCallback</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">)</span><span class="gmail-s8" style="font-variant-ligatures:no-common-ligatures;color:rgb(49,89,93)">error_cb</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">, (</span><span class="gmail-s2" style="font-variant-ligatures:no-common-ligatures;color:rgb(186,45,162)">__bridge</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"> </span><span class="gmail-s2" style="font-variant-ligatures:no-common-ligatures;color:rgb(186,45,162)">void</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"> *)</span><span class="gmail-s2" style="font-variant-ligatures:no-common-ligatures;color:rgb(186,45,162)">self</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">);</span></p>
<p class="gmail-p2" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">    </span><span class="gmail-s5" style="font-variant-ligatures:no-common-ligatures;color:rgb(120,73,42)">g_signal_connect</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"> (</span><span class="gmail-s5" style="font-variant-ligatures:no-common-ligatures;color:rgb(120,73,42)">G_OBJECT</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"> (bus), </span><span class="gmail-s9" style="font-variant-ligatures:no-common-ligatures;color:rgb(209,47,27)">"message::state-changed"</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">, (</span><span class="gmail-s3" style="font-variant-ligatures:no-common-ligatures;color:rgb(112,61,170)">GCallback</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">)</span><span class="gmail-s8" style="font-variant-ligatures:no-common-ligatures;color:rgb(49,89,93)">state_changed_cb</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">, (</span><span class="gmail-s2" style="font-variant-ligatures:no-common-ligatures;color:rgb(186,45,162)">__bridge</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"> </span><span class="gmail-s2" style="font-variant-ligatures:no-common-ligatures;color:rgb(186,45,162)">void</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"> *)</span><span class="gmail-s2" style="font-variant-ligatures:no-common-ligatures;color:rgb(186,45,162)">self</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">);</span></p>
<p class="gmail-p5" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(62,30,129)"><span class="gmail-s4" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">    </span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">gst_object_unref</span><span class="gmail-s4" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)"> (bus);</span></p>
<p class="gmail-p3" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0);min-height:13px"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">    </span></p>
<p class="gmail-p3" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0);min-height:13px"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">    </span></p>
<p class="gmail-p1" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,132,0)"><span class="gmail-s4" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">    </span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">// for audio</span></p>
<p class="gmail-p1" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,132,0)"><span class="gmail-s4" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">    </span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">/**************** for audio **************/</span></p>
<p class="gmail-p5" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(62,30,129)"><span class="gmail-s4" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)"><span class="gmail-Apple-converted-space">    </span>bus1 = </span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">gst_element_get_bus</span><span class="gmail-s4" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)"> (</span><span class="gmail-s6" style="font-variant-ligatures:no-common-ligatures;color:rgb(79,129,135)">audiopipeline</span><span class="gmail-s4" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">);</span></p>
<p class="gmail-p2" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">    </span>bus_source1 = </span><span class="gmail-s7" style="font-variant-ligatures:no-common-ligatures;color:rgb(62,30,129)">gst_bus_create_watch</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"> (bus1);</span></p>
<p class="gmail-p5" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(62,30,129)"><span class="gmail-s4" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">    </span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">g_source_set_callback</span><span class="gmail-s4" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)"> (bus_source1, (</span><span class="gmail-s3" style="font-variant-ligatures:no-common-ligatures;color:rgb(112,61,170)">GSourceFunc</span><span class="gmail-s4" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">) </span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">gst_bus_async_signal_func</span><span class="gmail-s4" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">, </span><span class="gmail-s2" style="font-variant-ligatures:no-common-ligatures;color:rgb(186,45,162)">NULL</span><span class="gmail-s4" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">, </span><span class="gmail-s2" style="font-variant-ligatures:no-common-ligatures;color:rgb(186,45,162)">NULL</span><span class="gmail-s4" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">);</span></p>
<p class="gmail-p2" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">    </span><span class="gmail-s7" style="font-variant-ligatures:no-common-ligatures;color:rgb(62,30,129)">g_source_attach</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"> (bus_source1, </span><span class="gmail-s6" style="font-variant-ligatures:no-common-ligatures;color:rgb(79,129,135)">context</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">);</span></p>
<p class="gmail-p2" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">    </span><span class="gmail-s7" style="font-variant-ligatures:no-common-ligatures;color:rgb(62,30,129)">g_source_unref</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"> (bus_source1);</span></p>
<p class="gmail-p2" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">    </span><span class="gmail-s5" style="font-variant-ligatures:no-common-ligatures;color:rgb(120,73,42)">g_signal_connect</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"> (</span><span class="gmail-s5" style="font-variant-ligatures:no-common-ligatures;color:rgb(120,73,42)">G_OBJECT</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"> (bus1), </span><span class="gmail-s9" style="font-variant-ligatures:no-common-ligatures;color:rgb(209,47,27)">"message::error"</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">, (</span><span class="gmail-s3" style="font-variant-ligatures:no-common-ligatures;color:rgb(112,61,170)">GCallback</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">)</span><span class="gmail-s8" style="font-variant-ligatures:no-common-ligatures;color:rgb(49,89,93)">error_cb_audio</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">, (</span><span class="gmail-s2" style="font-variant-ligatures:no-common-ligatures;color:rgb(186,45,162)">__bridge</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"> </span><span class="gmail-s2" style="font-variant-ligatures:no-common-ligatures;color:rgb(186,45,162)">void</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"> *)</span><span class="gmail-s2" style="font-variant-ligatures:no-common-ligatures;color:rgb(186,45,162)">self</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">);</span></p>
<p class="gmail-p2" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">    </span><span class="gmail-s5" style="font-variant-ligatures:no-common-ligatures;color:rgb(120,73,42)">g_signal_connect</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"> (</span><span class="gmail-s5" style="font-variant-ligatures:no-common-ligatures;color:rgb(120,73,42)">G_OBJECT</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"> (bus1), </span><span class="gmail-s9" style="font-variant-ligatures:no-common-ligatures;color:rgb(209,47,27)">"message::state-changed"</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">, (</span><span class="gmail-s3" style="font-variant-ligatures:no-common-ligatures;color:rgb(112,61,170)">GCallback</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">)</span><span class="gmail-s8" style="font-variant-ligatures:no-common-ligatures;color:rgb(49,89,93)">state_changed_cb_audio</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">, (</span><span class="gmail-s2" style="font-variant-ligatures:no-common-ligatures;color:rgb(186,45,162)">__bridge</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"> </span><span class="gmail-s2" style="font-variant-ligatures:no-common-ligatures;color:rgb(186,45,162)">void</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"> *)</span><span class="gmail-s2" style="font-variant-ligatures:no-common-ligatures;color:rgb(186,45,162)">self</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">);</span></p>
<p class="gmail-p5" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(62,30,129)"><span class="gmail-s4" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">    </span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">gst_object_unref</span><span class="gmail-s4" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)"> (bus1);</span></p>
<p class="gmail-p3" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0);min-height:13px"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"></span><br></p>
<p class="gmail-p1" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,132,0)"><span class="gmail-s4" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">    </span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">/* Create a GLib Main Loop and set it to run */</span></p>
<p class="gmail-p4" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(209,47,27)"><span class="gmail-s4" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">    </span><span class="gmail-s5" style="font-variant-ligatures:no-common-ligatures;color:rgb(120,73,42)">GST_DEBUG</span><span class="gmail-s4" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)"> (</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">"Entering main loop..."</span><span class="gmail-s4" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">);</span></p>
<p class="gmail-p7" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(79,129,135)"><span class="gmail-s4" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">    </span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">main_loop</span><span class="gmail-s4" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)"> = </span><span class="gmail-s7" style="font-variant-ligatures:no-common-ligatures;color:rgb(62,30,129)">g_main_loop_new</span><span class="gmail-s4" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)"> (</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">context</span><span class="gmail-s4" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">, </span><span class="gmail-s2" style="font-variant-ligatures:no-common-ligatures;color:rgb(186,45,162)">FALSE</span><span class="gmail-s4" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">);</span></p>
<p class="gmail-p8" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(49,89,93)"><span class="gmail-s4" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)"><span class="gmail-Apple-converted-space">    </span>[</span><span class="gmail-s2" style="font-variant-ligatures:no-common-ligatures;color:rgb(186,45,162)">self</span><span class="gmail-s4" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)"> </span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">check_initialization_complete</span><span class="gmail-s4" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">];</span></p>
<p class="gmail-p5" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(62,30,129)"><span class="gmail-s4" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">    </span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">g_main_loop_run</span><span class="gmail-s4" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)"> (</span><span class="gmail-s6" style="font-variant-ligatures:no-common-ligatures;color:rgb(79,129,135)">main_loop</span><span class="gmail-s4" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">);</span></p>
<p class="gmail-p4" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(209,47,27)"><span class="gmail-s4" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">    </span><span class="gmail-s5" style="font-variant-ligatures:no-common-ligatures;color:rgb(120,73,42)">GST_DEBUG</span><span class="gmail-s4" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)"> (</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">"Exited main loop"</span><span class="gmail-s4" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">);</span></p>
<p class="gmail-p5" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(62,30,129)"><span class="gmail-s4" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">    </span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">g_main_loop_unref</span><span class="gmail-s4" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)"> (</span><span class="gmail-s6" style="font-variant-ligatures:no-common-ligatures;color:rgb(79,129,135)">main_loop</span><span class="gmail-s4" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">);</span></p>
<p class="gmail-p7" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(79,129,135)"><span class="gmail-s4" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">    </span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">main_loop</span><span class="gmail-s4" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)"> = </span><span class="gmail-s2" style="font-variant-ligatures:no-common-ligatures;color:rgb(186,45,162)">NULL</span><span class="gmail-s4" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">;</span></p>
<p class="gmail-p3" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0);min-height:13px"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"></span><br></p>
<p class="gmail-p3" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0);min-height:13px"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">    </span></p>
<p class="gmail-p1" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,132,0)"><span class="gmail-s4" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">    </span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">/* Free resources */</span></p>
<p class="gmail-p5" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(62,30,129)"><span class="gmail-s4" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">    </span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">g_main_context_pop_thread_default</span><span class="gmail-s4" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">(</span><span class="gmail-s6" style="font-variant-ligatures:no-common-ligatures;color:rgb(79,129,135)">context</span><span class="gmail-s4" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">);</span></p>
<p class="gmail-p5" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(62,30,129)"><span class="gmail-s4" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">    </span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">g_main_context_unref</span><span class="gmail-s4" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)"> (</span><span class="gmail-s6" style="font-variant-ligatures:no-common-ligatures;color:rgb(79,129,135)">context</span><span class="gmail-s4" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">);</span></p>
<p class="gmail-p5" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(62,30,129)"><span class="gmail-s4" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">    </span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">gst_element_set_state</span><span class="gmail-s4" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)"> (</span><span class="gmail-s6" style="font-variant-ligatures:no-common-ligatures;color:rgb(79,129,135)">pipeline</span><span class="gmail-s4" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">, </span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">GST_STATE_NULL</span><span class="gmail-s4" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">);</span></p>
<p class="gmail-p5" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(62,30,129)"><span class="gmail-s4" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">    </span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">gst_object_unref</span><span class="gmail-s4" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)"> (</span><span class="gmail-s6" style="font-variant-ligatures:no-common-ligatures;color:rgb(79,129,135)">pipeline</span><span class="gmail-s4" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">);</span></p>
<p class="gmail-p3" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0);min-height:13px"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">    </span></p>
<p class="gmail-p5" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(62,30,129)"><span class="gmail-s4" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">    </span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">gst_element_set_state</span><span class="gmail-s4" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)"> (</span><span class="gmail-s6" style="font-variant-ligatures:no-common-ligatures;color:rgb(79,129,135)">audiopipeline</span><span class="gmail-s4" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">, </span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">GST_STATE_NULL</span><span class="gmail-s4" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">);</span></p>
<p class="gmail-p5" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(62,30,129)"><span class="gmail-s4" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">    </span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">gst_object_unref</span><span class="gmail-s4" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)"> (</span><span class="gmail-s6" style="font-variant-ligatures:no-common-ligatures;color:rgb(79,129,135)">audiopipeline</span><span class="gmail-s4" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">);</span></p>
<p class="gmail-p3" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0);min-height:13px"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">    </span></p>
<p class="gmail-p9" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(186,45,162)"><span class="gmail-s4" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">    </span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">return</span><span class="gmail-s4" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">;</span></p>
<p class="gmail-p2" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">}</span></p></div><div><br></div><div><br></div><div>







<p class="gmail-p1" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,132,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">/* Retrieve errors from the bus and show them on the UI */</span></p>
<p class="gmail-p2" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s2" style="font-variant-ligatures:no-common-ligatures;color:rgb(186,45,162)">static</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"> </span><span class="gmail-s2" style="font-variant-ligatures:no-common-ligatures;color:rgb(186,45,162)">void</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"> error_cb (</span><span class="gmail-s3" style="font-variant-ligatures:no-common-ligatures;color:rgb(112,61,170)">GstBus</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"> *bus, </span><span class="gmail-s3" style="font-variant-ligatures:no-common-ligatures;color:rgb(112,61,170)">GstMessage</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"> *msg, </span><span class="gmail-s4" style="font-variant-ligatures:no-common-ligatures;color:rgb(79,129,135)">GStreamerBackend</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"> *</span><span class="gmail-s2" style="font-variant-ligatures:no-common-ligatures;color:rgb(186,45,162)">self</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">)</span></p>
<p class="gmail-p2" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">{</span></p>
<p class="gmail-p2" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">    </span><span class="gmail-s3" style="font-variant-ligatures:no-common-ligatures;color:rgb(112,61,170)">GError</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"> *err;</span></p>
<p class="gmail-p2" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">    </span><span class="gmail-s3" style="font-variant-ligatures:no-common-ligatures;color:rgb(112,61,170)">gchar</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"> *debug_info;</span></p>
<p class="gmail-p2" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">    </span><span class="gmail-s3" style="font-variant-ligatures:no-common-ligatures;color:rgb(112,61,170)">gchar</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"> *message_string;</span></p>
<p class="gmail-p3" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0);min-height:13px"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"></span><br></p>
<p class="gmail-p2" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">    </span><span class="gmail-s5" style="font-variant-ligatures:no-common-ligatures;color:rgb(62,30,129)">gst_message_parse_error</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"> (msg, &err, &debug_info);</span></p>
<p class="gmail-p2" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">    </span>message_string = </span><span class="gmail-s5" style="font-variant-ligatures:no-common-ligatures;color:rgb(62,30,129)">g_strdup_printf</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"> (</span><span class="gmail-s6" style="font-variant-ligatures:no-common-ligatures;color:rgb(209,47,27)">"Error received from element %s: %s"</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">, </span><span class="gmail-s7" style="font-variant-ligatures:no-common-ligatures;color:rgb(120,73,42)">GST_OBJECT_NAME</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"> (msg->src), err-></span><span class="gmail-s3" style="font-variant-ligatures:no-common-ligatures;color:rgb(112,61,170)">message</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">);</span></p>
<p class="gmail-p4" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(62,30,129)"><span class="gmail-s8" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">    </span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">g_clear_error</span><span class="gmail-s8" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)"> (&err);</span></p>
<p class="gmail-p2" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">    </span><span class="gmail-s5" style="font-variant-ligatures:no-common-ligatures;color:rgb(62,30,129)">g_free</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"> (debug_info);</span></p>
<p class="gmail-p2" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">    </span>[</span><span class="gmail-s2" style="font-variant-ligatures:no-common-ligatures;color:rgb(186,45,162)">self</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"> </span><span class="gmail-s9" style="font-variant-ligatures:no-common-ligatures;color:rgb(49,89,93)">setUIMessage</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">:message_string];</span></p>
<p class="gmail-p2" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">    </span><span class="gmail-s5" style="font-variant-ligatures:no-common-ligatures;color:rgb(62,30,129)">g_free</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"> (message_string);</span></p>
<p class="gmail-p4" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(62,30,129)"><span class="gmail-s8" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">    </span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">gst_element_set_state</span><span class="gmail-s8" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)"> (</span><span class="gmail-s2" style="font-variant-ligatures:no-common-ligatures;color:rgb(186,45,162)">self</span><span class="gmail-s8" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">-></span><span class="gmail-s4" style="font-variant-ligatures:no-common-ligatures;color:rgb(79,129,135)">pipeline</span><span class="gmail-s8" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">, </span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">GST_STATE_NULL</span><span class="gmail-s8" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">);</span></p>
<p class="gmail-p2" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">}</span></p>
<p class="gmail-p3" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0);min-height:13px"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"></span><br></p>
<p class="gmail-p1" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,132,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">/* Notify UI about pipeline state changes */</span></p>
<p class="gmail-p2" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s2" style="font-variant-ligatures:no-common-ligatures;color:rgb(186,45,162)">static</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"> </span><span class="gmail-s2" style="font-variant-ligatures:no-common-ligatures;color:rgb(186,45,162)">void</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"> state_changed_cb (</span><span class="gmail-s3" style="font-variant-ligatures:no-common-ligatures;color:rgb(112,61,170)">GstBus</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"> *bus, </span><span class="gmail-s3" style="font-variant-ligatures:no-common-ligatures;color:rgb(112,61,170)">GstMessage</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"> *msg, </span><span class="gmail-s4" style="font-variant-ligatures:no-common-ligatures;color:rgb(79,129,135)">GStreamerBackend</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"> *</span><span class="gmail-s2" style="font-variant-ligatures:no-common-ligatures;color:rgb(186,45,162)">self</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">)</span></p>
<p class="gmail-p2" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">{</span></p>
<p class="gmail-p2" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">    </span><span class="gmail-s3" style="font-variant-ligatures:no-common-ligatures;color:rgb(112,61,170)">GstState</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"> old_state, new_state, pending_state;</span></p>
<p class="gmail-p2" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">    </span><span class="gmail-s5" style="font-variant-ligatures:no-common-ligatures;color:rgb(62,30,129)">gst_message_parse_state_changed</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"> (msg, &old_state, &new_state, &pending_state);</span></p>
<p class="gmail-p1" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,132,0)"><span class="gmail-s8" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">    </span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">/* Only pay attention to messages coming from the pipeline, not its children */</span></p>
<p class="gmail-p2" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">    </span><span class="gmail-s2" style="font-variant-ligatures:no-common-ligatures;color:rgb(186,45,162)">if</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"> (</span><span class="gmail-s7" style="font-variant-ligatures:no-common-ligatures;color:rgb(120,73,42)">GST_MESSAGE_SRC</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"> (msg) == </span><span class="gmail-s7" style="font-variant-ligatures:no-common-ligatures;color:rgb(120,73,42)">GST_OBJECT</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"> (</span><span class="gmail-s2" style="font-variant-ligatures:no-common-ligatures;color:rgb(186,45,162)">self</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">->pipeline)) {</span></p>
<p class="gmail-p4" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(62,30,129)"><span class="gmail-s8" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">        </span><span class="gmail-s3" style="font-variant-ligatures:no-common-ligatures;color:rgb(112,61,170)">gchar</span><span class="gmail-s8" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)"> *message = </span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">g_strdup_printf</span><span class="gmail-s8" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">(</span><span class="gmail-s6" style="font-variant-ligatures:no-common-ligatures;color:rgb(209,47,27)">"State changed to %s"</span><span class="gmail-s8" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">, </span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">gst_element_state_get_name</span><span class="gmail-s8" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">(new_state));</span></p>
<p class="gmail-p2" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">        </span>[</span><span class="gmail-s2" style="font-variant-ligatures:no-common-ligatures;color:rgb(186,45,162)">self</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"> </span><span class="gmail-s9" style="font-variant-ligatures:no-common-ligatures;color:rgb(49,89,93)">setUIMessage</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">:message];</span></p>
<p class="gmail-p2" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">        </span><span class="gmail-s5" style="font-variant-ligatures:no-common-ligatures;color:rgb(62,30,129)">g_free</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"> (message);</span></p>
<p class="gmail-p2" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">    </span>}</span></p>
<p class="gmail-p2" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">}</span></p>
<p class="gmail-p3" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0);min-height:13px"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"></span><br></p>
<p class="gmail-p1" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,132,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">/* Check if all conditions are met to report GStreamer as initialized.</span></p>
<p class="gmail-p1" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,132,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space"> </span>* These conditions will change depending on the application */</span></p>
<p class="gmail-p2" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">-(</span><span class="gmail-s2" style="font-variant-ligatures:no-common-ligatures;color:rgb(186,45,162)">void</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">) check_initialization_complete</span></p>
<p class="gmail-p2" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">{</span></p>
<p class="gmail-p5" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(79,129,135)"><span class="gmail-s8" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">    </span><span class="gmail-s2" style="font-variant-ligatures:no-common-ligatures;color:rgb(186,45,162)">if</span><span class="gmail-s8" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)"> (!</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">initialized</span><span class="gmail-s8" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)"> && </span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">main_loop</span><span class="gmail-s8" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">) {</span></p>
<p class="gmail-p6" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(209,47,27)"><span class="gmail-s8" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">        </span><span class="gmail-s7" style="font-variant-ligatures:no-common-ligatures;color:rgb(120,73,42)">GST_DEBUG</span><span class="gmail-s8" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)"> (</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">"Initialization complete, notifying application."</span><span class="gmail-s8" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">);</span></p>
<p class="gmail-p2" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">        </span><span class="gmail-s2" style="font-variant-ligatures:no-common-ligatures;color:rgb(186,45,162)">if</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"> (</span><span class="gmail-s4" style="font-variant-ligatures:no-common-ligatures;color:rgb(79,129,135)">ui_delegate</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"> && [</span><span class="gmail-s4" style="font-variant-ligatures:no-common-ligatures;color:rgb(79,129,135)">ui_delegate</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"> </span><span class="gmail-s5" style="font-variant-ligatures:no-common-ligatures;color:rgb(62,30,129)">respondsToSelector</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">:</span><span class="gmail-s2" style="font-variant-ligatures:no-common-ligatures;color:rgb(186,45,162)">@selector</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">(gstreamerInitialized)])</span></p>
<p class="gmail-p2" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">        </span>{</span></p>
<p class="gmail-p7" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(49,89,93)"><span class="gmail-s8" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)"><span class="gmail-Apple-converted-space">            </span>[</span><span class="gmail-s4" style="font-variant-ligatures:no-common-ligatures;color:rgb(79,129,135)">ui_delegate</span><span class="gmail-s8" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)"> </span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">gstreamerInitialized</span><span class="gmail-s8" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">];</span></p>
<p class="gmail-p2" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">        </span>}</span></p>
<p class="gmail-p2" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">        </span><span class="gmail-s4" style="font-variant-ligatures:no-common-ligatures;color:rgb(79,129,135)">initialized</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"> = </span><span class="gmail-s2" style="font-variant-ligatures:no-common-ligatures;color:rgb(186,45,162)">TRUE</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">;</span></p>
<p class="gmail-p2" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">    </span>}</span></p>
<p class="gmail-p2" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">}</span></p>
<p class="gmail-p3" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0);min-height:13px"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"></span><br></p>
<p class="gmail-p3" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0);min-height:13px"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"></span><br></p>
<p class="gmail-p8" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(120,73,42)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">#pragma mark<span class="gmail-Apple-converted-space">  </span>- For audio -</span></p>
<p class="gmail-p3" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0);min-height:13px"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"></span><br></p>
<p class="gmail-p1" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,132,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">/* Check if all conditions are met to report GStreamer as initialized.</span></p>
<p class="gmail-p1" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,132,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space"> </span>* These conditions will change depending on the application */</span></p>
<p class="gmail-p2" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">-(</span><span class="gmail-s2" style="font-variant-ligatures:no-common-ligatures;color:rgb(186,45,162)">void</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">) check_initialization_complete_audio</span></p>
<p class="gmail-p2" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">{</span></p>
<p class="gmail-p5" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(79,129,135)"><span class="gmail-s8" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">    </span><span class="gmail-s2" style="font-variant-ligatures:no-common-ligatures;color:rgb(186,45,162)">if</span><span class="gmail-s8" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)"> (!</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">audioinitialized</span><span class="gmail-s8" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)"> && </span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">main_loop1</span><span class="gmail-s8" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">) {</span></p>
<p class="gmail-p6" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(209,47,27)"><span class="gmail-s8" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">        </span><span class="gmail-s7" style="font-variant-ligatures:no-common-ligatures;color:rgb(120,73,42)">GST_DEBUG</span><span class="gmail-s8" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)"> (</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">"Initialization complete, notifying application."</span><span class="gmail-s8" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">);</span></p>
<p class="gmail-p2" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">        </span><span class="gmail-s2" style="font-variant-ligatures:no-common-ligatures;color:rgb(186,45,162)">if</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"> (</span><span class="gmail-s4" style="font-variant-ligatures:no-common-ligatures;color:rgb(79,129,135)">ui_delegate</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"> && [</span><span class="gmail-s4" style="font-variant-ligatures:no-common-ligatures;color:rgb(79,129,135)">ui_delegate</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"> </span><span class="gmail-s5" style="font-variant-ligatures:no-common-ligatures;color:rgb(62,30,129)">respondsToSelector</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">:</span><span class="gmail-s2" style="font-variant-ligatures:no-common-ligatures;color:rgb(186,45,162)">@selector</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">(gstreamerInitialized)])</span></p>
<p class="gmail-p2" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">        </span>{</span></p>
<p class="gmail-p7" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(49,89,93)"><span class="gmail-s8" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)"><span class="gmail-Apple-converted-space">            </span>[</span><span class="gmail-s4" style="font-variant-ligatures:no-common-ligatures;color:rgb(79,129,135)">ui_delegate</span><span class="gmail-s8" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)"> </span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">gstreamerInitialized</span><span class="gmail-s8" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">];</span></p>
<p class="gmail-p2" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">        </span>}</span></p>
<p class="gmail-p5" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(79,129,135)"><span class="gmail-s8" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">        </span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">audioinitialized</span><span class="gmail-s8" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)"> = </span><span class="gmail-s2" style="font-variant-ligatures:no-common-ligatures;color:rgb(186,45,162)">TRUE</span><span class="gmail-s8" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">;</span></p>
<p class="gmail-p2" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">    </span>}</span></p>
<p class="gmail-p2" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">}</span></p>
<p class="gmail-p3" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0);min-height:13px"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"></span><br></p>
<p class="gmail-p3" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0);min-height:13px"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"></span><br></p>
<p class="gmail-p2" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">-(</span><span class="gmail-s2" style="font-variant-ligatures:no-common-ligatures;color:rgb(186,45,162)">void</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">) playaudio {</span></p>
<p class="gmail-p4" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(62,30,129)"><span class="gmail-s8" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">    </span><span class="gmail-s2" style="font-variant-ligatures:no-common-ligatures;color:rgb(186,45,162)">if</span><span class="gmail-s8" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">(</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">gst_element_set_state</span><span class="gmail-s8" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">(</span><span class="gmail-s4" style="font-variant-ligatures:no-common-ligatures;color:rgb(79,129,135)">audiopipeline</span><span class="gmail-s8" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">, </span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">GST_STATE_PLAYING</span><span class="gmail-s8" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">) == </span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">GST_STATE_CHANGE_FAILURE</span><span class="gmail-s8" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">) {</span></p>
<p class="gmail-p6" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(209,47,27)"><span class="gmail-s8" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)"><span class="gmail-Apple-converted-space">        </span>[</span><span class="gmail-s2" style="font-variant-ligatures:no-common-ligatures;color:rgb(186,45,162)">self</span><span class="gmail-s8" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)"> </span><span class="gmail-s9" style="font-variant-ligatures:no-common-ligatures;color:rgb(49,89,93)">setUIMessage</span><span class="gmail-s8" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">:</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">"Failed to set audio pipeline to playing"</span><span class="gmail-s8" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">];</span></p>
<p class="gmail-p2" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">    </span>}</span></p>
<p class="gmail-p2" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">}</span></p>
<p class="gmail-p3" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0);min-height:13px"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"></span><br></p>
<p class="gmail-p3" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0);min-height:13px"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"></span><br></p>
<p class="gmail-p2" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">-(</span><span class="gmail-s2" style="font-variant-ligatures:no-common-ligatures;color:rgb(186,45,162)">void</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">) pauseaudio {</span></p>
<p class="gmail-p3" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0);min-height:13px"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">    </span></p>
<p class="gmail-p4" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(62,30,129)"><span class="gmail-s8" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">    </span><span class="gmail-s2" style="font-variant-ligatures:no-common-ligatures;color:rgb(186,45,162)">if</span><span class="gmail-s8" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">(</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">gst_element_set_state</span><span class="gmail-s8" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">(</span><span class="gmail-s4" style="font-variant-ligatures:no-common-ligatures;color:rgb(79,129,135)">audiopipeline</span><span class="gmail-s8" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">, </span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">GST_STATE_PAUSED</span><span class="gmail-s8" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">) == </span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">GST_STATE_CHANGE_FAILURE</span><span class="gmail-s8" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">) {</span></p>
<p class="gmail-p6" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(209,47,27)"><span class="gmail-s8" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)"><span class="gmail-Apple-converted-space">        </span>[</span><span class="gmail-s2" style="font-variant-ligatures:no-common-ligatures;color:rgb(186,45,162)">self</span><span class="gmail-s8" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)"> </span><span class="gmail-s9" style="font-variant-ligatures:no-common-ligatures;color:rgb(49,89,93)">setUIMessage</span><span class="gmail-s8" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">:</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">"Failed to set audio pipeline to paused"</span><span class="gmail-s8" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">];</span></p>
<p class="gmail-p2" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">    </span>}</span></p>
<p class="gmail-p2" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">}</span></p>
<p class="gmail-p3" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0);min-height:13px"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"></span><br></p>
<p class="gmail-p1" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,132,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">/* Retrieve errors from the bus and show them on the UI */</span></p>
<p class="gmail-p2" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s2" style="font-variant-ligatures:no-common-ligatures;color:rgb(186,45,162)">static</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"> </span><span class="gmail-s2" style="font-variant-ligatures:no-common-ligatures;color:rgb(186,45,162)">void</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"> error_cb_audio (</span><span class="gmail-s3" style="font-variant-ligatures:no-common-ligatures;color:rgb(112,61,170)">GstBus</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"> *bus, </span><span class="gmail-s3" style="font-variant-ligatures:no-common-ligatures;color:rgb(112,61,170)">GstMessage</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"> *msg, </span><span class="gmail-s4" style="font-variant-ligatures:no-common-ligatures;color:rgb(79,129,135)">GStreamerBackend</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"> *</span><span class="gmail-s2" style="font-variant-ligatures:no-common-ligatures;color:rgb(186,45,162)">self</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">)</span></p>
<p class="gmail-p2" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">{</span></p>
<p class="gmail-p2" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">    </span><span class="gmail-s3" style="font-variant-ligatures:no-common-ligatures;color:rgb(112,61,170)">GError</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"> *err;</span></p>
<p class="gmail-p2" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">    </span><span class="gmail-s3" style="font-variant-ligatures:no-common-ligatures;color:rgb(112,61,170)">gchar</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"> *debug_info;</span></p>
<p class="gmail-p2" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">    </span><span class="gmail-s3" style="font-variant-ligatures:no-common-ligatures;color:rgb(112,61,170)">gchar</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"> *message_string;</span></p>
<p class="gmail-p3" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0);min-height:13px"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">    </span></p>
<p class="gmail-p2" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">    </span><span class="gmail-s5" style="font-variant-ligatures:no-common-ligatures;color:rgb(62,30,129)">gst_message_parse_error</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"> (msg, &err, &debug_info);</span></p>
<p class="gmail-p2" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">    </span>message_string = </span><span class="gmail-s5" style="font-variant-ligatures:no-common-ligatures;color:rgb(62,30,129)">g_strdup_printf</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"> (</span><span class="gmail-s6" style="font-variant-ligatures:no-common-ligatures;color:rgb(209,47,27)">"Error received from element %s: %s"</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">, </span><span class="gmail-s7" style="font-variant-ligatures:no-common-ligatures;color:rgb(120,73,42)">GST_OBJECT_NAME</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"> (msg->src), err-></span><span class="gmail-s3" style="font-variant-ligatures:no-common-ligatures;color:rgb(112,61,170)">message</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">);</span></p>
<p class="gmail-p4" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(62,30,129)"><span class="gmail-s8" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">    </span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">g_clear_error</span><span class="gmail-s8" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)"> (&err);</span></p>
<p class="gmail-p2" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">    </span><span class="gmail-s5" style="font-variant-ligatures:no-common-ligatures;color:rgb(62,30,129)">g_free</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"> (debug_info);</span></p>
<p class="gmail-p2" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">    </span>[</span><span class="gmail-s2" style="font-variant-ligatures:no-common-ligatures;color:rgb(186,45,162)">self</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"> </span><span class="gmail-s9" style="font-variant-ligatures:no-common-ligatures;color:rgb(49,89,93)">setUIMessage</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">:message_string];</span></p>
<p class="gmail-p2" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">    </span><span class="gmail-s5" style="font-variant-ligatures:no-common-ligatures;color:rgb(62,30,129)">g_free</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"> (message_string);</span></p>
<p class="gmail-p4" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(62,30,129)"><span class="gmail-s8" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">    </span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">gst_element_set_state</span><span class="gmail-s8" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)"> (</span><span class="gmail-s2" style="font-variant-ligatures:no-common-ligatures;color:rgb(186,45,162)">self</span><span class="gmail-s8" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">-></span><span class="gmail-s4" style="font-variant-ligatures:no-common-ligatures;color:rgb(79,129,135)">audiopipeline</span><span class="gmail-s8" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">, </span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">GST_STATE_NULL</span><span class="gmail-s8" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">);</span></p>
<p class="gmail-p2" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">}</span></p>
<p class="gmail-p3" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0);min-height:13px"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"></span><br></p>
<p class="gmail-p1" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,132,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">/* Notify UI about pipeline state changes */</span></p>
<p class="gmail-p2" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s2" style="font-variant-ligatures:no-common-ligatures;color:rgb(186,45,162)">static</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"> </span><span class="gmail-s2" style="font-variant-ligatures:no-common-ligatures;color:rgb(186,45,162)">void</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"> state_changed_cb_audio (</span><span class="gmail-s3" style="font-variant-ligatures:no-common-ligatures;color:rgb(112,61,170)">GstBus</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"> *bus, </span><span class="gmail-s3" style="font-variant-ligatures:no-common-ligatures;color:rgb(112,61,170)">GstMessage</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"> *msg, </span><span class="gmail-s4" style="font-variant-ligatures:no-common-ligatures;color:rgb(79,129,135)">GStreamerBackend</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"> *</span><span class="gmail-s2" style="font-variant-ligatures:no-common-ligatures;color:rgb(186,45,162)">self</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">)</span></p>
<p class="gmail-p2" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">{</span></p>
<p class="gmail-p2" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">    </span><span class="gmail-s3" style="font-variant-ligatures:no-common-ligatures;color:rgb(112,61,170)">GstState</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"> old_state, new_state, pending_state;</span></p>
<p class="gmail-p2" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">    </span><span class="gmail-s5" style="font-variant-ligatures:no-common-ligatures;color:rgb(62,30,129)">gst_message_parse_state_changed</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"> (msg, &old_state, &new_state, &pending_state);</span></p>
<p class="gmail-p1" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,132,0)"><span class="gmail-s8" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">    </span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">/* Only pay attention to messages coming from the pipeline, not its children */</span></p>
<p class="gmail-p2" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">    </span><span class="gmail-s2" style="font-variant-ligatures:no-common-ligatures;color:rgb(186,45,162)">if</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"> (</span><span class="gmail-s7" style="font-variant-ligatures:no-common-ligatures;color:rgb(120,73,42)">GST_MESSAGE_SRC</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"> (msg) == </span><span class="gmail-s7" style="font-variant-ligatures:no-common-ligatures;color:rgb(120,73,42)">GST_OBJECT</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"> (</span><span class="gmail-s2" style="font-variant-ligatures:no-common-ligatures;color:rgb(186,45,162)">self</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">->audiopipeline)) {</span></p>
<p class="gmail-p4" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(62,30,129)"><span class="gmail-s8" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">        </span><span class="gmail-s3" style="font-variant-ligatures:no-common-ligatures;color:rgb(112,61,170)">gchar</span><span class="gmail-s8" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)"> *message = </span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">g_strdup_printf</span><span class="gmail-s8" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">(</span><span class="gmail-s6" style="font-variant-ligatures:no-common-ligatures;color:rgb(209,47,27)">"State changed to %s"</span><span class="gmail-s8" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">, </span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">gst_element_state_get_name</span><span class="gmail-s8" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">(new_state));</span></p>
<p class="gmail-p2" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">        </span>[</span><span class="gmail-s2" style="font-variant-ligatures:no-common-ligatures;color:rgb(186,45,162)">self</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"> </span><span class="gmail-s9" style="font-variant-ligatures:no-common-ligatures;color:rgb(49,89,93)">setUIMessage</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">:message];</span></p>
<p class="gmail-p2" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">        </span><span class="gmail-s5" style="font-variant-ligatures:no-common-ligatures;color:rgb(62,30,129)">g_free</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"> (message);</span></p>
<p class="gmail-p2" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">    </span>}</span></p>
<p class="gmail-p2" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">}</span></p><p class="gmail-p2" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><br></span></p><p class="gmail-p2" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><br></span></p><p class="gmail-p2" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><br></span></p><p class="gmail-p2" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><br></span></p><p class="gmail-p2" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><br></span></p><p class="gmail-p2" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><br></span></p><p class="gmail-p2" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><br></span></p><p class="gmail-p2" style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">Also , I am attaching crash files. Kindly help  me to get me out of this issue.</span></p></div></div>