audio-resampler: improve non-interleaved flags

Make it possible to have different interleaving on input and output
because we can quite trivially do that.
This commit is contained in:
Wim Taymans 2016-03-04 17:15:44 +01:00
parent 33855f0fe1
commit cf9059f070
3 changed files with 14 additions and 8 deletions

View file

@ -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;

View file

@ -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;

View file

@ -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