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

krist misra krist.misra at gmail.com
Thu Sep 27 04:23:05 CEST 2007


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);
}

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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20070927/41b357d8/attachment.htm>


More information about the gstreamer-devel mailing list