Commit cf9059f0 authored by Wim Taymans's avatar Wim Taymans
Browse files

audio-resampler: improve non-interleaved flags

Make it possible to have different interleaving on input and output
because we can quite trivially do that.
parent 33855f0f
......@@ -681,8 +681,10 @@ chain_resample (GstAudioConverter * convert, AudioChain * prev)
method = GET_OPT_RESAMPLER_METHOD (convert);
flags = 0;
if (convert->current_layout == GST_AUDIO_LAYOUT_NON_INTERLEAVED)
flags |= GST_AUDIO_RESAMPLER_FLAG_NON_INTERLEAVED;
if (convert->current_layout == GST_AUDIO_LAYOUT_NON_INTERLEAVED) {
flags |= GST_AUDIO_RESAMPLER_FLAG_NON_INTERLEAVED_IN;
flags |= GST_AUDIO_RESAMPLER_FLAG_NON_INTERLEAVED_OUT;
}
if (variable_rate)
flags |= GST_AUDIO_RESAMPLER_FLAG_VARIABLE_RATE;
......
......@@ -1504,7 +1504,7 @@ gst_audio_resampler_new (GstAudioResamplerMethod method,
resampler->sbuf = g_malloc0 (sizeof (gpointer) * channels);
non_interleaved =
(resampler->flags & GST_AUDIO_RESAMPLER_FLAG_NON_INTERLEAVED);
(resampler->flags & GST_AUDIO_RESAMPLER_FLAG_NON_INTERLEAVED_OUT);
/* we resample each channel separately */
resampler->blocks = resampler->channels;
......
......@@ -178,9 +178,12 @@ typedef enum {
/**
* GstAudioResamplerFlags:
* @GST_AUDIO_RESAMPLER_FLAG_NONE: no flags
* @GST_AUDIO_RESAMPLER_FLAG_NON_INTERLEAVED: samples are non-interleaved. an array
* of blocks of samples, one for each channel, should be passed to the resample
* function.
* @GST_AUDIO_RESAMPLER_FLAG_NON_INTERLEAVED_IN: input samples are non-interleaved.
* an array of blocks of samples, one for each channel, should be passed to the
* resample function.
* @GST_AUDIO_RESAMPLER_FLAG_NON_INTERLEAVED_OUT: output samples are non-interleaved.
* an array of blocks of samples, one for each channel, should be passed to the
* resample function.
* @GST_AUDIO_RESAMPLER_FLAG_VARIABLE_RATE: optimize for dynamic updates of the sample
* rates with gst_audio_resampler_update(). This will select an interpolating filter
* when #GST_AUDIO_RESAMPLER_FILTER_MODE_AUTO is configured.
......@@ -189,8 +192,9 @@ typedef enum {
*/
typedef enum {
GST_AUDIO_RESAMPLER_FLAG_NONE = (0),
GST_AUDIO_RESAMPLER_FLAG_NON_INTERLEAVED = (1 << 0),
GST_AUDIO_RESAMPLER_FLAG_VARIABLE_RATE = (1 << 1),
GST_AUDIO_RESAMPLER_FLAG_NON_INTERLEAVED_IN = (1 << 0),
GST_AUDIO_RESAMPLER_FLAG_NON_INTERLEAVED_OUT = (1 << 1),
GST_AUDIO_RESAMPLER_FLAG_VARIABLE_RATE = (1 << 2),
} GstAudioResamplerFlags;
#define GST_AUDIO_RESAMPLER_QUALITY_MIN 0
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment