Hi everybody,<div><br></div><div>I don&#39;t know if it&#39;s the right place but i try.</div><div><br></div><div>after writing a C standalone code using playbin2 gstreamer elements, i started integration on a QT c++ source Application.</div>
<div><br></div><div>i have a lot of windows and one is dedicated to video rendering.</div><div>I want to use gstxoverlay.</div><div><br></div><div>firstly i tried to use the gstreamer sample code shown on gstxoverlay Api.</div>
<div><br></div><div>with videotestsrc and xvimagesrc :</div><div><br></div><div>######################################</div><div> <span class="Apple-tab-span" style="white-space:pre">        </span>GstElement *pipeline = gst_pipeline_new (&quot;xvoverlay&quot;);</div>
<div><span class="Apple-tab-span" style="white-space:pre"><br></span></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>GstElement *src = gst_element_factory_make (&quot;videotestsrc&quot;, NULL);</div>
<div><span class="Apple-tab-span" style="white-space:pre"><br></span></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>GstElement *sink = gst_element_factory_make (&quot;xvimagesink&quot;, NULL);</div>
<div><span class="Apple-tab-span" style="white-space:pre"><br></span></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>gst_bin_add_many (GST_BIN (pipeline), src, sink, NULL);</div><div><span class="Apple-tab-span" style="white-space:pre"><br>
</span></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>gst_element_link (src, sink);</div><div><br></div><div>        gst_x_overlay_set_xwindow_id(GST_X_OVERLAY(sink), windowId );</div><div><span class="Apple-style-span" style="white-space: pre;"><br>
</span></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>bus<span class="Apple-tab-span" style="white-space:pre">        </span>= gst_pipeline_get_bus (GST_PIPELINE(pipeline));</div><div><span class="Apple-tab-span" style="white-space:pre"><br>
</span></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>gst_bus_add_watch(bus, (GstBusFunc)bus_callback, NULL);</div><div><span class="Apple-tab-span" style="white-space:pre"><br></span></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>gst_object_unref(bus);</div>
<div><span class="Apple-tab-span" style="white-space:pre"><br></span></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>gst_element_set_state(GST_ELEMENT(pipeline), GST_STATE_PLAYING);</div><div><meta http-equiv="content-type" content="text/html; charset=utf-8"><div>
######################################</div></div><div><br></div><div>here i have what i expected, videotest is displayed on the right window without problem.</div><div><br></div><div>secondly i tried to use playbin2 and the problem is there.</div>
<div><br></div><div>i get the video-sink element of playbin2 but before pipeline is playing video-sink is null.</div><div>if i overload video-sink with a xvimagesink element video-sink is not null, and i can use gst_x_overlay_set_xwindow_id on this.</div>
<div>but it result on a fullscreen video.... i think something is wrong but i don&#39;t understand what....</div><div><br></div><div><meta http-equiv="content-type" content="text/html; charset=utf-8"><div><div>######################################</div>
</div></div><div><br></div><div><div><span class="Apple-tab-span" style="white-space:pre">        </span>playbin = gst_element_factory_make(&quot;playbin2&quot;,&quot;playbin&quot;);</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>GstElement *videosink = gst_element_factory_make(&quot;xvimagesink&quot;, &quot;videosink&quot;);</div>
<div><br></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>g_object_set(G_OBJECT(playbin), &quot;video-sink&quot;, videosink, NULL);</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>g_object_set(G_OBJECT(playbin),&quot;uri&quot;,&quot;file:///root/test.mkv&quot;,NULL);</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>g_object_set(G_OBJECT(playbin),&quot;flags&quot;,0x00000013,NULL);</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>//2 - We add a message Handler</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>bus<span class="Apple-tab-span" style="white-space:pre">        </span>= gst_pipeline_get_bus (GST_PIPELINE(playbin));</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>gst_bus_add_watch(bus, (GstBusFunc)bus_callback, NULL);</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>gst_object_unref(bus);</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>g_signal_connect(G_OBJECT(playbin),&quot;video-changed&quot;,G_CALLBACK(on_video_changed),this);</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>g_signal_connect(G_OBJECT(playbin),&quot;pad-added&quot;,G_CALLBACK(on_pad_added),this);</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>g_signal_connect(G_OBJECT(playbin),&quot;deep-notify::source&quot;,(GCallback)on_video_sink_notify,this);</div>
<div><br></div><div>        GstElement *videosink2 = 0;</div><div>        g_object_get(playbin, &quot;video-sink&quot;, &amp;videosink2, NULL);</div><div><div>    </div><div>    if (videosink2 &amp;&amp; GST_IS_X_OVERLAY(videosink2) )</div>
<div>    {</div><div>    <span class="Apple-tab-span" style="white-space:pre">        </span>cout &lt;&lt; &quot;videosink and overlay are OK&quot; &lt;&lt; endl;</div><div>        gst_x_overlay_set_xwindow_id(GST_X_OVERLAY(videosink), windowId );</div>
<div>    }</div><div>    else</div><div>    {</div><div>    <span class="Apple-tab-span" style="white-space:pre">        </span>if(!videosink)</div><div>    <span class="Apple-tab-span" style="white-space:pre">                </span>cout &lt;&lt; &quot;videosink is NULL&quot; &lt;&lt; endl;</div>
<div>    <span class="Apple-tab-span" style="white-space:pre">        </span>else</div><div>    <span class="Apple-tab-span" style="white-space:pre">                </span>cout &lt;&lt; &quot;overlay is NULL&quot; &lt;&lt; endl;</div><div>    }</div>
</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>gst_element_set_state(GST_ELEMENT(playbin), GST_STATE_PLAYING);</div></div><div><br></div><div><meta http-equiv="content-type" content="text/html; charset=utf-8"><div>
<div>######################################</div></div></div><div><br></div><div>any idea? what is wrong?</div><div><br></div><div>One other thing :</div><div><br></div><div>the gst_bus_add_watch did not work. the attached callback is never called.</div>
<div>Has it work on the standalone C source code i think it is due to the QT event loop but i can&#39;t confirm.</div><div>am i right?</div><div><br></div><div>Best regards</div><div><br></div><div>-- <br>Arnaud Tonda<br>
<br>
</div>