summaryrefslogtreecommitdiff
path: root/libavutil/samplefmt.h
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-04-09 22:48:20 +0200
committerMichael Niedermayer <michaelni@gmx.at>2012-04-09 23:02:33 +0200
commit6bfb3042b3158f0a87629ab0c126cccb269c3d5a (patch)
tree08699d0bcef99f30b084db2980759af901f8af91 /libavutil/samplefmt.h
parent7f66912f1a303a369f6ac435d630971d74310a81 (diff)
parent679a973e9701576b1c3c6d71838c45c10ac20564 (diff)
Merge remote-tracking branch 'qatar/master'
* qatar/master: avconv: use default alignment for audio buffer avcodec: use align == 0 for default alignment in avcodec_fill_audio_frame() avutil: use align == 0 for default alignment in audio sample buffer functions avutil: allow NULL linesize in av_samples_fill_arrays() and av_samples_alloc() avconv: remove OutputStream.picref. avconv: only set SAR once on the decoded frame. avcodec: validate the channel layout vs. channel count for decoders audioconvert: make av_get_channel_layout accept composite names. avutil: add av_get_packed_sample_fmt() and av_get_planar_sample_fmt() Conflicts: doc/APIchanges ffmpeg.c libavcodec/utils.c libavcodec/version.h libavutil/audioconvert.c libavutil/audioconvert.h libavutil/avutil.h libavutil/samplefmt.c libavutil/samplefmt.h Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavutil/samplefmt.h')
-rw-r--r--libavutil/samplefmt.h31
1 files changed, 27 insertions, 4 deletions
diff --git a/libavutil/samplefmt.h b/libavutil/samplefmt.h
index 855cffd838..af015d0cc3 100644
--- a/libavutil/samplefmt.h
+++ b/libavutil/samplefmt.h
@@ -62,6 +62,28 @@ enum AVSampleFormat av_get_sample_fmt(const char *name);
enum AVSampleFormat av_get_alt_sample_fmt(enum AVSampleFormat sample_fmt, int planar);
/**
+ * Get the packed alternative form of the given sample format.
+ *
+ * If the passed sample_fmt is already in packed format, the format returned is
+ * the same as the input.
+ *
+ * @return the packed alternative form of the given sample format or
+ AV_SAMPLE_FMT_NONE on error.
+ */
+enum AVSampleFormat av_get_packed_sample_fmt(enum AVSampleFormat sample_fmt);
+
+/**
+ * Get the planar alternative form of the given sample format.
+ *
+ * If the passed sample_fmt is already in planar format, the format returned is
+ * the same as the input.
+ *
+ * @return the planar alternative form of the given sample format or
+ AV_SAMPLE_FMT_NONE on error.
+ */
+enum AVSampleFormat av_get_planar_sample_fmt(enum AVSampleFormat sample_fmt);
+
+/**
* Generate a string corresponding to the sample format with
* sample_fmt, or a header if sample_fmt is negative.
*
@@ -107,6 +129,7 @@ int av_sample_fmt_is_planar(enum AVSampleFormat sample_fmt);
* @param nb_channels the number of channels
* @param nb_samples the number of samples in a single channel
* @param sample_fmt the sample format
+ * @param align buffer size alignment (0 = default, 1 = no alignment)
* @return required buffer size, or negative error code on failure
*/
int av_samples_get_buffer_size(int *linesize, int nb_channels, int nb_samples,
@@ -125,12 +148,12 @@ int av_samples_get_buffer_size(int *linesize, int nb_channels, int nb_samples,
* for packed layout.
*
* @param[out] audio_data array to be filled with the pointer for each channel
- * @param[out] linesize calculated linesize
+ * @param[out] linesize calculated linesize, may be NULL
* @param buf the pointer to a buffer containing the samples
* @param nb_channels the number of channels
* @param nb_samples the number of samples in a single channel
* @param sample_fmt the sample format
- * @param align buffer size alignment (1 = no alignment required)
+ * @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,
@@ -143,10 +166,10 @@ int av_samples_fill_arrays(uint8_t **audio_data, int *linesize, uint8_t *buf,
* The allocated samples buffer can be freed by using av_freep(&audio_data[0])
*
* @param[out] audio_data array to be filled with the pointer for each channel
- * @param[out] linesize aligned size for audio buffer(s)
+ * @param[out] linesize aligned size for audio buffer(s), may be NULL
* @param nb_channels number of audio channels
* @param nb_samples number of samples per channel
- * @param align buffer size alignment (1 = no alignment required)
+ * @param align buffer size alignment (0 = default, 1 = no alignment)
* @return 0 on success or a negative error code on failure
* @see av_samples_fill_arrays()
*/