mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-18 07:47:17 +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>
|
||||
|
||||
* 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->clipping_method = METHOD_CLIP;
|
||||
filter->width = 0;
|
||||
filter->format_index = 0;
|
||||
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);
|
||||
gboolean ret;
|
||||
|
||||
filter->width = format->width / 8;
|
||||
|
||||
if (format->type == GST_BUFTYPE_LINEAR && format->width == 16)
|
||||
filter->format_index = 0;
|
||||
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)
|
||||
{
|
||||
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))
|
||||
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->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) {
|
||||
filter->process = process_functions[func_index];
|
||||
|
@ -278,8 +279,6 @@ gst_audio_dynamic_init (GstAudioDynamic * filter, GstAudioDynamicClass * klass)
|
|||
filter->threshold = 0.0;
|
||||
filter->characteristics = CHARACTERISTICS_HARD_KNEE;
|
||||
filter->mode = MODE_COMPRESSOR;
|
||||
filter->width = 0;
|
||||
filter->is_float = FALSE;
|
||||
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);
|
||||
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);
|
||||
|
||||
return ret;
|
||||
|
@ -700,7 +696,8 @@ static GstFlowReturn
|
|||
gst_audio_dynamic_transform_ip (GstBaseTransform * base, GstBuffer * buf)
|
||||
{
|
||||
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))
|
||||
return GST_FLOW_OK;
|
||||
|
|
|
@ -47,8 +47,6 @@ struct _GstAudioDynamic
|
|||
|
||||
/* < private > */
|
||||
GstAudioDynamicProcessFunc process;
|
||||
gint width;
|
||||
gboolean is_float;
|
||||
gint characteristics;
|
||||
gint mode;
|
||||
gfloat threshold;
|
||||
|
|
|
@ -147,7 +147,6 @@ static void
|
|||
gst_audio_invert_init (GstAudioInvert * filter, GstAudioInvertClass * klass)
|
||||
{
|
||||
filter->degree = 0.0;
|
||||
filter->width = 0;
|
||||
gst_base_transform_set_in_place (GST_BASE_TRANSFORM (filter), TRUE);
|
||||
}
|
||||
|
||||
|
@ -202,8 +201,6 @@ gst_audio_invert_setup (GstAudioFilter * base, GstRingBufferSpec * format)
|
|||
else
|
||||
ret = FALSE;
|
||||
|
||||
filter->width = format->width / 8;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -240,7 +237,8 @@ static GstFlowReturn
|
|||
gst_audio_invert_transform_ip (GstBaseTransform * base, GstBuffer * buf)
|
||||
{
|
||||
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))
|
||||
return GST_FLOW_OK;
|
||||
|
|
|
@ -47,7 +47,6 @@ struct _GstAudioInvert
|
|||
|
||||
/* < private > */
|
||||
GstAudioInvertProcessFunc process;
|
||||
gint width;
|
||||
};
|
||||
|
||||
struct _GstAudioInvertClass
|
||||
|
|
Loading…
Reference in a new issue