aboutsummaryrefslogtreecommitdiffstats
path: root/libavresample/avresample.h
diff options
context:
space:
mode:
authorJustin Ruggles <justin.ruggles@gmail.com>2012-12-19 14:58:57 -0500
committerJustin Ruggles <justin.ruggles@gmail.com>2013-01-07 21:49:06 -0500
commit074a00d192c0e749d677b008b337da42597e780f (patch)
tree3f828927503dfef5df7eee5c974ffab75f2407be /libavresample/avresample.h
parent4d68269d58ca4f6f71b4baa30e0cf9fbde52bbc3 (diff)
downloadffmpeg-074a00d192c0e749d677b008b337da42597e780f.tar.gz
lavr: add a public function for setting a custom channel map
This allows reordering, duplication, and silencing of input channels.
Diffstat (limited to 'libavresample/avresample.h')
-rw-r--r--libavresample/avresample.h30
1 files changed, 30 insertions, 0 deletions
diff --git a/libavresample/avresample.h b/libavresample/avresample.h
index 0012787404..d26f2ca223 100644
--- a/libavresample/avresample.h
+++ b/libavresample/avresample.h
@@ -259,6 +259,36 @@ int avresample_set_matrix(AVAudioResampleContext *avr, const double *matrix,
int stride);
/**
+ * Set a customized input channel mapping.
+ *
+ * This function can only be called when the allocated context is not open.
+ * Also, the input channel layout must have already been set.
+ *
+ * Calling avresample_close() on the context will clear the channel mapping.
+ *
+ * The map for each input channel specifies the channel index in the source to
+ * use for that particular channel, or -1 to mute the channel. Source channels
+ * can be duplicated by using the same index for multiple input channels.
+ *
+ * Examples:
+ *
+ * Reordering 5.1 AAC order (C,L,R,Ls,Rs,LFE) to Libav order (L,R,C,LFE,Ls,Rs):
+ * { 1, 2, 0, 5, 3, 4 }
+ *
+ * Muting the 3rd channel in 4-channel input:
+ * { 0, 1, -1, 3 }
+ *
+ * Duplicating the left channel of stereo input:
+ * { 0, 0 }
+ *
+ * @param avr audio resample context
+ * @param channel_map customized input channel mapping
+ * @return 0 on success, negative AVERROR code on failure
+ */
+int avresample_set_channel_mapping(AVAudioResampleContext *avr,
+ const int *channel_map);
+
+/**
* Set compensation for resampling.
*
* This can be called anytime after avresample_open(). If resampling is not