After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 755249 - gtkglsink: Hide and cleaned the GtkWindow we might create
gtkglsink: Hide and cleaned the GtkWindow we might create
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
unspecified
Other All
: Normal blocker
: 1.6.0
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2015-09-19 09:48 UTC by Thibault Saunier
Modified: 2015-10-02 07:33 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
gtkglsink: Hide and cleaned the GtkWindow we might create (3.34 KB, patch)
2015-09-19 09:49 UTC, Thibault Saunier
none Details | Review
gtkglsink: Hide and clean the GtkWindow we might create (3.34 KB, patch)
2015-09-19 09:50 UTC, Thibault Saunier
committed Details | Review
gtksink: Do not re destroy the GtkWindow if destroyed by the user (1.34 KB, patch)
2015-09-21 08:48 UTC, Thibault Saunier
committed Details | Review

Description Thibault Saunier 2015-09-19 09:48:57 UTC
When stopping the sink we should always hide the window.
Comment 1 Thibault Saunier 2015-09-19 09:49:01 UTC
Created attachment 311666 [details] [review]
gtkglsink: Hide and cleaned the GtkWindow we might create
Comment 2 Thibault Saunier 2015-09-19 09:50:26 UTC
Created attachment 311667 [details] [review]
gtkglsink: Hide and clean the GtkWindow we might create

When stopping the sink we should always hide the window.
Comment 3 Sebastian Dröge (slomo) 2015-09-19 09:59:57 UTC
Review of attachment 311667 [details] [review]:

Looks good, please push after a small change

::: ext/gtk/gstgtkbasesink.c
@@ +287,3 @@
     /* User did not add widget its own UI, let's popup a new GtkWindow to
      * make gst-launch-1.0 work. */
+    gst_sink->window = gtk_window_new (GTK_WINDOW_TOPLEVEL);

This window creation and destruction is IMHO wrong. We're calling this from a random thread that is starting the sink, not necessarily the GTK main thread. Please create another bug about this as a reminder

@@ +304,3 @@
+  if (gst_sink->window) {
+    gtk_widget_hide (gst_sink->window);
+    gst_object_unref (gst_sink->window);

A GtkWindow is not a GstObject ;)
Comment 4 Thibault Saunier 2015-09-19 10:32:06 UTC
Attachment 311667 [details] pushed as a2bdce8 - gtkglsink: Hide and clean the GtkWindow we might create
Comment 5 Thibault Saunier 2015-09-19 10:32:52 UTC
Openned https://bugzilla.gnome.org/show_bug.cgi?id=755251
Comment 6 Sebastian Dröge (slomo) 2015-09-19 15:57:02 UTC
<ystreet00> thiblahute: your change segfaults now with videotestsrc ! glupload ! gtkglsink
Comment 7 Thibault Saunier 2015-09-20 07:04:08 UTC
I am getting

  (gst-launch-1.0:23903): Gtk-CRITICAL **: gtk_widget_destroy: assertion 'GTK_IS_WIDGET (widget)' failed

here. is that what you meant? Gonna investigate anyway.
Comment 8 Thibault Saunier 2015-09-21 08:48:08 UTC
Created attachment 311734 [details] [review]
gtksink: Do not re destroy the GtkWindow if destroyed by the user

Otherwise we will get an ASSERT.

Fixes
Comment 9 Matthew Waters (ystreet00) 2015-09-21 10:10:28 UTC
Review of attachment 311734 [details] [review]:

Looks fine.

::: ext/gtk/gstgtkbasesink.c
@@ +154,3 @@
+    g_clear_object (&gtk_sink->widget);
+  else
+    gtk_sink->window = NULL;

either make the else clause an else if (widget == gtk_sink->window) with an else g_assert_not_reached() or make a separate callback for the window destroy.
Comment 10 Thibault Saunier 2015-09-21 11:04:37 UTC
Added the check and assertion and pushed. Thanks for the review.

Attachment 311734 [details] pushed as 717f922 - gtksink: Do not re destroy the GtkWindow if destroyed by the user
Comment 11 Edward Hervey 2015-10-01 10:06:59 UTC
doing a "gst-inspect-1.0 gtksink" will cause a segfault because it enters the g_assert_no_reached() code
Comment 12 Sebastian Dröge (slomo) 2015-10-02 07:32:57 UTC
Let's track this in bug #755249
Comment 13 Sebastian Dröge (slomo) 2015-10-02 07:33:44 UTC
I mean bug #755969