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 BB57B49CB1 for ; Mon, 8 Apr 2024 13:02:16 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 55C5A68D2EE; Mon, 8 Apr 2024 16:00:12 +0300 (EEST) Received: from haasn.dev (haasn.dev [78.46.187.166]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 1661368D247 for ; Mon, 8 Apr 2024 15:59:58 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=haasn.xyz; s=mail; t=1712581193; bh=YmrcSJ9TBoaegN+fuf3PImnGxSe6Tt7FLC7fpkMBQ3Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iidgHqObL05VgPJDUhvG6F7Kt5Ci1nSCMNTQPk53i0Atm/HHTtunfghfcn68Pb0Ub 76lpM8VpxSpaLKC3YTuozxnUX87bIvOI7QrUN9T97EPF7f1eSkKFOGXhFEcT9DFQyI pvu+Ol0qfwMhHzOmzF76XLc5XDCPZ+PDq+l6W6b8= Received: from haasn.dev (unknown [10.30.0.2]) by haasn.dev (Postfix) with ESMTP id BBA4543961; Mon, 8 Apr 2024 14:59:53 +0200 (CEST) From: Niklas Haas To: ffmpeg-devel@ffmpeg.org Date: Mon, 8 Apr 2024 14:57:10 +0200 Message-ID: <20240408125950.53472-7-ffmpeg@haasn.xyz> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240408125950.53472-1-ffmpeg@haasn.xyz> References: <20240408125950.53472-1-ffmpeg@haasn.xyz> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v2 06/17] avcodec/libvpxenc: switch to get_supported_config() 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: Niklas Haas 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: From: Niklas Haas --- libavcodec/libvpxenc.c | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/libavcodec/libvpxenc.c b/libavcodec/libvpxenc.c index cdb83312614..64dc69f8547 100644 --- a/libavcodec/libvpxenc.c +++ b/libavcodec/libvpxenc.c @@ -2087,13 +2087,21 @@ static const enum AVPixelFormat vp9_pix_fmts_highbd[] = { AV_PIX_FMT_NONE }; -static av_cold void vp9_init_static(FFCodec *codec) +static int vp9_get_supported_config(const AVCodecContext *avctx, + const AVCodec *codec, + enum AVCodecConfig config, + unsigned flags, const void **out) { - vpx_codec_caps_t codec_caps = vpx_codec_get_caps(vpx_codec_vp9_cx()); - if (codec_caps & VPX_CODEC_CAP_HIGHBITDEPTH) - codec->p.pix_fmts = vp9_pix_fmts_highbd; - else - codec->p.pix_fmts = vp9_pix_fmts_highcol; + if (config == AV_CODEC_CONFIG_PIX_FORMAT) { + vpx_codec_caps_t codec_caps = vpx_codec_get_caps(vpx_codec_vp9_cx()); + if (codec_caps & VPX_CODEC_CAP_HIGHBITDEPTH) + *out = vp9_pix_fmts_highbd; + else + *out = vp9_pix_fmts_highcol; + return 0; + } + + return ff_default_get_supported_config(avctx, codec, config, flags, out); } static const AVClass class_vp9 = { @@ -2122,6 +2130,6 @@ FFCodec ff_libvpx_vp9_encoder = { .caps_internal = FF_CODEC_CAP_NOT_INIT_THREADSAFE | FF_CODEC_CAP_AUTO_THREADS, .defaults = defaults, - .init_static_data = vp9_init_static, + .get_supported_config = vp9_get_supported_config, }; #endif /* CONFIG_LIBVPX_VP9_ENCODER */ -- 2.44.0 _______________________________________________ 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".