wtay gst-plugins-base: gst-plugins-base/ gst-plugins-base/gst/volume/

[email protected] Mon, 8 Dec 2008 10:44:37 -0800 (PST)
Newsgroups gmane.comp.video.gstreamer.cvs
Message-ID <[email protected]>
CVS Root:       /cvs/gstreamer
Module:         gst-plugins-base
Changes by:     wtay
Date:           Mon Dec 08 2008  18:44:37 UTC

Log message:
* gst/volume/gstvolume.c: (gst_volume_class_init),
(volume_before_transform), (volume_transform_ip):
Use new basetransform vmethod to reconfigure the dynamic properties and
any pending volume/mute changes. Fixes #563508.

Modified files:
    .               : ChangeLog
    gst/volume      : gstvolume.c

Links:
http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-base/ChangeLog.diff?r1=1.4234&r2=1.4235
http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-base/gst/volume/gstvolume.c.diff?r1=1.103&r2=1.104

====Begin Diffs====
Index: ChangeLog
===================================================================
RCS file: /cvs/gstreamer/gst-plugins-base/ChangeLog,v
retrieving revision 1.4234
retrieving revision 1.4235
diff -u -d -r1.4234 -r1.4235
--- ChangeLog	8 Dec 2008 18:12:17 -0000	1.4234
+++ ChangeLog	8 Dec 2008 18:44:20 -0000	1.4235
@@ -1,3 +1,10 @@
+2008-12-08  Wim Taymans  <[email protected]>
+
+	* gst/volume/gstvolume.c: (gst_volume_class_init),
+	(volume_before_transform), (volume_transform_ip):
+	Use new basetransform vmethod to reconfigure the dynamic properties and
+	any pending volume/mute changes. Fixes #563508.
 2008-12-08  Sebastian Dröge  <[email protected]>
 
 	* configure.ac:
Index: gstvolume.c
RCS file: /cvs/gstreamer/gst-plugins-base/gst/volume/gstvolume.c,v
retrieving revision 1.103
retrieving revision 1.104
diff -u -d -r1.103 -r1.104
--- gstvolume.c	24 Nov 2008 12:03:11 -0000	1.103
+++ gstvolume.c	8 Dec 2008 18:44:22 -0000	1.104
@@ -161,6 +161,8 @@
 static void volume_get_property (GObject * object, guint prop_id,
     GValue * value, GParamSpec * pspec);
+static void volume_before_transform (GstBaseTransform * base,
+    GstBuffer * buffer);
 static GstFlowReturn volume_transform_ip (GstBaseTransform * base,
     GstBuffer * outbuf);
 static gboolean volume_setup (GstAudioFilter * filter,
@@ -430,6 +432,7 @@
           0.0, VOLUME_MAX_DOUBLE, DEFAULT_PROP_VOLUME,
           G_PARAM_READWRITE | GST_PARAM_CONTROLLABLE | G_PARAM_STATIC_STRINGS));
+  trans_class->before_transform = GST_DEBUG_FUNCPTR (volume_before_transform);
   trans_class->transform_ip = GST_DEBUG_FUNCPTR (volume_transform_ip);
   filter_class->setup = GST_DEBUG_FUNCPTR (volume_setup);
 }
@@ -705,27 +708,18 @@
   return res;
-/* call the plugged-in process function for this instance
- * needs to be done with this indirection since volume_transform is
- * a class-global method
- */
-static GstFlowReturn
-volume_transform_ip (GstBaseTransform * base, GstBuffer * outbuf)
+static void
+volume_before_transform (GstBaseTransform * base, GstBuffer * buffer)
 {
-  GstVolume *this = GST_VOLUME (base);
   GstClockTime timestamp;
+  GstVolume *this = GST_VOLUME (base);
   gfloat volume;
   gboolean mute;
-  guint8 *data;
-  guint size;
-
-  if (G_UNLIKELY (!this->negotiated))
-    goto not_negotiated;
   /* FIXME: if controllers are bound, subdivide GST_BUFFER_SIZE into small
    * chunks for smooth fades, what is small? 1/10th sec.
    */
-  timestamp = GST_BUFFER_TIMESTAMP (outbuf);
+  timestamp = GST_BUFFER_TIMESTAMP (buffer);
   timestamp =
       gst_segment_to_stream_time (&base->segment, GST_FORMAT_TIME, timestamp);
@@ -746,6 +740,21 @@
      * we continue processing. */
     volume_update_volume (this, volume, mute);
   }
+}
+/* call the plugged-in process function for this instance
+ * needs to be done with this indirection since volume_transform is
+ * a class-global method
+ */
+static GstFlowReturn
+volume_transform_ip (GstBaseTransform * base, GstBuffer * outbuf)
+{
+  guint8 *data;
+  guint size;
+  if (G_UNLIKELY (!this->negotiated))
+    goto not_negotiated;
   /* don't process data in passthrough-mode */
   if (gst_base_transform_is_passthrough (base) ||

------------------------------------------------------------------------------
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you.  Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/

_______________________________________________
gstreamer-cvs-verbose mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gstreamer-cvs-verbose