summaryrefslogtreecommitdiff
path: root/libavcodec/libx264.c
diff options
context:
space:
mode:
authorLyubomir Marinov <lyubomir.marinov@jitsi.org>2012-09-16 22:53:49 +0300
committerMichael Niedermayer <michaelni@gmx.at>2012-09-17 21:31:57 +0200
commit63951aec2b9d0f92f55c4229b9151d99026b82b6 (patch)
tree9dd828e50754f8ef7f7f20aa12074c08e7ddd4ca /libavcodec/libx264.c
parentfd9cd8cd5ab6042731fa0fab3a5158e35dce773a (diff)
libx264: feed x264_param_apply_profile from AVCodecContext.profile in absence of other information
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/libx264.c')
-rw-r--r--libavcodec/libx264.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/libavcodec/libx264.c b/libavcodec/libx264.c
index 4435a2abb1..39a7d7db8e 100644
--- a/libavcodec/libx264.c
+++ b/libavcodec/libx264.c
@@ -457,6 +457,30 @@ static av_cold int X264_init(AVCodecContext *avctx)
if (x4->fastfirstpass)
x264_param_apply_fastfirstpass(&x4->params);
+ /* Allow specifying the x264 profile through AVCodecContext. */
+ if (!x4->profile)
+ switch (avctx->profile) {
+ case FF_PROFILE_H264_BASELINE:
+ x4->profile = av_strdup("baseline");
+ break;
+ case FF_PROFILE_H264_HIGH:
+ x4->profile = av_strdup("high");
+ break;
+ case FF_PROFILE_H264_HIGH_10:
+ x4->profile = av_strdup("high10");
+ break;
+ case FF_PROFILE_H264_HIGH_422:
+ x4->profile = av_strdup("high422");
+ break;
+ case FF_PROFILE_H264_HIGH_444:
+ x4->profile = av_strdup("high444");
+ break;
+ case FF_PROFILE_H264_MAIN:
+ x4->profile = av_strdup("main");
+ break;
+ default:
+ break;
+ }
if (x4->profile)
if (x264_param_apply_profile(&x4->params, x4->profile) < 0) {
int i;