GNOME Bugzilla – Bug 445529
[volume] support for 24/32-bit audio/x-raw-int
Last modified: 2007-08-23 20:41:21 UTC
Adds 24/32-bit audio/x-raw-int capability to the volume component.
Created attachment 89612 [details] [review] patch against 0.10.3 First attempt at writing GStreamer code.
Ok, I suck. The 24-bit code is completely wrong.
Created attachment 89643 [details] [review] patch with working 24-bit support
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...
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 :)
#define VOLUME_UNITY_INT24 2097152 /* (2^(24-3)) */ #define VOLUME_UNITY_INT32 536870912 /* (2^(32-3)) */
Committed with those changes and int8 support. 2007-08-23 Sebastian Dröge <slomo@circular-chaos.org> 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.