aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/utils.c
diff options
context:
space:
mode:
authorAnssi Hannula <anssi.hannula@iki.fi>2011-01-07 22:27:26 +0000
committerCarl Eugen Hoyos <cehoyos@rainbow.studorg.tuwien.ac.at>2011-01-07 22:27:26 +0000
commit060ec0a8294d912f694cf48546f1543805f83a48 (patch)
tree99ce4f4ec8cd7f90b6d6f557b49727af957c1225 /libavcodec/utils.c
parentf2953365d1c1da8c1e586270c6eb2c7437c77a9f (diff)
downloadffmpeg-060ec0a8294d912f694cf48546f1543805f83a48.tar.gz
Add av_get_profile_name() to get profile names.
Patch by Anssi Hannula, anssi d hannula a iki d fi Originally committed as revision 26259 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/utils.c')
-rw-r--r--libavcodec/utils.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index ce7473587e..c11e4f56d3 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -966,6 +966,19 @@ void avcodec_string(char *buf, int buf_size, AVCodecContext *enc, int encode)
}
}
+const char *av_get_profile_name(const AVCodec *codec, int profile)
+{
+ const AVProfile *p;
+ if (profile == FF_PROFILE_UNKNOWN || !codec->profiles)
+ return NULL;
+
+ for (p = codec->profiles; p->profile != FF_PROFILE_UNKNOWN; p++)
+ if (p->profile == profile)
+ return p->name;
+
+ return NULL;
+}
+
unsigned avcodec_version( void )
{
return LIBAVCODEC_VERSION_INT;