Some news on the subject.<div><br></div><div>i have made some investigation and tested to create my own pipeline without playbin2.</div><div><br></div><div>the pipeline looks like this :</div><div><br></div><div>filesrc ==> matroskademux ==> fluvadec ==> fluvasink</div>
<div><br></div><div>and the code is below :</div><div><br></div><div><meta http-equiv="content-type" content="text/html; charset=utf-8">############################################<br><meta http-equiv="content-type" content="text/html; charset=utf-8"><div>
<span class="Apple-tab-span" style="white-space:pre">        </span>GstElement *pipeline = gst_pipeline_new("pipeline");</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>GstElement *videoSrc = gst_element_factory_make("filesrc","filesrc");</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>GstElement *demux = gst_element_factory_make("matroskademux","demux");</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>GstElement *dec = gst_element_factory_make("fluvadec","dec");</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>GstElement *sink = gst_element_factory_make("fluvasink","sink");</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>g_object_set(G_OBJECT(videoSrc),"location","/root/test.mkv",NULL);</div>
<div><br></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>gst_bin_add_many(GST_BIN (pipeline), videoSrc, demux,dec,sink, NULL);</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>gst_element_link(videoSrc,demux);</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>gst_element_link(dec,sink);</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>g_signal_connect(G_OBJECT(demux),"pad-added",G_CALLBACK(on_pad_added),dec);</div>
<div><br></div><div> gst_x_overlay_set_xwindow_id(GST_X_OVERLAY(sink), windowIdStatic );</div><div><br></div><div> gst_element_set_state(GST_ELEMENT(pipeline), GST_STATE_PLAYING);</div></div><div>############################################</div>
<div><br></div><div>in precision, i link demux and dec on a on_pad_add callback.</div><div><br></div><div>with this code there no problem and the result is has expected, the video is playing on the dedicated window.</div>
<div><br></div><div>it seems that my problem is with the playbin2 element.</div><div><br></div><div>any idea?</div><div><br></div><div><div class="gmail_quote">2011/7/22 arnaud tonda <span dir="ltr"><<a href="mailto:arnaud.tonda@gmail.com">arnaud.tonda@gmail.com</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Hi everybody,<div><br></div><div>I don't know if it'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 style="white-space:pre-wrap">        </span>GstElement *pipeline = gst_pipeline_new ("xvoverlay");</div>
<div><span style="white-space:pre-wrap"><br></span></div><div><span style="white-space:pre-wrap">        </span>GstElement *src = gst_element_factory_make ("videotestsrc", NULL);</div>
<div><span style="white-space:pre-wrap"><br></span></div><div><span style="white-space:pre-wrap">        </span>GstElement *sink = gst_element_factory_make ("xvimagesink", NULL);</div>
<div><span style="white-space:pre-wrap"><br></span></div><div><span style="white-space:pre-wrap">        </span>gst_bin_add_many (GST_BIN (pipeline), src, sink, NULL);</div><div><span style="white-space:pre-wrap"><br>
</span></div><div><span style="white-space:pre-wrap">        </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 style="white-space:pre-wrap"><br>
</span></div><div><span style="white-space:pre-wrap">        </span>bus<span style="white-space:pre-wrap">        </span>= gst_pipeline_get_bus (GST_PIPELINE(pipeline));</div><div><span style="white-space:pre-wrap"><br>
</span></div><div><span style="white-space:pre-wrap">        </span>gst_bus_add_watch(bus, (GstBusFunc)bus_callback, NULL);</div><div><span style="white-space:pre-wrap"><br></span></div><div><span style="white-space:pre-wrap">        </span>gst_object_unref(bus);</div>
<div><span style="white-space:pre-wrap"><br></span></div><div><span style="white-space:pre-wrap">        </span>gst_element_set_state(GST_ELEMENT(pipeline), GST_STATE_PLAYING);</div><div><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't understand what....</div><div><br></div><div><div><div>######################################</div>
</div></div><div><br></div><div><div><span style="white-space:pre-wrap">        </span>playbin = gst_element_factory_make("playbin2","playbin");</div><div><br></div><div><span style="white-space:pre-wrap">        </span>GstElement *videosink = gst_element_factory_make("xvimagesink", "videosink");</div>
<div><br></div><div><span style="white-space:pre-wrap">        </span>g_object_set(G_OBJECT(playbin), "video-sink", videosink, NULL);</div><div><br></div><div><span style="white-space:pre-wrap">        </span>g_object_set(G_OBJECT(playbin),"uri","file:///root/test.mkv",NULL);</div>
<div><span style="white-space:pre-wrap">        </span>g_object_set(G_OBJECT(playbin),"flags",0x00000013,NULL);</div><div><br></div><div><span style="white-space:pre-wrap">        </span>//2 - We add a message Handler</div>
<div><span style="white-space:pre-wrap">        </span>bus<span style="white-space:pre-wrap">        </span>= gst_pipeline_get_bus (GST_PIPELINE(playbin));</div><div><span style="white-space:pre-wrap">        </span>gst_bus_add_watch(bus, (GstBusFunc)bus_callback, NULL);</div>
<div><span style="white-space:pre-wrap">        </span>gst_object_unref(bus);</div><div><br></div><div><span style="white-space:pre-wrap">        </span>g_signal_connect(G_OBJECT(playbin),"video-changed",G_CALLBACK(on_video_changed),this);</div>
<div><span style="white-space:pre-wrap">        </span>g_signal_connect(G_OBJECT(playbin),"pad-added",G_CALLBACK(on_pad_added),this);</div><div><span style="white-space:pre-wrap">        </span>g_signal_connect(G_OBJECT(playbin),"deep-notify::source",(GCallback)on_video_sink_notify,this);</div>
<div><br></div><div> GstElement *videosink2 = 0;</div><div> g_object_get(playbin, "video-sink", &videosink2, NULL);</div><div><div> </div><div> if (videosink2 && GST_IS_X_OVERLAY(videosink2) )</div>
<div> {</div><div> <span style="white-space:pre-wrap">        </span>cout << "videosink and overlay are OK" << endl;</div><div> gst_x_overlay_set_xwindow_id(GST_X_OVERLAY(videosink), windowId );</div>
<div> }</div><div> else</div><div> {</div><div> <span style="white-space:pre-wrap">        </span>if(!videosink)</div><div> <span style="white-space:pre-wrap">                </span>cout << "videosink is NULL" << endl;</div>
<div> <span style="white-space:pre-wrap">        </span>else</div><div> <span style="white-space:pre-wrap">                </span>cout << "overlay is NULL" << endl;</div><div> }</div>
</div><div><br></div><div><span style="white-space:pre-wrap">        </span>gst_element_set_state(GST_ELEMENT(playbin), GST_STATE_PLAYING);</div></div><div><br></div><div><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'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>
</blockquote></div><br>
</div>