diff options
author | Anton Khirnov <anton@khirnov.net> | 2014-12-31 07:57:59 +0100 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2015-12-12 21:22:49 +0100 |
commit | 2c6811397bdf13d43ca206e48d6d6da9c2cd47c6 (patch) | |
tree | 75909934dcab62130bd60a14e9369ef6b78278a1 /libavcodec/utils.c | |
parent | cdc9ce098e8d101b43b8f68dd35ba7226f4a728c (diff) | |
download | ffmpeg-streaming-2c6811397bdf13d43ca206e48d6d6da9c2cd47c6.zip ffmpeg-streaming-2c6811397bdf13d43ca206e48d6d6da9c2cd47c6.tar.gz |
lavc: add profiles to AVCodecDescriptor
The profiles are a property of the codec, so it makes sense to export
them through AVCodecDescriptors, not just the codec implementations.
Diffstat (limited to 'libavcodec/utils.c')
-rw-r--r-- | libavcodec/utils.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/libavcodec/utils.c b/libavcodec/utils.c index af2835e..78ce0dc 100644 --- a/libavcodec/utils.c +++ b/libavcodec/utils.c @@ -1918,6 +1918,21 @@ const char *av_get_profile_name(const AVCodec *codec, int profile) return NULL; } +const char *avcodec_profile_name(enum AVCodecID codec_id, int profile) +{ + const AVCodecDescriptor *desc = avcodec_descriptor_get(codec_id); + const AVProfile *p; + + if (profile == FF_PROFILE_UNKNOWN || !desc || !desc->profiles) + return NULL; + + for (p = desc->profiles; p->profile != FF_PROFILE_UNKNOWN; p++) + if (p->profile == profile) + return p->name; + + return NULL; +} + unsigned avcodec_version(void) { return LIBAVCODEC_VERSION_INT; |