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.
This commit is contained in:
Anton Khirnov
2014-12-31 07:57:59 +01:00
parent cdc9ce098e
commit 2c6811397b
15 changed files with 219 additions and 90 deletions

View File

@@ -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;