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 647005 - GstBus: Only create the socketpair for async message delivery if required
GstBus: Only create the socketpair for async message delivery if required
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
unspecified
Other All
: Normal blocker
: 0.10.33
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2011-04-07 09:29 UTC by Sebastian Dröge (slomo)
Modified: 2011-04-08 07:17 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
bus: Use a construct-only property to distinguish between child buses and normal buses (5.50 KB, patch)
2011-04-07 09:29 UTC, Sebastian Dröge (slomo)
committed Details | Review
bus: Immediately drop messages after calling the sync handler if this is a synchronous bus (1.90 KB, patch)
2011-04-07 09:29 UTC, Sebastian Dröge (slomo)
committed Details | Review

Description Sebastian Dröge (slomo) 2011-04-07 09:29:30 UTC
This adds a new construct-only property to disable the creation of the
sockets.
Comment 1 Sebastian Dröge (slomo) 2011-04-07 09:29:34 UTC
Created attachment 185400 [details] [review]
bus: Use a construct-only property to distinguish between child buses and normal buses

This allows to only create the socketpair when it is really required instead
of always creating it and immediately destroying it again for child buses.
Comment 2 Sebastian Dröge (slomo) 2011-04-07 09:29:38 UTC
Created attachment 185401 [details] [review]
bus: Immediately drop messages after calling the sync handler if this is a synchronous bus

Otherwise we might wait forever for the message to be popped from
the queue if a sync handler returned GST_BUS_ASYNC.
Comment 3 Sebastian Dröge (slomo) 2011-04-07 09:30:08 UTC
Any better suggestions for the name of the property?
Comment 4 Stefan Sauer (gstreamer, gtkdoc dev) 2011-04-07 09:44:09 UTC
Review of attachment 185400 [details] [review]:

::: gst/gstbus.c
@@ +150,3 @@
+    case PROP_ENABLE_ASYNC:
+      /* Do nothing, already handled in GObject::constructor */
+      break;

whooo. please not. Just handle it. See comment below.

@@ +172,3 @@
+      construct_properties);
+  bus = GST_BUS_CAST (object);
+

Imho chaining up here should call the gst_bus_set_property(). This would spare you the ugly hack below and the global variable for the pspec.
Comment 5 Stefan Sauer (gstreamer, gtkdoc dev) 2011-04-07 09:56:32 UTC
Another comment from irc discussion, kill _construct() vmethod, but used _constructed(), that ensures that the (construct-only)-object-properties are set.
Comment 6 Sebastian Dröge (slomo) 2011-04-08 07:17:16 UTC
Pushed with Stefan's changes


commit 80eb160e0f62350271f061daa5f289d9d4277cf4
Author: Sebastian Dröge <sebastian.droege@collabora.co.uk>
Date:   Thu Apr 7 11:24:35 2011 +0200

    bus: Immediately drop messages after calling the sync handler if this is a s
    
    Otherwise we might wait forever for the message to be popped from
    the queue if a sync handler returned GST_BUS_ASYNC.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=647005

commit c41b0ade28790ffdb0e484b41cd7929c4e145dec
Author: Sebastian Dröge <sebastian.droege@collabora.co.uk>
Date:   Thu Apr 7 11:19:57 2011 +0200

    bus: Use a construct-only property to distinguish between child buses and no
    
    This allows to only create the socketpair when it is really required instead
    of always creating it and immediately destroying it again for child buses.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=647005