diff options
Diffstat (limited to 'libavutil/samplefmt.h')
-rw-r--r-- | libavutil/samplefmt.h | 30 |
1 files changed, 21 insertions, 9 deletions
diff --git a/libavutil/samplefmt.h b/libavutil/samplefmt.h index 0641c56..17300d1 100644 --- a/libavutil/samplefmt.h +++ b/libavutil/samplefmt.h @@ -1,18 +1,18 @@ /* - * This file is part of Libav. + * This file is part of FFmpeg. * - * Libav is free software; you can redistribute it and/or + * FFmpeg is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * - * Libav is distributed in the hope that it will be useful, + * FFmpeg is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with Libav; if not, write to the Free Software + * License along with FFmpeg; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ @@ -76,6 +76,14 @@ const char *av_get_sample_fmt_name(enum AVSampleFormat sample_fmt); enum AVSampleFormat av_get_sample_fmt(const char *name); /** + * Return the planar<->packed alternative form of the given sample format, or + * AV_SAMPLE_FMT_NONE on error. If the passed sample_fmt is already in the + * requested planar/packed format, the format returned is the same as the + * input. + */ +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 @@ -150,16 +158,20 @@ int av_samples_get_buffer_size(int *linesize, int nb_channels, int nb_samples, enum AVSampleFormat sample_fmt, int align); /** - * Fill channel data pointers and linesize for samples with sample + * Fill plane data pointers and linesize for samples with sample * format sample_fmt. * - * The pointers array is filled with the pointers to the samples data: + * The audio_data array is filled with the pointers to the samples data planes: * for planar, set the start point of each channel's data within the buffer, * for packed, set the start point of the entire buffer only. * - * The linesize array is filled with the aligned size of each channel's data - * buffer for planar layout, or the aligned size of the buffer for all channels - * for packed layout. + * The value pointed to by linesize is set to the aligned size of each + * channel's data buffer for planar layout, or to the aligned size of the + * buffer for all channels for packed layout. + * + * The buffer in buf must be big enough to contain all the samples + * (use av_samples_get_buffer_size() to compute its minimum size), + * otherwise the audio_data pointers will point to invalid data. * * @see enum AVSampleFormat * The documentation for AVSampleFormat describes the data layout. |