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 445529 - [volume] support for 24/32-bit audio/x-raw-int
[volume] support for 24/32-bit audio/x-raw-int
Product: GStreamer
Classification: Platform
Component: gst-plugins-base
git master
Other All
: Normal normal
: 0.10.15
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Reported: 2007-06-08 15:22 UTC by Danielle Madeley
Modified: 2007-08-23 20:41 UTC
See Also:
GNOME target: ---
GNOME version: Unversioned Enhancement

patch against 0.10.3 (10.53 KB, patch)
2007-06-08 15:23 UTC, Danielle Madeley
none Details | Review
patch with working 24-bit support (10.25 KB, patch)
2007-06-09 14:17 UTC, Danielle Madeley
committed Details | Review

Description Danielle Madeley 2007-06-08 15:22:00 UTC
Adds 24/32-bit audio/x-raw-int capability to the volume component.
Comment 1 Danielle Madeley 2007-06-08 15:23:02 UTC
Created attachment 89612 [details] [review]
patch against 0.10.3

First attempt at writing GStreamer code.
Comment 2 Danielle Madeley 2007-06-09 04:42:26 UTC
Ok, I suck. The 24-bit code is completely wrong.
Comment 3 Danielle Madeley 2007-06-09 14:17:32 UTC
Created attachment 89643 [details] [review]
patch with working 24-bit support
Comment 4 Sebastian Dröge (slomo) 2007-08-23 07:46:06 UTC
The caps in the pad templates have a small bug, you only want width==depth caps in there. In your patch width==32 and depth==16 would be allowed for example.
Other than that this looks fine from a fast look...
Comment 5 Sebastian Dröge (slomo) 2007-08-23 07:50:20 UTC
Oh, and the negative minimum values are always in absolute one larger than the positive maximums, i.e. 
+#define VOLUME_MAX_INT32             2147483647
+#define VOLUME_MIN_INT32             -2147483646
+#define VOLUME_MAX_INT24             8388607
+#define VOLUME_MIN_INT24             -8388606

should be

+#define VOLUME_MAX_INT32             2147483647
+#define VOLUME_MIN_INT32             -2147483648
+#define VOLUME_MAX_INT24             8388607
+#define VOLUME_MIN_INT24             -8388608

Also I'm not sure about the bitshift stuff in the very beginning of the patch, would be better if someone who understands it looks at this too :)
Comment 6 Stefan Sauer (gstreamer, gtkdoc dev) 2007-08-23 10:10:41 UTC
#define VOLUME_UNITY_INT24 2097152   /* (2^(24-3)) */
#define VOLUME_UNITY_INT32 536870912 /* (2^(32-3)) */
Comment 7 Sebastian Dröge (slomo) 2007-08-23 20:41:21 UTC
Committed with those changes and int8 support.

2007-08-23  Sebastian Dröge  <>

	Based on a patch by: Davyd <davyd at madeley dot id dot au>

	* gst/volume/gstvolume.c: (volume_choose_func),
	(volume_update_real_volume), (gst_volume_set_volume),
	(gst_volume_init), (volume_process_int32),
	(volume_process_int32_clamp), (volume_process_int24),
	(volume_process_int24_clamp), (volume_process_int16),
	(volume_process_int16_clamp), (volume_process_int8),
	(volume_process_int8_clamp), (volume_update_volume), (plugin_init):
	* gst/volume/gstvolume.h:
	Add support for int32, int24 and int8 to the volume element.
	Fixes #445529.