]> git.sesse.net Git - ffmpeg/blobdiff - libavutil/samplefmt.h
opt/eval: Include mathematics.h for NAN/INFINITY
[ffmpeg] / libavutil / samplefmt.h
index bb5ba5924a3c9c40f2d2fb5ceafac4dca7af651d..e3aa6a9c36ac2c39275d421fb26e33d10bc01ee6 100644 (file)
@@ -170,7 +170,8 @@ int av_samples_get_buffer_size(int *linesize, int nb_channels, int nb_samples,
  * @param align            buffer size alignment (0 = default, 1 = no alignment)
  * @return                 0 on success or a negative error code on failure
  */
-int av_samples_fill_arrays(uint8_t **audio_data, int *linesize, uint8_t *buf,
+int av_samples_fill_arrays(uint8_t **audio_data, int *linesize,
+                           const uint8_t *buf,
                            int nb_channels, int nb_samples,
                            enum AVSampleFormat sample_fmt, int align);
 
@@ -193,4 +194,31 @@ int av_samples_fill_arrays(uint8_t **audio_data, int *linesize, uint8_t *buf,
 int av_samples_alloc(uint8_t **audio_data, int *linesize, int nb_channels,
                      int nb_samples, enum AVSampleFormat sample_fmt, int align);
 
+/**
+ * Copy samples from src to dst.
+ *
+ * @param dst destination array of pointers to data planes
+ * @param src source array of pointers to data planes
+ * @param dst_offset offset in samples at which the data will be written to dst
+ * @param src_offset offset in samples at which the data will be read from src
+ * @param nb_samples number of samples to be copied
+ * @param nb_channels number of audio channels
+ * @param sample_fmt audio sample format
+ */
+int av_samples_copy(uint8_t **dst, uint8_t * const *src, int dst_offset,
+                    int src_offset, int nb_samples, int nb_channels,
+                    enum AVSampleFormat sample_fmt);
+
+/**
+ * Fill an audio buffer with silence.
+ *
+ * @param audio_data  array of pointers to data planes
+ * @param offset      offset in samples at which to start filling
+ * @param nb_samples  number of samples to fill
+ * @param nb_channels number of audio channels
+ * @param sample_fmt  audio sample format
+ */
+int av_samples_set_silence(uint8_t **audio_data, int offset, int nb_samples,
+                           int nb_channels, enum AVSampleFormat sample_fmt);
+
 #endif /* AVUTIL_SAMPLEFMT_H */