xvimagesink try to create window of its own before gst_xvimagesink_set_xwindow_id is done
Stefan Kost
ensonic at hora-obscura.de
Tue Apr 26 12:10:19 PDT 2011
Am 26.04.2011 09:48, schrieb Zhao, Halley:
> I found one issue that,
>
> after vaimagesink throw out the msg of ‘prepare-xwindow-id’,
> gst_xvimagesink_setcaps will run into gst_xvimagesink_xwindow_new() when ,
> gst_xvimagesink_set_xwindow_id() is still on the way.
>
> I think it is caused by gst_xvimagesink_set_xwindow_id is called from UI thread
> in async. Is it a bug of xvimagesink, or I have done something wrong?
Applications need to use the sync bus handler for ‘prepare-xwindow-id’. This is
explained in the docs for the GstXOverlay interface.
Stefan
>
> See the code below.
>
>
>
>
>
> static gboolean
>
> gst_xvimagesink_setcaps (GstBaseSink * bsink, GstCaps * caps)
>
> {
>
> // …
>
> /* Notify application to set xwindow id now */
>
> g_mutex_lock (xvimagesink->flow_lock);
>
> if (!xvimagesink->xwindow) {
>
> g_mutex_unlock (xvimagesink->flow_lock);
>
> gst_x_overlay_prepare_xwindow_id (GST_X_OVERLAY (xvimagesink));
>
> } else {
>
> g_mutex_unlock (xvimagesink->flow_lock);
>
> }
>
>
>
> /* Creating our window and our image with the display size in pixels */
>
> if (GST_VIDEO_SINK_WIDTH (xvimagesink) <= 0 ||
>
> GST_VIDEO_SINK_HEIGHT (xvimagesink) <= 0)
>
> goto no_display_size;
>
>
>
> g_mutex_lock (xvimagesink->flow_lock);
>
> if (!xvimagesink->xwindow) {
>
> xvimagesink->xwindow = gst_xvimagesink_xwindow_new (xvimagesink,
>
> GST_VIDEO_SINK_WIDTH (xvimagesink),
>
> GST_VIDEO_SINK_HEIGHT (xvimagesink));
>
> }
>
>
>
> // …
>
> }
>
>
>
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
More information about the gstreamer-devel
mailing list