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 E69EA465A3 for ; Mon, 22 May 2023 08:35:33 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 76C8968C13D; Mon, 22 May 2023 11:35:32 +0300 (EEST) Received: from haasn.dev (haasn.dev [78.46.187.166]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 54BA968C11D for ; Mon, 22 May 2023 11:35:26 +0300 (EEST) Received: from haasn.dev (unknown [10.30.0.2]) by haasn.dev (Postfix) with ESMTP id 1760C42DED; Mon, 22 May 2023 10:35:26 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=haasn.xyz; s=mail; t=1684744526; bh=afxG/Dha/RpTito/vgrRcgfCnOQlFkq6XYbyFsqBhAQ=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=lM9wCmRLUAIw0PV6qdA9w9WUjJKta4ZixNfbxx67pF1GThdrTE5kI8ODiZ8hzeCb0 2WhrJZ5fpDIt5qEDNngZGxRkIcqEtYcMZycF5Brx9K7lOlmfc4g/8cSirBlRLwt9Jt Bxn/YdswGMAaK8kL4qZDKIayS60GkVeSErxhl2Eo= Date: Mon, 22 May 2023 10:35:25 +0200 Message-ID: <20230522103525.GD56755@haasn.xyz> From: Niklas Haas To: ffmpeg-devel@ffmpeg.org In-Reply-To: <20230521135420.15319-1-ffmpeg@haasn.xyz> References: <20230521135420.15319-1-ffmpeg@haasn.xyz> MIME-Version: 1.0 Content-Disposition: inline Subject: Re: [FFmpeg-devel] [PATCH] lavfi/vf_libplacebo: add RGB colorspace sanity 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: On Sun, 21 May 2023 15:54:20 +0200 Niklas Haas wrote: > From: Niklas Haas > > Explicitly forbid using a non-RGB colorspace with RGB pixel format or > vice versa. This mirrors identical logic from vf_scale. > --- > libavfilter/vf_libplacebo.c | 7 +++++++ > 1 file changed, 7 insertions(+) > > diff --git a/libavfilter/vf_libplacebo.c b/libavfilter/vf_libplacebo.c > index f26d0126beb..e5af2693293 100644 > --- a/libavfilter/vf_libplacebo.c > +++ b/libavfilter/vf_libplacebo.c > @@ -695,6 +695,13 @@ static int output_frame_mix(AVFilterContext *ctx, > if (s->color_primaries >= 0) > out->color_primaries = s->color_primaries; > > + /* Sanity colorspace overrides */ > + if (outdesc->flags & AV_PIX_FMT_FLAG_RGB) { > + out->colorspace = AVCOL_SPC_RGB; > + } else if (out->colorspace == AVCOL_SPC_RGB) { > + out->colorspace = AVCOL_SPC_UNSPECIFIED; > + } > + > changed_csp = ref->colorspace != out->colorspace || > ref->color_range != out->color_range || > ref->color_trc != out->color_trc || > -- > 2.40.1 > Merged as f66280182acb03604df2ef58c623b4fa39c56444 _______________________________________________ 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".