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 45FDB47F26 for ; Wed, 6 Dec 2023 15:10:13 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 3401A68CF90; Wed, 6 Dec 2023 17:10:11 +0200 (EET) Received: from mail0.khirnov.net (red.khirnov.net [176.97.15.12]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id BBECB68CC9B for ; Wed, 6 Dec 2023 17:10:04 +0200 (EET) Received: from localhost (localhost [IPv6:::1]) by mail0.khirnov.net (Postfix) with ESMTP id 85E672405ED; Wed, 6 Dec 2023 16:10:04 +0100 (CET) Received: from mail0.khirnov.net ([IPv6:::1]) by localhost (mail0.khirnov.net [IPv6:::1]) (amavis, port 10024) with ESMTP id HQx-kMmiIUde; Wed, 6 Dec 2023 16:10:04 +0100 (CET) Received: from lain.khirnov.net (lain.khirnov.net [IPv6:2001:67c:1138:4306::3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "lain.khirnov.net", Issuer "smtp.khirnov.net SMTP CA" (verified OK)) by mail0.khirnov.net (Postfix) with ESMTPS id 0A3D924043D; Wed, 6 Dec 2023 16:10:04 +0100 (CET) Received: by lain.khirnov.net (Postfix, from userid 1000) id EC3AF1601B9; Wed, 6 Dec 2023 16:10:03 +0100 (CET) From: Anton Khirnov To: FFmpeg development discussions and patches In-Reply-To: <20231109122534.124157-6-ffmpeg@haasn.xyz> References: <20231109122534.124157-1-ffmpeg@haasn.xyz> <20231109122534.124157-6-ffmpeg@haasn.xyz> Mail-Followup-To: FFmpeg development discussions and patches , Niklas Haas Date: Wed, 06 Dec 2023 16:10:03 +0100 Message-ID: <170187540394.8914.18137862049617540717@lain.khirnov.net> User-Agent: alot/0.8.1 MIME-Version: 1.0 Subject: Re: [FFmpeg-devel] [PATCH 05/25] avfilter/buffersrc: add color_space/range parameters 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: Quoting Niklas Haas (2023-11-09 13:19:37) > @@ -328,6 +341,30 @@ static const AVOption buffer_options[] = { > { "pixel_aspect", "sample aspect ratio", OFFSET(pixel_aspect), AV_OPT_TYPE_RATIONAL, { .dbl = 0 }, 0, DBL_MAX, V }, > { "time_base", NULL, OFFSET(time_base), AV_OPT_TYPE_RATIONAL, { .dbl = 0 }, 0, DBL_MAX, V }, > { "frame_rate", NULL, OFFSET(frame_rate), AV_OPT_TYPE_RATIONAL, { .dbl = 0 }, 0, DBL_MAX, V }, > + { "colorspace", "select colorspace", OFFSET(color_space), AV_OPT_TYPE_INT, {.i64=AVCOL_SPC_UNSPECIFIED}, 0, AVCOL_SPC_NB-1, V, "colorspace"}, > + { "gbr", NULL, 0, AV_OPT_TYPE_CONST, {.i64=AVCOL_SPC_RGB}, INT_MIN, INT_MAX, V, "colorspace"}, ^^^ is that intentional? > @@ -432,6 +471,15 @@ static int query_formats(AVFilterContext *ctx) > if ((ret = ff_add_format (&formats, c->pix_fmt)) < 0 || > (ret = ff_set_common_formats (ctx , formats )) < 0) > return ret; > + /* force specific colorspace/range downstream only for ordinary YUV */ > + if (ff_fmt_is_regular_yuv(c->pix_fmt)) { What will this do when the colorspace is not set, as it will not be with existing callers. > diff --git a/libavfilter/buffersrc.h b/libavfilter/buffersrc.h > index 3b248b37cd..4357a7bbfb 100644 > --- a/libavfilter/buffersrc.h > +++ b/libavfilter/buffersrc.h > @@ -105,6 +105,12 @@ typedef struct AVBufferSrcParameters { > */ > AVBufferRef *hw_frames_ctx; > > + /** > + * Video only, the YUV colorspace and range > + */ > + enum AVColorSpace color_space; > + enum AVColorRange color_range; This has to go at the end of the struct, otherwise you're breaking ABI. -- Anton Khirnov _______________________________________________ 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".