Message ID | 01ee65fc-c93d-7142-333f-aad786d3384b@jkqxz.net |
---|---|
State | Superseded |
Headers | show |
On 08/12/16 15:51, Mark Thompson wrote: > Hacky fix enclosing, only compile tested. > > A configure test for this might be better, because we could then check it sensibly in the generic code and bail out earlier? (Which would permit software decode, this will attempt hardware decode and fail.) Or maybe change the current configure test to drop support for VP9 in those versions entirely? Newer versions of libva including the field already existed when the first hardware which could do VP9 at all through this was released. - Mark
On 12/8/2016 12:55 PM, Mark Thompson wrote: > On 08/12/16 15:51, Mark Thompson wrote: >> Hacky fix enclosing, only compile tested. >> >> A configure test for this might be better, because we could then check it sensibly in the generic code and bail out earlier? (Which would permit software decode, this will attempt hardware decode and fail.) > > Or maybe change the current configure test to drop support for VP9 in those versions entirely? Newer versions of libva including the field already existed when the first hardware which could do VP9 at all through this was released. > > - Mark Definitely make the first version with that field the minimum in that case. The least amount of ifdeffery the better.
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. Thank you, Carl Eugen
diff --git a/libavcodec/vaapi_vp9.c b/libavcodec/vaapi_vp9.c index 9b3e81a..5bc413d 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 + } +#endif + vactx->slice_param_size = sizeof(VASliceParameterBufferVP9); pic_param = ff_vaapi_alloc_pic_param(vactx, sizeof(VADecPictureParameterBufferVP9));