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 DBBFC44393 for ; Wed, 7 Sep 2022 22:13:52 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 4536468B964; Thu, 8 Sep 2022 01:13:49 +0300 (EEST) Received: from mail-wr1-f41.google.com (mail-wr1-f41.google.com [209.85.221.41]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id A841168B630 for ; Thu, 8 Sep 2022 01:13:43 +0300 (EEST) Received: by mail-wr1-f41.google.com with SMTP id d2so5658656wrn.1 for ; Wed, 07 Sep 2022 15:13:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jkqxz-net.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date; bh=nqZMU4VwKFzUTuSxb1pEyEmC2kteYPzGeHMaSX1IDM4=; b=6LOwTFAwLzdp5RMn62F5E4qgJTMKDZGsmR8lYstIOxaBdI6AenAFMyVMJ71+N+XMRW Oxg9gopdwg5j/qafaZooFD5YiRL0mRBtjzE0lZ5aZ7kJ6b8vm1dDdRUjOe0sCE2iixiq foqsWKW1eNTpBzQCjyYC/ONzOZWJQBflMDlFdcsB23YhyWTz7mmOyNZUmn0l+u2QMfIV vWRoA51OdJyH3Nm+at1nRwHgAC9fxpVKXjlg9R9M6yPCurUduIc5mz7LKfFzoP2uTd3l pbM8ANySZwATm31PI8W+cGXL8i+SeitrYuWilt7R2pg/JOn5Ofpyp+6xYGgZyO+OU26Y U3DQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date; bh=nqZMU4VwKFzUTuSxb1pEyEmC2kteYPzGeHMaSX1IDM4=; b=VvVKUkykv2Rv2OB2EzNYI7321eKYJWghjHFJcAkw8tZJk3ixErdpT47Ic5BJtX3AgU 7SfIcA53kIQMx4W8B+Pqu99gkZAhksPYPiRrFRYUokvWQrS/m0s4X0CTIdFCf4kt3hWa 24L71wqi6UXa/E8wuyoigbvrEVtbB76sPZqGNALbul1XXl+hocEpmPOlvpQ8hWLIpdnI BqA694IYtsmGeeDwdlpoJkV/DYuhL5tWK9XY53EAwv/gFVPPa/ErkIw25aOuzrVH60Bh hOsGXoa9Xx+e47gakLn3RoUcPXphTJG1uQAzxsV0Uargxj2ESzgxfbj9IG/pepD9P5rt wtfw== X-Gm-Message-State: ACgBeo2IDJjwK31nBVCv/qU9aqmYaDidqbJPjJRAb8p/GeTlG6qHgL+V veCIe4cpEuqgdQBnJCErmWno93vVoGpjxA== X-Google-Smtp-Source: AA6agR5pVaz0zUapvDF0iCY5436KrLZBWXyChw0/oiILyk4ZNG6re2bi3kKxZLsLxIqe903FG2ePJg== X-Received: by 2002:a5d:6d88:0:b0:222:c8e2:f5fb with SMTP id l8-20020a5d6d88000000b00222c8e2f5fbmr3377697wrs.35.1662588823086; Wed, 07 Sep 2022 15:13:43 -0700 (PDT) Received: from [192.168.0.14] (cpc91224-cmbg18-2-0-cust209.5-4.cable.virginm.net. [81.106.228.210]) by smtp.gmail.com with ESMTPSA id h13-20020a05600016cd00b0022762b0e2a2sm19098278wrf.6.2022.09.07.15.13.42 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 07 Sep 2022 15:13:42 -0700 (PDT) Message-ID: <63595330-535f-43af-3489-9e2343c61d24@jkqxz.net> Date: Wed, 7 Sep 2022 23:13:15 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.1.2 Content-Language: en-US To: ffmpeg-devel@ffmpeg.org References: <20220823081929.413947-1-fei.w.wang@intel.com> <7f8cdfa93aac92c3ef889548c2540cf74033cc3b.camel@intel.com> <5f17aad9fd5084dc2f4618e22c6e2346e6347933.camel@intel.com> From: Mark Thompson In-Reply-To: <5f17aad9fd5084dc2f4618e22c6e2346e6347933.camel@intel.com> Subject: Re: [FFmpeg-devel] [PATCH v3 1/3] lavc/decode: Warp get_hw_config function 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 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: On 07/09/2022 09:47, Xiang, Haihao wrote: > On Wed, 2022-08-31 at 01:20 +0000, Wang, Fei W wrote: >> On Tue, 2022-08-23 at 16:19 +0800, Fei Wang wrote: >>> From: Linjie Fu >>> >>> Wrap the procedure of getting the hardware config from a pixel format >>> into a function. >>> >>> Signed-off-by: Linjie Fu >>> Signed-off-by: Fei Wang >>> --- >>> libavcodec/decode.c | 31 +++++++++++++++++++------------ >>> 1 file changed, 19 insertions(+), 12 deletions(-) >>> >>> diff --git a/libavcodec/decode.c b/libavcodec/decode.c >>> index 75373989c6..3b69426c09 100644 >>> --- a/libavcodec/decode.c >>> +++ b/libavcodec/decode.c >>> @@ -1156,6 +1156,24 @@ static void hwaccel_uninit(AVCodecContext >>> *avctx) >>> av_buffer_unref(&avctx->hw_frames_ctx); >>> } >>> >>> +static const AVCodecHWConfigInternal *get_hw_config(AVCodecContext >>> *avctx, enum AVPixelFormat fmt) >>> +{ >>> + const AVCodecHWConfigInternal *hw_config; >>> + >>> + if (!ffcodec(avctx->codec)->hw_configs) >>> + return NULL; >>> + >>> + for (int i = 0;; i++) { >>> + hw_config = ffcodec(avctx->codec)->hw_configs[i]; >>> + if (!hw_config) >>> + return NULL; >>> + if (hw_config->public.pix_fmt == fmt) >>> + return hw_config; >>> + } >>> + >>> + return NULL; >>> +} >>> + >>> int ff_get_format(AVCodecContext *avctx, const enum AVPixelFormat >>> *fmt) >>> { >>> const AVPixFmtDescriptor *desc; >>> @@ -1213,18 +1231,7 @@ int ff_get_format(AVCodecContext *avctx, const >>> enum AVPixelFormat *fmt) >>> break; >>> } >>> >>> - if (ffcodec(avctx->codec)->hw_configs) { >>> - for (i = 0;; i++) { >>> - hw_config = ffcodec(avctx->codec)->hw_configs[i]; >>> - if (!hw_config) >>> - break; >>> - if (hw_config->public.pix_fmt == user_choice) >>> - break; >>> - } >>> - } else { >>> - hw_config = NULL; >>> - } >>> - >>> + hw_config = get_hw_config(avctx, user_choice); >>> if (!hw_config) { >>> // No config available, so no extra setup required. >>> ret = user_choice; >> >> Ping, any more comments on V3? >> > > The patchset LGTM and works well for me, I'll apply this patchset if no more > comment. See . _______________________________________________ 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".