]> git.sesse.net Git - ffmpeg/blobdiff - libavresample/audio_convert.h
au: validate sample rate
[ffmpeg] / libavresample / audio_convert.h
index bc2722314035f4742f85a0855ce0da31a4dd6ffd..6a3089d4fbd47b73730cca60597c8f96d8bd8be2 100644 (file)
 
 #include "libavutil/samplefmt.h"
 #include "avresample.h"
+#include "internal.h"
 #include "audio_data.h"
 
-typedef struct AudioConvert AudioConvert;
-
 /**
  * Set conversion function if the parameters match.
  *
@@ -54,16 +53,28 @@ void ff_audio_convert_set_func(AudioConvert *ac, enum AVSampleFormat out_fmt,
 /**
  * Allocate and initialize AudioConvert context for sample format conversion.
  *
- * @param avr      AVAudioResampleContext
- * @param out_fmt  output sample format
- * @param in_fmt   input sample format
- * @param channels number of channels
- * @return         newly-allocated AudioConvert context
+ * @param avr         AVAudioResampleContext
+ * @param out_fmt     output sample format
+ * @param in_fmt      input sample format
+ * @param channels    number of channels
+ * @param sample_rate sample rate (used for dithering)
+ * @param apply_map   apply channel map during conversion
+ * @return            newly-allocated AudioConvert context
  */
 AudioConvert *ff_audio_convert_alloc(AVAudioResampleContext *avr,
                                      enum AVSampleFormat out_fmt,
                                      enum AVSampleFormat in_fmt,
-                                     int channels);
+                                     int channels, int sample_rate,
+                                     int apply_map);
+
+/**
+ * Free AudioConvert.
+ *
+ * The AudioConvert must have been previously allocated with ff_audio_convert_alloc().
+ *
+ * @param ac  AudioConvert struct
+ */
+void ff_audio_convert_free(AudioConvert **ac);
 
 /**
  * Convert audio data from one sample format to another.