]> git.sesse.net Git - ffmpeg/blobdiff - libswresample/swresample.h
swr: make SwrContext a typedef.
[ffmpeg] / libswresample / swresample.h
index 8dc4e1f348a2d6e820cfb23624ecf0cf48ac69bb..64b9aacd259ff6132678636195be8cf069dd52ab 100644 (file)
 #include "libavutil/samplefmt.h"
 
 #define LIBSWRESAMPLE_VERSION_MAJOR 0
-#define LIBSWRESAMPLE_VERSION_MINOR 6
+#define LIBSWRESAMPLE_VERSION_MINOR 9
 #define LIBSWRESAMPLE_VERSION_MICRO 100
 
 #define LIBSWRESAMPLE_VERSION_INT  AV_VERSION_INT(LIBSWRESAMPLE_VERSION_MAJOR, \
                                                   LIBSWRESAMPLE_VERSION_MINOR, \
                                                   LIBSWRESAMPLE_VERSION_MICRO)
 
-#define SWR_CH_MAX 16   ///< Maximum number of channels
+#define SWR_CH_MAX 32   ///< Maximum number of channels
 
 #define SWR_FLAG_RESAMPLE 1 ///< Force resampling even if equal sample rate
 //TODO use int resample ?
 //long term TODO can we enable this dynamically?
 
 
-struct SwrContext;
+typedef struct SwrContext SwrContext;
 
 /**
  * Allocate SwrContext.
@@ -106,7 +106,7 @@ void swr_free(struct SwrContext **s);
  * @param in        input buffers, only the first one need to be set in case of packed audio
  * @param in_count  number of input samples available in one channel
  *
- * @return number of samples output per channel
+ * @return number of samples output per channel, negative value on error
  */
 int swr_convert(struct SwrContext *s, uint8_t *out[SWR_CH_MAX], int out_count,
                                 const uint8_t *in [SWR_CH_MAX], int in_count);
@@ -126,6 +126,17 @@ int swr_set_compensation(struct SwrContext *s, int sample_delta, int compensatio
  */
 int swr_set_channel_mapping(struct SwrContext *s, const int *channel_map);
 
+/**
+ * Set a customized remix matrix.
+ *
+ * @param s       allocated Swr context, not yet initialized
+ * @param matrix  remix coefficients; matrix[i + stride * o] is
+ *                the weight of input channel i in output channel o
+ * @param stride  offset between lines of the matrix
+ * @return  AVERROR error code in case of failure.
+ */
+int swr_set_matrix(struct SwrContext *s, const double *matrix, int stride);
+
 /**
  * Return the LIBSWRESAMPLE_VERSION_INT constant.
  */