mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-23 09:04:15 +00:00
gst/audiofx/: Don't save format information ourselves, this is already saved in
Original commit message from CVS: * gst/audiofx/audioamplify.c: (gst_audio_amplify_init), (gst_audio_amplify_setup), (gst_audio_amplify_transform_ip): * gst/audiofx/audiodynamic.c: (gst_audio_dynamic_set_process_function), (gst_audio_dynamic_init), (gst_audio_dynamic_setup), (gst_audio_dynamic_transform_ip): * gst/audiofx/audiodynamic.h: * gst/audiofx/audioinvert.c: (gst_audio_invert_init), (gst_audio_invert_setup), (gst_audio_invert_transform_ip): * gst/audiofx/audioinvert.h: Don't save format information ourselves, this is already saved in GstAudioFilter.
This commit is contained in:
parent
9fa21084bf
commit
5f350149a0
6 changed files with 22 additions and 18 deletions
14
ChangeLog
14
ChangeLog
|
@ -1,3 +1,17 @@
|
||||||
|
2007-07-26 Sebastian Dröge <slomo@circular-chaos.org>
|
||||||
|
|
||||||
|
* gst/audiofx/audioamplify.c: (gst_audio_amplify_init),
|
||||||
|
(gst_audio_amplify_setup), (gst_audio_amplify_transform_ip):
|
||||||
|
* gst/audiofx/audiodynamic.c:
|
||||||
|
(gst_audio_dynamic_set_process_function), (gst_audio_dynamic_init),
|
||||||
|
(gst_audio_dynamic_setup), (gst_audio_dynamic_transform_ip):
|
||||||
|
* gst/audiofx/audiodynamic.h:
|
||||||
|
* gst/audiofx/audioinvert.c: (gst_audio_invert_init),
|
||||||
|
(gst_audio_invert_setup), (gst_audio_invert_transform_ip):
|
||||||
|
* gst/audiofx/audioinvert.h:
|
||||||
|
Don't save format information ourselves, this is already saved in
|
||||||
|
GstAudioFilter.
|
||||||
|
|
||||||
2007-07-26 Wim Taymans <wim.taymans@gmail.com>
|
2007-07-26 Wim Taymans <wim.taymans@gmail.com>
|
||||||
|
|
||||||
* gst/rtsp/gstrtspext.c: (gst_rtsp_ext_list_filter),
|
* gst/rtsp/gstrtspext.c: (gst_rtsp_ext_list_filter),
|
||||||
|
|
|
@ -216,7 +216,6 @@ gst_audio_amplify_init (GstAudioAmplify * filter, GstAudioAmplifyClass * klass)
|
||||||
{
|
{
|
||||||
filter->amplification = 1.0;
|
filter->amplification = 1.0;
|
||||||
filter->clipping_method = METHOD_CLIP;
|
filter->clipping_method = METHOD_CLIP;
|
||||||
filter->width = 0;
|
|
||||||
filter->format_index = 0;
|
filter->format_index = 0;
|
||||||
gst_base_transform_set_in_place (GST_BASE_TRANSFORM (filter), TRUE);
|
gst_base_transform_set_in_place (GST_BASE_TRANSFORM (filter), TRUE);
|
||||||
}
|
}
|
||||||
|
@ -284,8 +283,6 @@ gst_audio_amplify_setup (GstAudioFilter * base, GstRingBufferSpec * format)
|
||||||
GstAudioAmplify *filter = GST_AUDIO_AMPLIFY (base);
|
GstAudioAmplify *filter = GST_AUDIO_AMPLIFY (base);
|
||||||
gboolean ret;
|
gboolean ret;
|
||||||
|
|
||||||
filter->width = format->width / 8;
|
|
||||||
|
|
||||||
if (format->type == GST_BUFTYPE_LINEAR && format->width == 16)
|
if (format->type == GST_BUFTYPE_LINEAR && format->width == 16)
|
||||||
filter->format_index = 0;
|
filter->format_index = 0;
|
||||||
else if (format->type == GST_BUFTYPE_FLOAT && format->width == 32)
|
else if (format->type == GST_BUFTYPE_FLOAT && format->width == 32)
|
||||||
|
@ -414,7 +411,8 @@ static GstFlowReturn
|
||||||
gst_audio_amplify_transform_ip (GstBaseTransform * base, GstBuffer * buf)
|
gst_audio_amplify_transform_ip (GstBaseTransform * base, GstBuffer * buf)
|
||||||
{
|
{
|
||||||
GstAudioAmplify *filter = GST_AUDIO_AMPLIFY (base);
|
GstAudioAmplify *filter = GST_AUDIO_AMPLIFY (base);
|
||||||
guint num_samples = GST_BUFFER_SIZE (buf) / filter->width;
|
guint num_samples =
|
||||||
|
GST_BUFFER_SIZE (buf) / (GST_AUDIO_FILTER (filter)->format.width / 8);
|
||||||
|
|
||||||
if (!gst_buffer_is_writable (buf))
|
if (!gst_buffer_is_writable (buf))
|
||||||
return GST_FLOW_OK;
|
return GST_FLOW_OK;
|
||||||
|
|
|
@ -207,7 +207,8 @@ gst_audio_dynamic_set_process_function (GstAudioDynamic * filter)
|
||||||
|
|
||||||
func_index = (filter->mode == MODE_COMPRESSOR) ? 0 : 4;
|
func_index = (filter->mode == MODE_COMPRESSOR) ? 0 : 4;
|
||||||
func_index += (filter->characteristics == CHARACTERISTICS_HARD_KNEE) ? 0 : 2;
|
func_index += (filter->characteristics == CHARACTERISTICS_HARD_KNEE) ? 0 : 2;
|
||||||
func_index += (!filter->is_float) ? 0 : 1;
|
func_index +=
|
||||||
|
(GST_AUDIO_FILTER (filter)->format.type == GST_BUFTYPE_FLOAT) ? 1 : 0;
|
||||||
|
|
||||||
if (func_index >= 0 && func_index < 8) {
|
if (func_index >= 0 && func_index < 8) {
|
||||||
filter->process = process_functions[func_index];
|
filter->process = process_functions[func_index];
|
||||||
|
@ -278,8 +279,6 @@ gst_audio_dynamic_init (GstAudioDynamic * filter, GstAudioDynamicClass * klass)
|
||||||
filter->threshold = 0.0;
|
filter->threshold = 0.0;
|
||||||
filter->characteristics = CHARACTERISTICS_HARD_KNEE;
|
filter->characteristics = CHARACTERISTICS_HARD_KNEE;
|
||||||
filter->mode = MODE_COMPRESSOR;
|
filter->mode = MODE_COMPRESSOR;
|
||||||
filter->width = 0;
|
|
||||||
filter->is_float = FALSE;
|
|
||||||
gst_base_transform_set_in_place (GST_BASE_TRANSFORM (filter), TRUE);
|
gst_base_transform_set_in_place (GST_BASE_TRANSFORM (filter), TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -343,9 +342,6 @@ gst_audio_dynamic_setup (GstAudioFilter * base, GstRingBufferSpec * format)
|
||||||
GstAudioDynamic *filter = GST_AUDIO_DYNAMIC (base);
|
GstAudioDynamic *filter = GST_AUDIO_DYNAMIC (base);
|
||||||
gboolean ret = TRUE;
|
gboolean ret = TRUE;
|
||||||
|
|
||||||
filter->width = format->width / 8;
|
|
||||||
filter->is_float = (format->type == GST_BUFTYPE_FLOAT) ? TRUE : FALSE;
|
|
||||||
|
|
||||||
ret = gst_audio_dynamic_set_process_function (filter);
|
ret = gst_audio_dynamic_set_process_function (filter);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -700,7 +696,8 @@ static GstFlowReturn
|
||||||
gst_audio_dynamic_transform_ip (GstBaseTransform * base, GstBuffer * buf)
|
gst_audio_dynamic_transform_ip (GstBaseTransform * base, GstBuffer * buf)
|
||||||
{
|
{
|
||||||
GstAudioDynamic *filter = GST_AUDIO_DYNAMIC (base);
|
GstAudioDynamic *filter = GST_AUDIO_DYNAMIC (base);
|
||||||
guint num_samples = GST_BUFFER_SIZE (buf) / filter->width;
|
guint num_samples =
|
||||||
|
GST_BUFFER_SIZE (buf) / (GST_AUDIO_FILTER (filter)->format.width / 8);
|
||||||
|
|
||||||
if (!gst_buffer_is_writable (buf))
|
if (!gst_buffer_is_writable (buf))
|
||||||
return GST_FLOW_OK;
|
return GST_FLOW_OK;
|
||||||
|
|
|
@ -47,8 +47,6 @@ struct _GstAudioDynamic
|
||||||
|
|
||||||
/* < private > */
|
/* < private > */
|
||||||
GstAudioDynamicProcessFunc process;
|
GstAudioDynamicProcessFunc process;
|
||||||
gint width;
|
|
||||||
gboolean is_float;
|
|
||||||
gint characteristics;
|
gint characteristics;
|
||||||
gint mode;
|
gint mode;
|
||||||
gfloat threshold;
|
gfloat threshold;
|
||||||
|
|
|
@ -147,7 +147,6 @@ static void
|
||||||
gst_audio_invert_init (GstAudioInvert * filter, GstAudioInvertClass * klass)
|
gst_audio_invert_init (GstAudioInvert * filter, GstAudioInvertClass * klass)
|
||||||
{
|
{
|
||||||
filter->degree = 0.0;
|
filter->degree = 0.0;
|
||||||
filter->width = 0;
|
|
||||||
gst_base_transform_set_in_place (GST_BASE_TRANSFORM (filter), TRUE);
|
gst_base_transform_set_in_place (GST_BASE_TRANSFORM (filter), TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -202,8 +201,6 @@ gst_audio_invert_setup (GstAudioFilter * base, GstRingBufferSpec * format)
|
||||||
else
|
else
|
||||||
ret = FALSE;
|
ret = FALSE;
|
||||||
|
|
||||||
filter->width = format->width / 8;
|
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -240,7 +237,8 @@ static GstFlowReturn
|
||||||
gst_audio_invert_transform_ip (GstBaseTransform * base, GstBuffer * buf)
|
gst_audio_invert_transform_ip (GstBaseTransform * base, GstBuffer * buf)
|
||||||
{
|
{
|
||||||
GstAudioInvert *filter = GST_AUDIO_INVERT (base);
|
GstAudioInvert *filter = GST_AUDIO_INVERT (base);
|
||||||
guint num_samples = GST_BUFFER_SIZE (buf) / filter->width;
|
guint num_samples =
|
||||||
|
GST_BUFFER_SIZE (buf) / (GST_AUDIO_FILTER (filter)->format.width / 8);
|
||||||
|
|
||||||
if (!gst_buffer_is_writable (buf))
|
if (!gst_buffer_is_writable (buf))
|
||||||
return GST_FLOW_OK;
|
return GST_FLOW_OK;
|
||||||
|
|
|
@ -47,7 +47,6 @@ struct _GstAudioInvert
|
||||||
|
|
||||||
/* < private > */
|
/* < private > */
|
||||||
GstAudioInvertProcessFunc process;
|
GstAudioInvertProcessFunc process;
|
||||||
gint width;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
struct _GstAudioInvertClass
|
struct _GstAudioInvertClass
|
||||||
|
|
Loading…
Reference in a new issue