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 781904 - gtk-play: crashes and gtk api fixes
gtk-play: crashes and gtk api fixes
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-examples
unspecified
Other All
: Normal normal
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2017-04-28 15:37 UTC by Víctor Manuel Jáquez Leal
Modified: 2017-05-02 11:12 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
playback/player: don't unref gtk_sink but sink it (1.44 KB, patch)
2017-04-28 15:37 UTC, Víctor Manuel Jáquez Leal
committed Details | Review
playback/player: don't unref a contained widget (1.86 KB, patch)
2017-04-28 15:38 UTC, Víctor Manuel Jáquez Leal
committed Details | Review
playback/player: gtk_menu_popup() is deprecated (1.28 KB, patch)
2017-04-28 15:38 UTC, Víctor Manuel Jáquez Leal
committed Details | Review

Description Víctor Manuel Jáquez Leal 2017-04-28 15:37:53 UTC
In this bug are attached a couple patches for gtk-play: two fixes for crashes
and one GTK+ API udpate.
Comment 1 Víctor Manuel Jáquez Leal 2017-04-28 15:37:56 UTC
Created attachment 350655 [details] [review]
playback/player: don't unref gtk_sink but sink it

Commit 5b8ba60c was added because of a memory leak when gtksink was
used as renderer. Nonetheless the patch didn't consider two facts:

1\ that the gtk_sink element was in floating state
2\ there is another code path where the gtk_sink element is already
   sank

Thus the correct fix, is not to ref and unref gtk_sink, but sink it.
Comment 2 Víctor Manuel Jáquez Leal 2017-04-28 15:38:02 UTC
Created attachment 350656 [details] [review]
playback/player: don't unref a contained widget

In the GTK+ model, when a wiget is created, it is floating, thus
when it is added to a widget container, this container is the owner
of the widget.

The video_area widget is created in two different paths:

1\ when the renderer element is also a GTK+ widget and we are
   the owners.
2\ when the renderer element is an overlay an video area a new
   widget owned by the container.

In the first code path, there was a memory leak fixed on commit
f8d4796a, but it didn't consider the second path, leading to a
segmentation fault because the owner of the widget is not us.

This patch unrefs early the video area widget in the first path
avoiding to unref it twice in the second path.
Comment 3 Víctor Manuel Jáquez Leal 2017-04-28 15:38:08 UTC
Created attachment 350657 [details] [review]
playback/player: gtk_menu_popup() is deprecated

gtk_menu_popup() is deprecated in GTK+ 3.22. This patch adds a
compiler guard to use gtk_menu_popup at pointer() if GTK+ is 3.22
or bigger.
Comment 4 Sebastian Dröge (slomo) 2017-05-02 11:12:38 UTC
Attachment 350655 [details] pushed as ff1a654 - playback/player: don't unref gtk_sink but sink it
Attachment 350656 [details] pushed as dbb0375 - playback/player: don't unref a contained widget
Attachment 350657 [details] pushed as d909dea - playback/player: gtk_menu_popup() is deprecated