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 1018F46195 for ; Sat, 8 Jul 2023 19:25:38 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id EE59268C2BF; Sat, 8 Jul 2023 22:25:35 +0300 (EEST) Received: from mout-p-102.mailbox.org (mout-p-102.mailbox.org [80.241.56.152]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 6A26968C205 for ; Sat, 8 Jul 2023 22:25:30 +0300 (EEST) Received: from smtp102.mailbox.org (smtp102.mailbox.org [10.196.197.102]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-102.mailbox.org (Postfix) with ESMTPS id 4Qz0bW4dLVz9scH for ; Sat, 8 Jul 2023 21:25:27 +0200 (CEST) Message-ID: Date: Sun, 9 Jul 2023 00:55:14 +0530 MIME-Version: 1.0 Content-Language: en-US To: ffmpeg-devel@ffmpeg.org References: <20230708184502.66917-1-leo.izen@gmail.com> From: Gyan Doshi In-Reply-To: <20230708184502.66917-1-leo.izen@gmail.com> Subject: Re: [FFmpeg-devel] [PATCH] avcodec/libjxldec: build against libjxl 0.9 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 2023-07-09 12:15 am, Leo Izen wrote: > Git master libjxl changed several function signatures, so this commit > adds some #ifdefs to handle the new signatures without breaking old > releases. Same objection as to the patch submitted a few days ago, pasted below: ---- 0.9.0 is still unreleased and unfortunately the API change wasn't accompanied with a version bump. The API changes were pushed on Jun 21st and the version bump to 0.9.0 was pushed on Jan 12th. So this will still break compilation with older git checkouts of libjxl. Ideally libjxl should bump once more to 0.9.1 ---- Regards, Gyan > --- > libavcodec/libjxldec.c | 21 +++++++++++++++++++-- > 1 file changed, 19 insertions(+), 2 deletions(-) > > diff --git a/libavcodec/libjxldec.c b/libavcodec/libjxldec.c > index 50417bcb02..e45ac02c07 100644 > --- a/libavcodec/libjxldec.c > +++ b/libavcodec/libjxldec.c > @@ -210,14 +210,22 @@ static int libjxl_get_icc(AVCodecContext *avctx) > JxlDecoderStatus jret; > /* an ICC profile is present, and we can meaningfully get it, > * because the pixel data is not XYB-encoded */ > +#if JPEGXL_NUMERIC_VERSION < JPEGXL_COMPUTE_NUMERIC_VERSION(0, 9, 0) > jret = JxlDecoderGetICCProfileSize(ctx->decoder, &ctx->jxl_pixfmt, JXL_COLOR_PROFILE_TARGET_DATA, &icc_len); > +#else > + jret = JxlDecoderGetICCProfileSize(ctx->decoder, JXL_COLOR_PROFILE_TARGET_DATA, &icc_len); > +#endif > if (jret == JXL_DEC_SUCCESS && icc_len > 0) { > av_buffer_unref(&ctx->iccp); > ctx->iccp = av_buffer_alloc(icc_len); > if (!ctx->iccp) > return AVERROR(ENOMEM); > +#if JPEGXL_NUMERIC_VERSION < JPEGXL_COMPUTE_NUMERIC_VERSION(0, 9, 0) > jret = JxlDecoderGetColorAsICCProfile(ctx->decoder, &ctx->jxl_pixfmt, JXL_COLOR_PROFILE_TARGET_DATA, > - ctx->iccp->data, icc_len); > + ctx->iccp->data, icc_len); > +#else > + jret = JxlDecoderGetColorAsICCProfile(ctx->decoder, JXL_COLOR_PROFILE_TARGET_DATA, ctx->iccp->data, icc_len); > +#endif > if (jret != JXL_DEC_SUCCESS) { > av_log(avctx, AV_LOG_WARNING, "Unable to obtain ICC Profile\n"); > av_buffer_unref(&ctx->iccp); > @@ -253,12 +261,21 @@ static int libjxl_color_encoding_event(AVCodecContext *avctx, AVFrame *frame) > /* set this flag if we need to fall back on wide gamut */ > int fallback = 0; > > +#if JPEGXL_NUMERIC_VERSION < JPEGXL_COMPUTE_NUMERIC_VERSION(0, 9, 0) > jret = JxlDecoderGetColorAsEncodedProfile(ctx->decoder, NULL, JXL_COLOR_PROFILE_TARGET_ORIGINAL, &jxl_color); > +#else > + jret = JxlDecoderGetColorAsEncodedProfile(ctx->decoder, JXL_COLOR_PROFILE_TARGET_ORIGINAL, &jxl_color); > +#endif > if (jret == JXL_DEC_SUCCESS) { > /* enum values describe the colors of this image */ > jret = JxlDecoderSetPreferredColorProfile(ctx->decoder, &jxl_color); > if (jret == JXL_DEC_SUCCESS) > - jret = JxlDecoderGetColorAsEncodedProfile(ctx->decoder, &ctx->jxl_pixfmt, JXL_COLOR_PROFILE_TARGET_DATA, &jxl_color); > +#if JPEGXL_NUMERIC_VERSION < JPEGXL_COMPUTE_NUMERIC_VERSION(0, 9, 0) > + jret = JxlDecoderGetColorAsEncodedProfile(ctx->decoder, &ctx->jxl_pixfmt, > + JXL_COLOR_PROFILE_TARGET_DATA, &jxl_color); > +#else > + jret = JxlDecoderGetColorAsEncodedProfile(ctx->decoder, JXL_COLOR_PROFILE_TARGET_DATA, &jxl_color); > +#endif > /* if we couldn't successfully request the pixel data space, we fall back on wide gamut */ > /* this code path is very unlikely to happen in practice */ > if (jret != JXL_DEC_SUCCESS) _______________________________________________ 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".