Gstreamer application using Qt

Tim-Philipp Müller t.i.m at zen.co.uk
Fri Sep 7 02:08:36 PDT 2012


On Fri, 2012-09-07 at 00:00 -0700, pushpa wrote:

> On target platform, gstreamer window is not showed on Qtwidget, video is
> displayed on separate window with following messages
> 
> (gst:1743): GStreamer-CRITICAL **: gst_implements_interface_cast: assertion
> `gst_element_implements_interface (GST_ELEMENT 
> (from), iface_type)' failed
> 
> ** (gst:1743): CRITICAL **: gst_x_overlay_set_xwindow_id: assertion `overlay
> != NULL' failed
>
> Here is the code which i am using
> ...
>     GstElement *sink = gst_element_factory_make ("autovideosink", NULL);
> ...
>        gst_x_overlay_set_xwindow_id (GST_X_OVERLAY (sink), xwinid);

autovideosink does not itself implement/proxy the GstXOverlay interface
(see gst-inspect-0.10 autovideosink). If you use autovideosink you will
have to handle the prepare-xwindow-id element message on the bus
(synchronously!) and set the window ID from there.

You could do something like the bus_sync_handler() code in the Gtk+
example in
http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-base-libs/html/gst-plugins-base-libs-gstxoverlay.html

You don't need to do the realize_cb() thing if you can get the window ID
as you do now, just make sure to obtain it in the main thread and safe
it somewhere, so that in the sync bus handler, which is called from a
streaming thread, you just need to pass the saved number and not need to
do any X/Qt calls (which won't work well).


Note that with recent versions of playbin2 you can just set the window
handle/ID on playbin2 directly using the GstXOverlay interface, and it
will proxy it to the video sink.

Cheers
 -Tim



More information about the gstreamer-devel mailing list