rpms/gstreamer-plugins-base/F-12 gstpb-playbin-notify.patch, NONE, 1.1 gstreamer-plugins-base.spec, 1.90, 1.91

Bastien Nocera hadess at fedoraproject.org
Thu Oct 29 13:51:45 UTC 2009


Author: hadess

Update of /cvs/pkgs/rpms/gstreamer-plugins-base/F-12
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv6464

Modified Files:
	gstreamer-plugins-base.spec 
Added Files:
	gstpb-playbin-notify.patch 
Log Message:
* Thu Oct 29 2009 Bastien Nocera <bnocera at redhat.com> 0.10.25-4
- Make playbin push volume changes to the front-end


gstpb-playbin-notify.patch:
 gstplaybin2.c |   17 +++++++++++++++++
 gstplaysink.c |   36 ++++++++++++++++++++++++++++++++++++
 2 files changed, 53 insertions(+)

--- NEW FILE gstpb-playbin-notify.patch ---
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);
 


Index: gstreamer-plugins-base.spec
===================================================================
RCS file: /cvs/pkgs/rpms/gstreamer-plugins-base/F-12/gstreamer-plugins-base.spec,v
retrieving revision 1.90
retrieving revision 1.91
diff -u -p -r1.90 -r1.91
--- gstreamer-plugins-base.spec	27 Oct 2009 01:08:44 -0000	1.90
+++ gstreamer-plugins-base.spec	29 Oct 2009 13:51:45 -0000	1.91
@@ -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-main
 %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 developme
 %doc %{_datadir}/gtk-doc/html/gst-plugins-base-plugins-%{majorminor}
 
 %changelog
+* Thu Oct 29 2009 Bastien Nocera <bnocera at redhat.com> 0.10.25-4
+- Make playbin push volume changes to the front-end
+
 * Tue Oct 27 2009 Bastien Nocera <bnocera at redhat.com> 0.10.25-3
 - Fix audio disappearing with newer pulsesink
 




More information about the fedora-extras-commits mailing list