[gst-cvs] gst-plugins-base: playbin2: Proxy notify::volume and notify:: mute from the playsink to playbin2

Sebastian Dröge slomo at kemper.freedesktop.org
Thu Oct 29 06:36:21 PDT 2009


Module: gst-plugins-base
Branch: master
Commit: de1db5ccbdc10a835a2dfdd5984892f3b0c9bcf4
URL:    http://cgit.freedesktop.org/gstreamer/gst-plugins-base/commit/?id=de1db5ccbdc10a835a2dfdd5984892f3b0c9bcf4

Author: Sebastian Dröge <sebastian.droege at collabora.co.uk>
Date:   Thu Oct 29 14:19:09 2009 +0100

playbin2: Proxy notify::volume and notify::mute from the playsink to playbin2

---

 gst/playback/gstplaybin2.c |   17 +++++++++++++++++
 1 files changed, 17 insertions(+), 0 deletions(-)

diff --git a/gst/playback/gstplaybin2.c b/gst/playback/gstplaybin2.c
index 1387a80..643c763 100644
--- a/gst/playback/gstplaybin2.c
+++ b/gst/playback/gstplaybin2.c
@@ -1091,6 +1091,18 @@ free_group (GstPlayBin * playbin, GstSourceGroup * group)
 }
 
 static void
+notify_volume_cb (GObject * selector, GParamSpec * pspec, GstPlayBin * playbin)
+{
+  g_object_notify (G_OBJECT (playbin), "volume");
+}
+
+static void
+notify_mute_cb (GObject * selector, GParamSpec * pspec, GstPlayBin * playbin)
+{
+  g_object_notify (G_OBJECT (playbin), "mute");
+}
+
+static void
 gst_play_bin_init (GstPlayBin * playbin)
 {
   GstFactoryListType type;
@@ -1116,6 +1128,11 @@ gst_play_bin_init (GstPlayBin * playbin)
   playbin->playsink = g_object_new (GST_TYPE_PLAY_SINK, NULL);
   gst_bin_add (GST_BIN_CAST (playbin), GST_ELEMENT_CAST (playbin->playsink));
   gst_play_sink_set_flags (playbin->playsink, DEFAULT_FLAGS);
+  /* Connect to notify::volume and notify::mute signals for proxying */
+  g_signal_connect (playbin->playsink, "notify::volume",
+      G_CALLBACK (notify_volume_cb), playbin);
+  g_signal_connect (playbin->playsink, "notify::mute",
+      G_CALLBACK (notify_mute_cb), playbin);
 
   playbin->encoding = g_strdup (DEFAULT_SUBTITLE_ENCODING);
 





More information about the Gstreamer-commits mailing list