commit 6254d36bb4e70ea4b338055d03092d6e0880367b
Author: Bastien Nocera <hadess(a)fedoraproject.org>
Date: Thu Oct 29 14:10:14 2009 +0000
- Make playbin push volume changes to the front-end
gstpb-playbin-notify.patch | 123 ++++++++++++++++++++++++++++++++++++++++++++
gstreamer-plugins-base.spec | 8 ++-
2 files changed, 130 insertions(+), 1 deletion(-)
---
diff --git a/gstpb-playbin-notify.patch b/gstpb-playbin-notify.patch
new file mode 100644
index 0000000..363b541
--- /dev/null
+++ b/gstpb-playbin-notify.patch
@@ -0,0 +1,123 @@
+diff --git a/gst/playback/gstplaysink.c b/gst/playback/gstplaysink.c
+index 85f7abd..9809196 100644
+--- a/gst/playback/gstplaysink.c
++++ b/gst/playback/gstplaysink.c
+@@ -1421,6 +1421,19 @@ gen_subp_chain (GstPlaySink * playsink)
+ return chain;
+ }
+
++static void
++notify_volume_cb (GObject * selector, GParamSpec * pspec,
++ GstPlaySink * playsink)
++{
++ g_object_notify (G_OBJECT (playsink), "volume");
++}
++
++static void
++notify_mute_cb (GObject * selector, GParamSpec * pspec, GstPlaySink * playsink)
++{
++ g_object_notify (G_OBJECT (playsink), "mute");
++}
++
+ /* make the chain that contains the elements needed to perform
+ * audio playback.
+ *
+@@ -1497,6 +1510,9 @@ gen_audio_chain (GstPlaySink * playsink, gboolean raw, gboolean
queue)
+ if (elem) {
+ chain->volume = elem;
+
++ g_signal_connect (chain->volume, "notify::volume",
++ G_CALLBACK (notify_volume_cb), playsink);
++
+ GST_DEBUG_OBJECT (playsink, "the sink has a volume property");
+ have_volume = TRUE;
+ chain->sink_volume = TRUE;
+@@ -1507,6 +1523,8 @@ gen_audio_chain (GstPlaySink * playsink, gboolean raw, gboolean
queue)
+ gst_play_sink_find_property_sinks (playsink, chain->sink, "mute");
+ if (chain->mute) {
+ GST_DEBUG_OBJECT (playsink, "the sink has a mute property");
++ g_signal_connect (chain->mute, "notify::mute",
++ G_CALLBACK (notify_mute_cb), playsink);
+ }
+ /* use the sink to control the volume and mute */
+ if (playsink->volume_changed) {
+@@ -1575,6 +1593,11 @@ gen_audio_chain (GstPlaySink * playsink, gboolean raw, gboolean
queue)
+ } else {
+ have_volume = TRUE;
+
++ g_signal_connect (chain->volume, "notify::volume",
++ G_CALLBACK (notify_volume_cb), playsink);
++ g_signal_connect (chain->mute, "notify::mute",
++ G_CALLBACK (notify_mute_cb), playsink);
++
+ /* volume also has the mute property */
+ chain->mute = chain->volume;
+
+@@ -1687,6 +1710,9 @@ setup_audio_chain (GstPlaySink * playsink, gboolean raw, gboolean
queue)
+ /* use the sink to control the volume */
+ g_object_set (G_OBJECT (chain->volume), "volume",
playsink->volume, NULL);
+ }
++
++ g_signal_connect (chain->volume, "notify::volume",
++ G_CALLBACK (notify_volume_cb), playsink);
+ /* if the sink also has a mute property we can use this as well. We'll only
+ * use the mute property if there is a volume property. We can simulate the
+ * mute with the volume otherwise. */
+@@ -1694,12 +1720,22 @@ setup_audio_chain (GstPlaySink * playsink, gboolean raw, gboolean
queue)
+ gst_play_sink_find_property_sinks (playsink, chain->sink, "mute");
+ if (chain->mute) {
+ GST_DEBUG_OBJECT (playsink, "the sink has a mute property");
++ g_signal_connect (chain->mute, "notify::mute",
++ G_CALLBACK (notify_mute_cb), playsink);
+ }
+ } else {
+ /* no volume, we need to add a volume element when we can */
+ GST_DEBUG_OBJECT (playsink, "the sink has no volume property");
+ if (!raw) {
+ GST_LOG_OBJECT (playsink, "non-raw format, can't do soft volume
control");
++
++ if (chain->volume)
++ g_signal_handlers_disconnect_by_func (chain->volume, notify_volume_cb,
++ playsink);
++ if (chain->mute)
++ g_signal_handlers_disconnect_by_func (chain->mute, notify_mute_cb,
++ playsink);
++
+ chain->volume = NULL;
+ chain->mute = NULL;
+ } else {
+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);
+
diff --git a/gstreamer-plugins-base.spec b/gstreamer-plugins-base.spec
index 3f137f3..316ab0e 100644
--- a/gstreamer-plugins-base.spec
+++ b/gstreamer-plugins-base.spec
@@ -3,7 +3,7 @@
Name: %{gstreamer}-plugins-base
Version: 0.10.25
-Release: 3%{?dist}
+Release: 4%{?dist}
Summary: GStreamer streaming media framework base plug-ins
Group: Applications/Multimedia
@@ -42,6 +42,8 @@ Patch1: gstpb-fix-missing-plugins.patch
#
https://bugzilla.gnome.org/show_bug.cgi?id=599105
Patch2: pulsesink-disable-old-version-hack.patch
Conflicts: gstreamer-plugins-good < 0.10.16-3
+#
https://bugzilla.gnome.org/show_bug.cgi?id=600027
+Patch3: gstpb-playbin-notify.patch
# documentation
BuildRequires: gtk-doc >= 1.3
@@ -62,6 +64,7 @@ This package contains a set of well-maintained base plug-ins.
%patch0 -p1 -b .subtitle-errors
%patch1 -p1 -b .missing-plugins
%patch2 -p1 -R -b .old-pulsesink
+%patch3 -p1 -b .volume-notify
%build
%configure \
@@ -257,6 +260,9 @@ GStreamer Base Plugins library development and header files.
%doc %{_datadir}/gtk-doc/html/gst-plugins-base-plugins-%{majorminor}
%changelog
+* Thu Oct 29 2009 Bastien Nocera <bnocera(a)redhat.com> 0.10.25-4
+- Make playbin push volume changes to the front-end
+
* Tue Oct 27 2009 Bastien Nocera <bnocera(a)redhat.com> 0.10.25-3
- Fix audio disappearing with newer pulsesink