summaryrefslogtreecommitdiff
path: root/libavresample/audio_mix.h
diff options
context:
space:
mode:
authorJustin Ruggles <justin.ruggles@gmail.com>2012-11-29 14:53:04 -0500
committerJustin Ruggles <justin.ruggles@gmail.com>2012-12-11 14:00:32 -0500
commit14758e3211d34a97c42b07acae117ce5627d7f57 (patch)
tree9f502994fb29743424c2789727b468ca7055c0dc /libavresample/audio_mix.h
parent887d4c05c9126d3598d72a19417296253d59752d (diff)
downloadffmpeg-14758e3211d34a97c42b07acae117ce5627d7f57.tar.gz
lavr: temporarily store custom matrix in AVAudioResampleContext
This allows AudioMix to be treated the same way as other conversion contexts and removes the requirement to allocate it at the same time as the AVAudioResampleContext. The current matrix get/set functions are split between the public interface and AudioMix private functions.
Diffstat (limited to 'libavresample/audio_mix.h')
-rw-r--r--libavresample/audio_mix.h24
1 files changed, 16 insertions, 8 deletions
diff --git a/libavresample/audio_mix.h b/libavresample/audio_mix.h
index 2199fffe0e..22faea7c1b 100644
--- a/libavresample/audio_mix.h
+++ b/libavresample/audio_mix.h
@@ -79,28 +79,36 @@ void ff_audio_mix_set_func(AudioMix *am, enum AVSampleFormat fmt,
const char *descr, void *mix_func);
/**
- * Initialize the AudioMix context in the AVAudioResampleContext.
+ * Allocate and initialize an AudioMix context.
*
* The parameters in the AVAudioResampleContext are used to initialize the
- * AudioMix context and set the mixing matrix.
+ * AudioMix context.
*
* @param avr AVAudioResampleContext
- * @return 0 on success, negative AVERROR code on failure
+ * @return newly-allocated AudioMix context.
*/
-int ff_audio_mix_init(AVAudioResampleContext *avr);
+AudioMix *ff_audio_mix_alloc(AVAudioResampleContext *avr);
/**
- * Close an AudioMix context.
- *
- * This clears and frees the mixing matrix arrays.
+ * Free an AudioMix context.
*/
-void ff_audio_mix_close(AudioMix *am);
+void ff_audio_mix_free(AudioMix **am);
/**
* Apply channel mixing to audio data using the current mixing matrix.
*/
int ff_audio_mix(AudioMix *am, AudioData *src);
+/**
+ * Get the current mixing matrix.
+ */
+int ff_audio_mix_get_matrix(AudioMix *am, double *matrix, int stride);
+
+/**
+ * Set the current mixing matrix.
+ */
+int ff_audio_mix_set_matrix(AudioMix *am, const double *matrix, int stride);
+
/* arch-specific initialization functions */
void ff_audio_mix_init_x86(AudioMix *am);