diff mbox

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

Message ID 6911c4ec-bce5-0f4a-653d-a2997e4dfaaf@jkqxz.net
State New
Headers show

Commit Message

Mark Thompson Dec. 10, 2016, 12:50 p.m. UTC
Fixes ticket #6003.
---
On 10/12/16 12:09, Carl Eugen Hoyos wrote:
> 2016-12-08 16:51 GMT+01:00 Mark Thompson <sw@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(+)

Comments

Carl Eugen Hoyos Dec. 10, 2016, 12:52 p.m. UTC | #1
2016-12-10 13:50 GMT+01:00 Mark Thompson <sw@jkqxz.net>:
> Fixes ticket #6003.
> ---
> On 10/12/16 12:09, Carl Eugen Hoyos wrote:
>> 2016-12-08 16:51 GMT+01:00 Mark Thompson <sw@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

No, no, no  - I mean: Not necessarily.

This is a build issue in a file that you maintain, you fix it
the way you like.

Carl Eugen
Mark Thompson Dec. 10, 2016, 1:57 p.m. UTC | #2
On 10/12/16 12:52, Carl Eugen Hoyos wrote:
> 2016-12-10 13:50 GMT+01:00 Mark Thompson <sw@jkqxz.net>:
>> Fixes ticket #6003.
>> ---
>> On 10/12/16 12:09, Carl Eugen Hoyos wrote:
>>> 2016-12-08 16:51 GMT+01:00 Mark Thompson <sw@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
> 
> No, no, no  - I mean: Not necessarily.
> 
> This is a build issue in a file that you maintain, you fix it
> the way you like.

I've applied the second patch and closed the ticket.

Thanks,

- Mark
Carl Eugen Hoyos Dec. 10, 2016, 1:59 p.m. UTC | #3
2016-12-10 14:57 GMT+01:00 Mark Thompson <sw@jkqxz.net>:
> I've applied the second patch and closed the ticket.

Thank you, Carl Eugen
diff mbox

Patch

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));