mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 04:01:08 +00:00
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:
parent
33855f0fe1
commit
cf9059f070
3 changed files with 14 additions and 8 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue