summaryrefslogtreecommitdiff
path: root/libavcodec/vaapi_encode_h265.c
diff options
context:
space:
mode:
authorMark Thompson <sw@jkqxz.net>2016-12-10 15:57:01 +0000
committerMark Thompson <sw@jkqxz.net>2017-01-04 21:49:41 +0000
commitd08e02d929ff8be5f56bb1da0e439bf1ae557552 (patch)
tree9c80f817accb2ecef038800dc1ab679b2a4327db /libavcodec/vaapi_encode_h265.c
parent85ad5ea72ce3983947a3b07e4b35c66cb16dfaba (diff)
vaapi_h265: Fix build failure with old libva without 10-bit surfaces
10-bit surface support was added in libva 1.6.2, earlier versions support H.265 encoding in 8-bit only.
Diffstat (limited to 'libavcodec/vaapi_encode_h265.c')
-rw-r--r--libavcodec/vaapi_encode_h265.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/libavcodec/vaapi_encode_h265.c b/libavcodec/vaapi_encode_h265.c
index ade7d4a933..e9133b4313 100644
--- a/libavcodec/vaapi_encode_h265.c
+++ b/libavcodec/vaapi_encode_h265.c
@@ -1236,9 +1236,15 @@ static av_cold int vaapi_encode_h265_init(AVCodecContext *avctx)
ctx->va_rt_format = VA_RT_FORMAT_YUV420;
break;
case FF_PROFILE_HEVC_MAIN_10:
+#ifdef VA_RT_FORMAT_YUV420_10BPP
ctx->va_profile = VAProfileHEVCMain10;
ctx->va_rt_format = VA_RT_FORMAT_YUV420_10BPP;
break;
+#else
+ av_log(avctx, AV_LOG_ERROR, "10-bit encoding is not "
+ "supported with this VAAPI version.\n");
+ return AVERROR(ENOSYS);
+#endif
default:
av_log(avctx, AV_LOG_ERROR, "Unknown H.265 profile %d.\n",
avctx->profile);