From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id AEE1743A53 for ; Sat, 6 Aug 2022 10:35:13 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 3223968B70B; Sat, 6 Aug 2022 13:35:11 +0300 (EEST) Received: from mail.overt.org (mail.overt.org [157.230.92.47]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 0AAE868B2BC for ; Sat, 6 Aug 2022 13:35:05 +0300 (EEST) Received: from authenticated-user (mail.overt.org [157.230.92.47]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by mail.overt.org (Postfix) with ESMTPSA id 4F7EA3F54C; Fri, 5 Aug 2022 22:28:02 -0500 (CDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=overt.org; s=mail; t=1659756482; bh=tnuabNVpWtr3ILPPAbjlNkW1JfC8fmDw6jAjtJi15OQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fgFNmjj6+YTHzgX75M7AqjZ+KFvEoLoRpMM+SmYkmCf6mhEKa29bUN5EUlXmzDuGt uV/3JBayFqrt+xGY5kW4EDE6S+gm2HCTi44ApuN7otLAimRGxww+YeNnYY/se9lJ9R Svkwq9vWD8TPWYQw5/c4FzNUwbfGm8Wo2Zb+0wbXTMlxTveeohQXKFj+S+rTqjWG+S BaJq/qOlUd4hYv+OaBpaCIlnvDQR2mDQLecvBWmtef8FQan7Qlw3jkLDrlSvoAFoow PuMKG2gaT/3BQcLFBu8vddfxzzANbXVMSgbJw/eTUbHL5HhWjH8x14OCEAMi5Twz08 MwCvRg9OD4d+g== From: Philip Langdale To: ffmpeg-devel@ffmpeg.org Date: Fri, 5 Aug 2022 20:27:52 -0700 Message-Id: <20220806032754.71419-2-philipl@overt.org> In-Reply-To: <20220806032754.71419-1-philipl@overt.org> References: <20220806032754.71419-1-philipl@overt.org> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 1/2] lavc/vaapi_decode: add missing flag when picking best pixel format X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 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 Cc: Philip Langdale Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: vaapi_decode_find_best_format currently does not set the VA_SURFACE_ATTRIB_SETTABLE flag on the pixel format attribute that it returns. Without this flag, the attribute will be ignored by vaCreateSurfaces, meaning that the driver's default logic for picking a pixel format will kick in. So far, this hasn't produced visible problems, but when trying to decode 4:4:4 content, at least on Intel, the driver will pick the 444P planar format, even though the decoder can only return the AYUV packed format. The hwcontext_vaapi code that sets surface attributes when picking formats does not have this bug. Applications may use their own logic for finding the best format, and so may not hit this bug. eg: mpv is unaffected. Signed-off-by: Philip Langdale --- libavcodec/vaapi_decode.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libavcodec/vaapi_decode.c b/libavcodec/vaapi_decode.c index db48efc3ed..bc2d3ed803 100644 --- a/libavcodec/vaapi_decode.c +++ b/libavcodec/vaapi_decode.c @@ -358,6 +358,8 @@ static int vaapi_decode_find_best_format(AVCodecContext *avctx, ctx->pixel_format_attribute = (VASurfaceAttrib) { .type = VASurfaceAttribPixelFormat, + .flags = VA_SURFACE_ATTRIB_SETTABLE, + .value.type = VAGenericValueTypeInteger, .value.value.i = best_fourcc, }; -- 2.34.1 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".