Commit 189ad6c9 authored by conrad's avatar conrad

Add av_get_bits_per_sample_format()

git-svn-id: file:///var/local/repositories/ffmpeg/trunk@10099 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 56205e1f
...@@ -33,8 +33,8 @@ ...@@ -33,8 +33,8 @@
#define AV_STRINGIFY(s) AV_TOSTRING(s) #define AV_STRINGIFY(s) AV_TOSTRING(s)
#define AV_TOSTRING(s) #s #define AV_TOSTRING(s) #s
#define LIBAVCODEC_VERSION_INT ((51<<16)+(40<<8)+4) #define LIBAVCODEC_VERSION_INT ((51<<16)+(41<<8)+0)
#define LIBAVCODEC_VERSION 51.40.4 #define LIBAVCODEC_VERSION 51.41.0
#define LIBAVCODEC_BUILD LIBAVCODEC_VERSION_INT #define LIBAVCODEC_BUILD LIBAVCODEC_VERSION_INT
#define LIBAVCODEC_IDENT "Lavc" AV_STRINGIFY(LIBAVCODEC_VERSION) #define LIBAVCODEC_IDENT "Lavc" AV_STRINGIFY(LIBAVCODEC_VERSION)
...@@ -2706,6 +2706,14 @@ char av_get_pict_type_char(int pict_type); ...@@ -2706,6 +2706,14 @@ char av_get_pict_type_char(int pict_type);
*/ */
int av_get_bits_per_sample(enum CodecID codec_id); int av_get_bits_per_sample(enum CodecID codec_id);
/**
* Returns sample format bits per sample.
*
* @param[in] sample_fmt the sample format
* @return Number of bits per sample or zero if unknown for the given sample format.
*/
int av_get_bits_per_sample_format(enum SampleFormat sample_fmt);
/* frame parsing */ /* frame parsing */
typedef struct AVCodecParserContext { typedef struct AVCodecParserContext {
void *priv_data; void *priv_data;
......
...@@ -1322,6 +1322,22 @@ int av_get_bits_per_sample(enum CodecID codec_id){ ...@@ -1322,6 +1322,22 @@ int av_get_bits_per_sample(enum CodecID codec_id){
} }
} }
int av_get_bits_per_sample_format(enum SampleFormat sample_fmt) {
switch (sample_fmt) {
case SAMPLE_FMT_U8:
return 8;
case SAMPLE_FMT_S16:
return 16;
case SAMPLE_FMT_S24:
return 24;
case SAMPLE_FMT_S32:
case SAMPLE_FMT_FLT:
return 32;
default:
return 0;
}
}
#if !defined(HAVE_THREADS) #if !defined(HAVE_THREADS)
int avcodec_thread_init(AVCodecContext *s, int thread_count){ int avcodec_thread_init(AVCodecContext *s, int thread_count){
return -1; return -1;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment