From ba36c8183bef6cacc7a2e8dc3367f2d53f5ca45b Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sebastian=20Dr=C3=B6ge?= Date: Thu, 6 Dec 2007 12:11:29 +0000 Subject: [PATCH] gst/audiofx/: The transform_ip() methods should do nothing if in passthrough mode. Original commit message from CVS: * gst/audiofx/audioamplify.c: (gst_audio_amplify_transform_ip): * gst/audiofx/audiochebyshevfreqband.c: (gst_audio_chebyshev_freq_band_transform_ip): * gst/audiofx/audiochebyshevfreqlimit.c: (gst_audio_chebyshev_freq_limit_transform_ip): * gst/audiofx/audiodynamic.c: (gst_audio_dynamic_transform_ip): * gst/audiofx/audioinvert.c: (gst_audio_invert_transform_ip): The transform_ip() methods should do nothing if in passthrough mode. It might get non-writable buffers in that case but the buffer might as well be writable. * gst/audiofx/audiopanorama.c: (gst_audio_panorama_transform): The transform() methods won't be called in passthrough mode and otherwise the buffer is always writable so don't check here. --- ChangeLog | 17 +++++++++++++++++ gst/audiofx/audioamplify.c | 2 +- gst/audiofx/audiochebband.c | 2 +- gst/audiofx/audiocheblimit.c | 2 +- gst/audiofx/audiochebyshevfreqband.c | 2 +- gst/audiofx/audiochebyshevfreqlimit.c | 2 +- gst/audiofx/audiodynamic.c | 2 +- gst/audiofx/audioinvert.c | 2 +- gst/audiofx/audiopanorama.c | 19 ++++++++----------- 9 files changed, 32 insertions(+), 18 deletions(-) diff --git a/ChangeLog b/ChangeLog index a2dc493..1937df5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,20 @@ +2007-12-06 Sebastian Dröge + + * gst/audiofx/audioamplify.c: (gst_audio_amplify_transform_ip): + * gst/audiofx/audiochebyshevfreqband.c: + (gst_audio_chebyshev_freq_band_transform_ip): + * gst/audiofx/audiochebyshevfreqlimit.c: + (gst_audio_chebyshev_freq_limit_transform_ip): + * gst/audiofx/audiodynamic.c: (gst_audio_dynamic_transform_ip): + * gst/audiofx/audioinvert.c: (gst_audio_invert_transform_ip): + The transform_ip() methods should do nothing if in passthrough mode. + It might get non-writable buffers in that case but the buffer might + as well be writable. + + * gst/audiofx/audiopanorama.c: (gst_audio_panorama_transform): + The transform() methods won't be called in passthrough mode and + otherwise the buffer is always writable so don't check here. + 2007-12-06 Tim-Philipp Müller * gst/wavparse/gstwavparse.c: (gst_wavparse_srcpad_event): diff --git a/gst/audiofx/audioamplify.c b/gst/audiofx/audioamplify.c index 5861a8e..9292e4e 100644 --- a/gst/audiofx/audioamplify.c +++ b/gst/audiofx/audioamplify.c @@ -414,7 +414,7 @@ gst_audio_amplify_transform_ip (GstBaseTransform * base, GstBuffer * buf) guint num_samples = GST_BUFFER_SIZE (buf) / (GST_AUDIO_FILTER (filter)->format.width / 8); - if (!gst_buffer_is_writable (buf)) + if (gst_base_transform_is_passthrough (base)) return GST_FLOW_OK; if (GST_CLOCK_TIME_IS_VALID (GST_BUFFER_TIMESTAMP (buf))) diff --git a/gst/audiofx/audiochebband.c b/gst/audiofx/audiochebband.c index e39a646..04fd5dc 100644 --- a/gst/audiofx/audiochebband.c +++ b/gst/audiofx/audiochebband.c @@ -885,7 +885,7 @@ gst_audio_chebyshev_freq_band_transform_ip (GstBaseTransform * base, guint num_samples = GST_BUFFER_SIZE (buf) / (GST_AUDIO_FILTER (filter)->format.width / 8); - if (!gst_buffer_is_writable (buf)) + if (gst_base_transform_is_passthrough (base)) return GST_FLOW_OK; if (GST_CLOCK_TIME_IS_VALID (GST_BUFFER_TIMESTAMP (buf))) diff --git a/gst/audiofx/audiocheblimit.c b/gst/audiofx/audiocheblimit.c index 0cd1ea6..da403b7 100644 --- a/gst/audiofx/audiocheblimit.c +++ b/gst/audiofx/audiocheblimit.c @@ -785,7 +785,7 @@ gst_audio_chebyshev_freq_limit_transform_ip (GstBaseTransform * base, guint num_samples = GST_BUFFER_SIZE (buf) / (GST_AUDIO_FILTER (filter)->format.width / 8); - if (!gst_buffer_is_writable (buf)) + if (gst_base_transform_is_passthrough (base)) return GST_FLOW_OK; if (GST_CLOCK_TIME_IS_VALID (GST_BUFFER_TIMESTAMP (buf))) diff --git a/gst/audiofx/audiochebyshevfreqband.c b/gst/audiofx/audiochebyshevfreqband.c index e39a646..04fd5dc 100644 --- a/gst/audiofx/audiochebyshevfreqband.c +++ b/gst/audiofx/audiochebyshevfreqband.c @@ -885,7 +885,7 @@ gst_audio_chebyshev_freq_band_transform_ip (GstBaseTransform * base, guint num_samples = GST_BUFFER_SIZE (buf) / (GST_AUDIO_FILTER (filter)->format.width / 8); - if (!gst_buffer_is_writable (buf)) + if (gst_base_transform_is_passthrough (base)) return GST_FLOW_OK; if (GST_CLOCK_TIME_IS_VALID (GST_BUFFER_TIMESTAMP (buf))) diff --git a/gst/audiofx/audiochebyshevfreqlimit.c b/gst/audiofx/audiochebyshevfreqlimit.c index 0cd1ea6..da403b7 100644 --- a/gst/audiofx/audiochebyshevfreqlimit.c +++ b/gst/audiofx/audiochebyshevfreqlimit.c @@ -785,7 +785,7 @@ gst_audio_chebyshev_freq_limit_transform_ip (GstBaseTransform * base, guint num_samples = GST_BUFFER_SIZE (buf) / (GST_AUDIO_FILTER (filter)->format.width / 8); - if (!gst_buffer_is_writable (buf)) + if (gst_base_transform_is_passthrough (base)) return GST_FLOW_OK; if (GST_CLOCK_TIME_IS_VALID (GST_BUFFER_TIMESTAMP (buf))) diff --git a/gst/audiofx/audiodynamic.c b/gst/audiofx/audiodynamic.c index 172333a..883fc93 100644 --- a/gst/audiofx/audiodynamic.c +++ b/gst/audiofx/audiodynamic.c @@ -699,7 +699,7 @@ gst_audio_dynamic_transform_ip (GstBaseTransform * base, GstBuffer * buf) guint num_samples = GST_BUFFER_SIZE (buf) / (GST_AUDIO_FILTER (filter)->format.width / 8); - if (!gst_buffer_is_writable (buf)) + if (gst_base_transform_is_passthrough (base)) return GST_FLOW_OK; if (GST_CLOCK_TIME_IS_VALID (GST_BUFFER_TIMESTAMP (buf))) diff --git a/gst/audiofx/audioinvert.c b/gst/audiofx/audioinvert.c index f8c17ff..013d201 100644 --- a/gst/audiofx/audioinvert.c +++ b/gst/audiofx/audioinvert.c @@ -240,7 +240,7 @@ gst_audio_invert_transform_ip (GstBaseTransform * base, GstBuffer * buf) guint num_samples = GST_BUFFER_SIZE (buf) / (GST_AUDIO_FILTER (filter)->format.width / 8); - if (!gst_buffer_is_writable (buf)) + if (gst_base_transform_is_passthrough (base)) return GST_FLOW_OK; if (GST_CLOCK_TIME_IS_VALID (GST_BUFFER_TIMESTAMP (buf))) diff --git a/gst/audiofx/audiopanorama.c b/gst/audiofx/audiopanorama.c index 72fd14e..3c7542b 100644 --- a/gst/audiofx/audiopanorama.c +++ b/gst/audiofx/audiopanorama.c @@ -169,19 +169,19 @@ static GstFlowReturn gst_audio_panorama_transform (GstBaseTransform * base, static GstAudioPanoramaProcessFunc panorama_process_functions[2][2][2] = { { {(GstAudioPanoramaProcessFunc) gst_audio_panorama_transform_m2s_int, - (GstAudioPanoramaProcessFunc) - gst_audio_panorama_transform_m2s_int_simple}, + (GstAudioPanoramaProcessFunc) + gst_audio_panorama_transform_m2s_int_simple}, {(GstAudioPanoramaProcessFunc) gst_audio_panorama_transform_m2s_float, - (GstAudioPanoramaProcessFunc) - gst_audio_panorama_transform_m2s_float_simple} + (GstAudioPanoramaProcessFunc) + gst_audio_panorama_transform_m2s_float_simple} }, { {(GstAudioPanoramaProcessFunc) gst_audio_panorama_transform_s2s_int, - (GstAudioPanoramaProcessFunc) - gst_audio_panorama_transform_s2s_int_simple}, + (GstAudioPanoramaProcessFunc) + gst_audio_panorama_transform_s2s_int_simple}, {(GstAudioPanoramaProcessFunc) gst_audio_panorama_transform_s2s_float, - (GstAudioPanoramaProcessFunc) - gst_audio_panorama_transform_s2s_float_simple} + (GstAudioPanoramaProcessFunc) + gst_audio_panorama_transform_s2s_float_simple} } }; @@ -631,9 +631,6 @@ gst_audio_panorama_transform (GstBaseTransform * base, GstBuffer * inbuf, GstAudioPanorama *filter = GST_AUDIO_PANORAMA (base); guint num_samples = GST_BUFFER_SIZE (outbuf) / (2 * filter->width); - if (!gst_buffer_is_writable (outbuf)) - return GST_FLOW_OK; - if (GST_CLOCK_TIME_IS_VALID (GST_BUFFER_TIMESTAMP (outbuf))) gst_object_sync_values (G_OBJECT (filter), GST_BUFFER_TIMESTAMP (outbuf)); -- 2.7.4