From d63e456a2abcc8c23962f2b8828004c6a35ca1fe Mon Sep 17 00:00:00 2001 From: Stefano Sabatini Date: Tue, 2 Nov 2010 22:08:02 +0000 Subject: Implement functions: av_get_sample_fmt_name() av_get_sample_fmt() av_get_sample_fmt_string() in libavcore, and deprecate the corresponding libavcodec/audioconvert.h functions: avcodec_get_sample_fmt_name() avcodec_get_sample_fmt() avcodec_sample_fmt_string() Originally committed as revision 25653 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavcore/samplefmt.h | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'libavcore/samplefmt.h') diff --git a/libavcore/samplefmt.h b/libavcore/samplefmt.h index 163246b35f..482bb48471 100644 --- a/libavcore/samplefmt.h +++ b/libavcore/samplefmt.h @@ -32,4 +32,30 @@ enum AVSampleFormat { AV_SAMPLE_FMT_NB ///< Number of sample formats. DO NOT USE if dynamically linking to libavcore }; +/** + * Return the name of sample_fmt, or NULL if sample_fmt is not + * recognized. + */ +const char *av_get_sample_fmt_name(enum AVSampleFormat sample_fmt); + +/** + * Return a sample format corresponding to name, or AV_SAMPLE_FMT_NONE + * on error. + */ +enum AVSampleFormat av_get_sample_fmt(const char *name); + +/** + * Generate a string corresponding to the sample format with + * sample_fmt, or a header if sample_fmt is negative. + * + * @param buf the buffer where to write the string + * @param buf_size the size of buf + * @param sample_fmt the number of the sample format to print the + * corresponding info string, or a negative value to print the + * corresponding header. + * @return the pointer to the filled buffer or NULL if sample_fmt is + * unknown or in case of other errors + */ +char *av_get_sample_fmt_string(char *buf, int buf_size, enum AVSampleFormat sample_fmt); + #endif /* AVCORE_SAMPLEFMT_H */ -- cgit v1.2.3