mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-24 01:00:37 +00:00
parent
c69dd320af
commit
2d13b15376
1 changed files with 19 additions and 0 deletions
|
@ -116,6 +116,13 @@ GST_DEBUG_CATEGORY_STATIC (gst_spectrum_debug);
|
||||||
" rate = (int) [ 1, MAX ], " \
|
" rate = (int) [ 1, MAX ], " \
|
||||||
" channels = (int) [ 1, MAX ]; " \
|
" channels = (int) [ 1, MAX ]; " \
|
||||||
"audio/x-raw-int, " \
|
"audio/x-raw-int, " \
|
||||||
|
" width = (int) 24, " \
|
||||||
|
" depth = (int) [ 1, 24 ], " \
|
||||||
|
" signed = (boolean) true, " \
|
||||||
|
" endianness = (int) BYTE_ORDER, " \
|
||||||
|
" rate = (int) [ 1, MAX ], " \
|
||||||
|
" channels = (int) [ 1, MAX ]; " \
|
||||||
|
"audio/x-raw-int, " \
|
||||||
" width = (int) 32, " \
|
" width = (int) 32, " \
|
||||||
" depth = (int) [ 1, 32 ], " \
|
" depth = (int) [ 1, 32 ], " \
|
||||||
" signed = (boolean) true, " \
|
" signed = (boolean) true, " \
|
||||||
|
@ -558,6 +565,18 @@ gst_spectrum_transform_ip (GstBaseTransform * trans, GstBuffer * buffer)
|
||||||
*/
|
*/
|
||||||
spectrum->input[spectrum->input_pos] +=
|
spectrum->input[spectrum->input_pos] +=
|
||||||
max_value ? in[i] / max_value : in[i] * 2 + 1;
|
max_value ? in[i] / max_value : in[i] * 2 + 1;
|
||||||
|
} else if (!fp && width == 3) {
|
||||||
|
for (i = 0; i < channels; i++) {
|
||||||
|
#if G_BYTE_ORDER == G_BIG_ENDIAN
|
||||||
|
gint32 value = GST_READ_UINT24_BE (data);
|
||||||
|
#else
|
||||||
|
gint32 value = GST_READ_UINT24_LE (data);
|
||||||
|
#endif
|
||||||
|
if (value & 0x00800000)
|
||||||
|
value |= 0xff000000;
|
||||||
|
spectrum->input[spectrum->input_pos] +=
|
||||||
|
max_value ? value / max_value : value * 2 + 1;
|
||||||
|
}
|
||||||
} else if (!fp && width == 2) {
|
} else if (!fp && width == 2) {
|
||||||
gint16 *in = (gint16 *) data;
|
gint16 *in = (gint16 *) data;
|
||||||
for (i = 0; i < channels; i++)
|
for (i = 0; i < channels; i++)
|
||||||
|
|
Loading…
Reference in a new issue