diff options
author | Justin Ruggles <justin.ruggles@gmail.com> | 2012-01-19 18:36:40 -0500 |
---|---|---|
committer | Justin Ruggles <justin.ruggles@gmail.com> | 2012-03-05 13:08:15 -0500 |
commit | 6699d07480f58bc20068b2d90fcd6ca8e3aa46b8 (patch) | |
tree | d31c35afadc3b04f3f81518ac54211de28f1d5aa /libavcodec/avcodec.h | |
parent | 27c7ca9c12bb42d5c44d46f24cd970469d0ef55a (diff) | |
download | ffmpeg-6699d07480f58bc20068b2d90fcd6ca8e3aa46b8.tar.gz |
avcodec: add av_get_exact_bits_per_sample() function
This only returns bits per sample when it is exactly correct. That is, the
codec contains only raw samples with no frame headers or padding. This applies
to basically all PCM codecs and a small subset of ADPCM codecs.
Diffstat (limited to 'libavcodec/avcodec.h')
-rw-r--r-- | libavcodec/avcodec.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h index a99dcbd553..bdd72f7d5c 100644 --- a/libavcodec/avcodec.h +++ b/libavcodec/avcodec.h @@ -3932,6 +3932,16 @@ void avcodec_default_free_buffers(AVCodecContext *s); */ int av_get_bits_per_sample(enum CodecID codec_id); +/** + * Return codec bits per sample. + * Only return non-zero if the bits per sample is exactly correct, not an + * approximation. + * + * @param[in] codec_id the codec + * @return Number of bits per sample or zero if unknown for the given codec. + */ +int av_get_exact_bits_per_sample(enum CodecID codec_id); + /* frame parsing */ typedef struct AVCodecParserContext { void *priv_data; |