Hi,<br><br>Just to share (or have some suggestions) a way to avoid flickering when resizing or obscuring a window used through the gstxoverlay interface:<br><br>------------------------------------------------------------------------------------------<br>
<br>//the first 3 lines turn off the "automatically redraw background"<br><span style="color: rgb(51, 51, 255);">gtk_widget_realize(area);</span><br style="color: rgb(51, 51, 255);"><span style="color: rgb(51, 51, 255);">gdk_window_set_back_pixmap(area->window, NULL, FALSE);</span><br style="color: rgb(51, 51, 255);">
<span style="color: rgb(51, 51, 255);">gtk_widget_set_app_paintable(area,TRUE); </span><br><br>//The previous lines avoid flickering, but if we have a double buffer<br>//the problem is now due to the fact that the gstxoverlay interface give the XID<br>
//of the "front buffer". (<- not exactly true but to make me understood)<br>//So when swaping buffers, there is this <b style="color: rgb(153, 0, 0);"><u>ugly</u></b> flickering effect too.<br><span style="color: rgb(51, 51, 255);">gtk_widget_set_double_buffered(area, FALSE);</span><br>
//To keep double buffered, we should have to draw in the backbuffer<br>//but I do no know if there is a XID (HWND) for the backfuffer <br>//Yes I know there is only one XID (nothing to deal with front and back buffers)<br>
//So I do not know a way to do that :P<br><br>------------------------------------------------------------------------------------------<br><br><span style="color: rgb(51, 51, 255);">static GstBusSyncReply create_window (GstBus* bus, GstMessage* message, GtkWidget* widget)</span><br style="color: rgb(51, 51, 255);">
<span style="color: rgb(51, 51, 255);">{</span><br style="color: rgb(51, 51, 255);"><span style="color: rgb(51, 51, 255);"> // ignore anything but 'prepare-xwindow-id' element messages</span><br style="color: rgb(51, 51, 255);">
<span style="color: rgb(51, 51, 255);"> if (GST_MESSAGE_TYPE (message) != GST_MESSAGE_ELEMENT)</span><br style="color: rgb(51, 51, 255);"><span style="color: rgb(51, 51, 255);"> return GST_BUS_PASS;</span><br style="color: rgb(51, 51, 255);">
<br style="color: rgb(51, 51, 255);"><span style="color: rgb(51, 51, 255);"> if (!gst_structure_has_name (message->structure, "prepare-xwindow-id"))</span><br style="color: rgb(51, 51, 255);"><span style="color: rgb(51, 51, 255);"> return GST_BUS_PASS;</span><br style="color: rgb(51, 51, 255);">
<br style="color: rgb(51, 51, 255);"><span style="color: rgb(51, 51, 255);"> g_print ("setting xwindow id\n");</span><br style="color: rgb(51, 51, 255);"><br style="color: rgb(51, 51, 255);"><span style="color: rgb(51, 51, 255);">#ifdef WIN32</span><br style="color: rgb(51, 51, 255);">
<span style="color: rgb(51, 51, 255);"> gst_x_overlay_set_xwindow_id (GST_X_OVERLAY (GST_MESSAGE_SRC (message)),</span><br style="color: rgb(51, 51, 255);"><span style="color: rgb(51, 51, 255);"> reinterpret_cast<gulong>GDK_WINDOW_HWND(widget->window));</span><br style="color: rgb(51, 51, 255);">
<span style="color: rgb(51, 51, 255);">#else</span><br style="color: rgb(51, 51, 255);"><span style="color: rgb(51, 51, 255);"> gst_x_overlay_set_xwindow_id (GST_X_OVERLAY (GST_MESSAGE_SRC (message)),</span><br style="color: rgb(51, 51, 255);">
<span style="color: rgb(51, 51, 255);"> GDK_WINDOW_XWINDOW(widget->window));</span><br style="color: rgb(51, 51, 255);"><span style="color: rgb(51, 51, 255);">#endif</span><br style="color: rgb(51, 51, 255);"><br style="color: rgb(51, 51, 255);">
<span style="color: rgb(51, 51, 255);"> gst_message_unref (message);</span><br style="color: rgb(51, 51, 255);"><br style="color: rgb(51, 51, 255);"><span style="color: rgb(51, 51, 255);"> return GST_BUS_DROP;</span><br style="color: rgb(51, 51, 255);">
<span style="color: rgb(51, 51, 255);">}</span><br><br>------------------------------------------------------------------------------------------<br><br style="color: rgb(51, 51, 255);"><span style="color: rgb(51, 51, 255);">static gboolean expose_cb(GtkWidget* widget, GdkEventExpose* event, GstElement* videosink)</span><br style="color: rgb(51, 51, 255);">
<span style="color: rgb(51, 51, 255);">{</span><br style="color: rgb(51, 51, 255);"><span style="color: rgb(51, 51, 255);"> gst_x_overlay_expose (GST_X_OVERLAY (videosink));</span><br style="color: rgb(51, 51, 255);">
<br style="color: rgb(51, 51, 255);"><span style="color: rgb(51, 51, 255);"> return FALSE;</span><br style="color: rgb(51, 51, 255);"><span style="color: rgb(51, 51, 255);">}</span><br><br>------------------------------------------------------------------------------------------<br>
<br>(for information, with Qt the equivalent is widget->setAttribute(Qt::WA_NoSystemBackground); )<br><br>Sincerely <br><br>J.<br>