From 4d693b023c885f6821e2347137943d751469bd0b Mon Sep 17 00:00:00 2001 From: Justin Ruggles Date: Thu, 5 Apr 2012 17:00:53 -0400 Subject: avutil: add av_get_packed_sample_fmt() and av_get_planar_sample_fmt() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Based on a patch by Clément Bœsch --- libavutil/samplefmt.h | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'libavutil/samplefmt.h') diff --git a/libavutil/samplefmt.h b/libavutil/samplefmt.h index b6715561d4..4bd5da4471 100644 --- a/libavutil/samplefmt.h +++ b/libavutil/samplefmt.h @@ -53,6 +53,28 @@ const char *av_get_sample_fmt_name(enum AVSampleFormat sample_fmt); */ enum AVSampleFormat av_get_sample_fmt(const char *name); +/** + * 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. -- cgit v1.2.3