[FFmpeg-devel] [PATCH] vaapi_vp9: Do not set bit_depth on old versions

Mark Thompson sw at jkqxz.net
Sat Dec 10 14:50:20 EET 2016


Fixes ticket #6003.
---
On 10/12/16 12:09, Carl Eugen Hoyos wrote:
> 2016-12-08 16:51 GMT+01:00 Mark Thompson <sw at jkqxz.net>:
>> Fixes ticket #6003.
> 
>>> May I suggest to revert this?
>>>
>>>> +    pp->bit_depth = h->h.bpp;
>>>
>>> Google doesn't easily find a version of va_dec_vp9.h
>>> with _VADecPictureParameterBufferVP9->bit_depth.
>>
>> Urgh: libva 1.6.0 to 1.6.2 don't have this field.
>>
>> Hacky fix enclosing, only compile tested.
> 
> As long as you work on a "better" fix, please either
> apply or revert the original patch, build regressions
> are not acceptable.

Please review the two suggested fixes and hopefully express approval for one or other of them - a fixed and tested version of the first is in this mail, the second can be found in <https://lists.ffmpeg.org/pipermail/ffmpeg-devel/2016-December/204050.html>.

Thanks,

- Mark


 libavcodec/vaapi_vp9.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/libavcodec/vaapi_vp9.c b/libavcodec/vaapi_vp9.c
index 9b3e81a..a355a99 100644
--- a/libavcodec/vaapi_vp9.c
+++ b/libavcodec/vaapi_vp9.c
@@ -38,7 +38,10 @@ static void fill_picture_parameters(AVCodecContext                 *avctx,
     pp->first_partition_size = h->h.compressed_header_size;
 
     pp->profile = h->h.profile;
+
+#if VA_CHECK_VERSION(0, 39, 0)
     pp->bit_depth = h->h.bpp;
+#endif
 
     pp->filter_level = h->h.filter.level;
     pp->sharpness_level = h->h.filter.sharpness;
@@ -97,6 +100,14 @@ static int vaapi_vp9_start_frame(AVCodecContext          *avctx,
     FFVAContext * const vactx = ff_vaapi_get_context(avctx);
     VADecPictureParameterBufferVP9 *pic_param;
 
+#if !VA_CHECK_VERSION(0, 39, 0)
+    if (h->h.profile >= 2) {
+        av_log(avctx, AV_LOG_ERROR, "VP9 profile %d is not supported "
+               "with this libva version.\n", h->h.profile);
+        return AVERROR(ENOSYS);
+    }
+#endif
+
     vactx->slice_param_size = sizeof(VASliceParameterBufferVP9);
 
     pic_param = ff_vaapi_alloc_pic_param(vactx, sizeof(VADecPictureParameterBufferVP9));
-- 
2.10.2


More information about the ffmpeg-devel mailing list