mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-12-08 06:09:50 +00:00
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:
parent
cdc9ce098e
commit
2c6811397b
15 changed files with 219 additions and 90 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue