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 157D843A25 for ; Fri, 5 Aug 2022 03:59:33 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 8F71268BA78; Fri, 5 Aug 2022 06:59:30 +0300 (EEST) Received: from mail.overt.org (mail.overt.org [157.230.92.47]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 2C12068B9C6 for ; Fri, 5 Aug 2022 06:59:24 +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 CC4AF3F6FD; Thu, 4 Aug 2022 22:59:22 -0500 (CDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=overt.org; s=mail; t=1659671963; bh=JFUKE1VoV6bhbqx2UYB2T0ikFn/xjHMvYMnzylB9rsQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KB5i9N6913xUuIKTP4haQSGTiHe6d+kqO1YLoICs16ukUXPHt4qXx7GwybnfSrvxk qSC6MW6vrwl/0dKcoZ6eZNvpGLFM6WQGjCoxvMpyfQocTV24YJN7BU5SFwN6TzynNK /DTfdtKr4nYlYwz0L0KnJFX8Gx2prOb/MkRQbKZvFCy/p3onvdYrbLwxhccPmOEr20 p6Bmtn1f84/Nu3LGtXT7pCvsu05YZ5VC3DM9zbb82Bc5wSS90oGmHdApr+SVikzHb0 8lIu6afkQgfGeqHLShToLDi3K8NwMuZpRnUhg9eTqdkCizz+QD90ZJGTM3F4FhUJXJ VB8dCaloIDsXA== From: Philip Langdale To: ffmpeg-devel@ffmpeg.org Date: Thu, 4 Aug 2022 20:59:03 -0700 Message-Id: <20220805035904.59799-2-philipl@overt.org> In-Reply-To: <20220805035904.59799-1-philipl@overt.org> References: <20220805035904.59799-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 | 1 + 1 file changed, 1 insertion(+) diff --git a/libavcodec/vaapi_decode.c b/libavcodec/vaapi_decode.c index db48efc3ed..38813eb8e4 100644 --- a/libavcodec/vaapi_decode.c +++ b/libavcodec/vaapi_decode.c @@ -358,6 +358,7 @@ static int vaapi_decode_find_best_format(AVCodecContext *avctx, ctx->pixel_format_attribute = (VASurfaceAttrib) { .type = VASurfaceAttribPixelFormat, + .flags = VA_SURFACE_ATTRIB_SETTABLE, .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".