diff --git a/subprojects/gst-plugins-good/ext/gtk/gtkgstbasewidget.c b/subprojects/gst-plugins-good/ext/gtk/gtkgstbasewidget.c index db2c7b52d0..d3ba7e8704 100644 --- a/subprojects/gst-plugins-good/ext/gtk/gtkgstbasewidget.c +++ b/subprojects/gst-plugins-good/ext/gtk/gtkgstbasewidget.c @@ -593,3 +593,19 @@ gtk_gst_base_widget_set_buffer (GtkGstBaseWidget * widget, GstBuffer * buffer) GTK_GST_BASE_WIDGET_UNLOCK (widget); } + +void +gtk_gst_base_widget_queue_draw (GtkGstBaseWidget * widget) +{ + /* As we have no type, this is better then no check */ + g_return_if_fail (GTK_IS_WIDGET (widget)); + + GTK_GST_BASE_WIDGET_LOCK (widget); + + if (!widget->draw_id) { + widget->draw_id = g_idle_add_full (G_PRIORITY_DEFAULT, + (GSourceFunc) _queue_draw, widget, NULL); + } + + GTK_GST_BASE_WIDGET_UNLOCK (widget); +} diff --git a/subprojects/gst-plugins-good/ext/gtk/gtkgstbasewidget.h b/subprojects/gst-plugins-good/ext/gtk/gtkgstbasewidget.h index 6967560795..cc957bf13b 100644 --- a/subprojects/gst-plugins-good/ext/gtk/gtkgstbasewidget.h +++ b/subprojects/gst-plugins-good/ext/gtk/gtkgstbasewidget.h @@ -91,6 +91,7 @@ void gtk_gst_base_widget_finalize (GObject * object); /* API */ gboolean gtk_gst_base_widget_set_format (GtkGstBaseWidget * widget, GstVideoInfo * v_info); void gtk_gst_base_widget_set_buffer (GtkGstBaseWidget * widget, GstBuffer * buffer); +void gtk_gst_base_widget_queue_draw (GtkGstBaseWidget * widget); void gtk_gst_base_widget_set_element (GtkGstBaseWidget * widget, GstElement * element); void gtk_gst_base_widget_display_size_to_stream_size (GtkGstBaseWidget * base_widget, gdouble x, gdouble y,