From patchwork Thu Dec 8 15:51:38 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Thompson X-Patchwork-Id: 1716 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.65.86 with SMTP id o83csp941851vsa; Thu, 8 Dec 2016 07:51:51 -0800 (PST) X-Received: by 10.28.161.67 with SMTP id k64mr2883133wme.69.1481212310258; Thu, 08 Dec 2016 07:51:50 -0800 (PST) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id 4si13804534wmf.7.2016.12.08.07.51.49; Thu, 08 Dec 2016 07:51:50 -0800 (PST) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@jkqxz-net.20150623.gappssmtp.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 7EFE568A19E; Thu, 8 Dec 2016 17:51:44 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wj0-f182.google.com (mail-wj0-f182.google.com [209.85.210.182]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 9823C68A0BB for ; Thu, 8 Dec 2016 17:51:37 +0200 (EET) Received: by mail-wj0-f182.google.com with SMTP id tk12so96775487wjb.3 for ; Thu, 08 Dec 2016 07:51:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jkqxz-net.20150623.gappssmtp.com; s=20150623; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding; bh=u2atVRhexiQ0aSyqyPkpP5SdNcMzKQ2FGSH+jdrflI4=; b=NesEnkisPjS7DXOyXZ3+r5LAah/UQIYNeSoZZN7GMLGqpOLVxLtiRz1hhjBSpNyswy 2tH1ObxUFdTJv0UTS1ozA+4zJFm8tNsFCagjGB6cCqkc7ZctQgG0S/ctfKl7n1NTzh0A YMSuwwBQ5aMri5teap2Qr+I0uPHxybl6UIHIcZniQbonetqknHL3EXn2A4GE032HOSsq we8yie2N331yU6KIF98/mv6jeVBJmqeAdsfd//ng1RS0HSY3RKRA6FEQ0bFZpNZcACju 09RWSBWLXtjHaD8Li0rTanccHQWGQ8qEisARLrjtZTXXUQIT+hsG2Kx0O6Q/Qlm72PBk j31g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=u2atVRhexiQ0aSyqyPkpP5SdNcMzKQ2FGSH+jdrflI4=; b=myvCCNzXSjLDce2NRj+M9AhZhYlU4a4NzcL2vPFV9zzrTzxri12LC0m9UvjGmOzfw4 JB66SlYkCPGFtYIgk8eak2pqCzSxHqTScJ67olkH8SlN3DrXbyvMfo6nPZLKbKvjr4Ww RcF1kYN6IZf8t6ys15IHgF90oIvJo8voQL97sR1vzkbL0mLGqqxFuMMOpdUgD1Tz02dM RN6GC0o9GpfR9A5Oo8fUxLNedn+x/BwPVOdx20cSFI1DCQaGJDvSk7Hfs6nEXFjNWMf/ 3IorWo6RPFaCpYDlV9Tn8ekMTfjVIMC4h1JQg33f43nCvwSTkL5lotfmKqYVokZwUMjB S8RQ== X-Gm-Message-State: AKaTC02U1Bzf+6XpD8tBybmOArBauxQmjxxvqo7iJsUtBYQ+y2wT2Sn2Xh+/rJZoKpvntg== X-Received: by 10.194.94.166 with SMTP id dd6mr73146681wjb.88.1481212300087; Thu, 08 Dec 2016 07:51:40 -0800 (PST) Received: from [10.0.0.193] ([213.210.30.6]) by smtp.gmail.com with ESMTPSA id u18sm15968262wmd.1.2016.12.08.07.51.39 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 08 Dec 2016 07:51:39 -0800 (PST) To: FFmpeg development discussions and patches References: <20161205203259.2479-1-matmaul@gmail.com> <20161205203259.2479-2-matmaul@gmail.com> From: Mark Thompson Message-ID: <01ee65fc-c93d-7142-333f-aad786d3384b@jkqxz.net> Date: Thu, 8 Dec 2016 15:51:38 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Icedove/45.4.0 MIME-Version: 1.0 In-Reply-To: Subject: [FFmpeg-devel] [PATCH] vaapi_vp9: Do not set bit_depth on old versions X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Fixes ticket #6003. --- On 08/12/16 15:16, Carl Eugen Hoyos wrote: > 2016-12-05 21:32 GMT+01:00 Mathieu Velten : >> --- >> libavcodec/vaapi_vp9.c | 1 + >> libavcodec/vp9.c | 10 +++++++++- >> 2 files changed, 10 insertions(+), 1 deletion(-) > > (This is missing a review here but I guess it's just me > who can't work with gmail.) > > 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. 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.) libavcodec/vaapi_vp9.c | 11 +++++++++++ 1 file changed, 11 insertions(+) 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));