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 121294A766 for ; Fri, 5 Apr 2024 18:58:11 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 6DFB268CA3D; Fri, 5 Apr 2024 21:57:37 +0300 (EEST) Received: from haasn.dev (haasn.dev [78.46.187.166]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id F382468D095 for ; Fri, 5 Apr 2024 21:57:26 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=haasn.xyz; s=mail; t=1712343446; bh=i4h1F8Czw22Scr6ZNQH/gBGQ4wBb6lIZkvkQ76CeEzc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JTWyH6fUEv2+j8L/CMDdQvP4R8TEoyG7eWviC6Xx+seFRYTjCWsmQ2KGHKhqj1P8T Fs3sRly/GzXL+Q70mDI2ecqPopF6TlTFERpcS/4OMKRwqhiKi2EUsfFWe2TVuUn4eM u7C3Y4y1SSU9mVbRV5QGCi3QBwh41Adqr0RfHuuw= Received: from haasn.dev (unknown [10.30.0.2]) by haasn.dev (Postfix) with ESMTP id BB4FA42A98; Fri, 5 Apr 2024 20:57:26 +0200 (CEST) From: Niklas Haas To: ffmpeg-devel@ffmpeg.org Date: Fri, 5 Apr 2024 20:57:15 +0200 Message-ID: <20240405185721.111072-5-ffmpeg@haasn.xyz> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240405185721.111072-1-ffmpeg@haasn.xyz> References: <20240405185721.111072-1-ffmpeg@haasn.xyz> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 05/11] 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 bcbdc4981e5..ac7f01e2aa9 100644 --- a/libavcodec/libvpxenc.c +++ b/libavcodec/libvpxenc.c @@ -2086,13 +2086,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 = { @@ -2120,6 +2128,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".