[gst-devel] About xvimagesink and redraw after expose-event

René Stadler mail at renestadler.de
Mon Oct 8 14:40:30 CEST 2007


Am Donnerstag, den 27.09.2007, 10:23 +0800 schrieb krist misra:
> Hi experts,
> 
> I build a bin to receive video streams from udpsrc and finally use
> xvimagesink  to render video frames,  I also create a drawable widget
> with gtk_drawing_area_new() and use gst_x_overlay_set_xwindow_id() to
> set the output to this widget. But I meet a problem that if this
> widget or part of it being covered by a menu or something, after it
> exposes again the covered section keeps blank, 
> 
> I try to resolve it by connecting the "expose-event" signal to my
> expose_cb() function, in this function I call
> gst_x_overlay_set_xwindow_id() again and gtk_widget_show(),  but after
> I have done all of these it seems still not work. 
> What I should do in the expose function or anywhere to let it redraw
> the blanked section?
> Thanks a lot.
> below is part of the source code,
> ---------------------------------------------------------------------------------------- 
> static gboolean expose_cb(GtkWidget * widget, GdkEventExpose * event,
> gpointer data)
> {
>     gst_x_overlay_set_xwindow_id(GST_X_OVERLAY(data),
> 
> GDK_WINDOW_XWINDOW(widget->window)); 
>     gtk_widget_show_all(widget);
> }

Instead of gtk_widget_show_all, call gst_x_overlay_expose there.  The
function tells the element to redraw the frame, which is exactly what
you want.

> int main()
> {
> ...
>   gstreamer_main_video_image = gtk_drawing_area_new();
> ...
>   screen_sink = gst_bin_get_by_name (GST_BIN (appdata.bin),
> "screensink");
> ...
>   gst_x_overlay_set_xwindow_id(GST_X_OVERLAY(screen_sink), 
>     GDK_WINDOW_XWINDOW(gstreamer_main_video_image->window));
>    g_signal_connect(gstreamer_main_video_image, "expose-event",
> G_CALLBACK(expose_cb),
>                              screen_sink);
>   gtk_widget_show_all(gstreamer_window); 
> ...
> }
> ----------------------------------------------------------------------------------------
> Thanks
> 
> Krist

-- 
Regards,
  René Stadler






More information about the gstreamer-devel mailing list