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 EB8EA4855A for ; Mon, 5 Feb 2024 18:39:38 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id D39A268D14F; Mon, 5 Feb 2024 20:39:32 +0200 (EET) Received: from haasn.dev (haasn.dev [78.46.187.166]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 47E7568A9C7 for ; Mon, 5 Feb 2024 20:39:26 +0200 (EET) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=haasn.xyz; s=mail; t=1707158366; bh=ryY9VjTdu0GHPp8OmzSK3ZjNOIFUOhCpPv36N8RKPC4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Y5Ff51v2pgq9aiKUh3Nwt8GP1gMuzeysuFwnY4fMAfkLG7pA7x1a15+Qw0mC7gisT fX1G9JE8y5e7Msww8PxORpL9xYMcu9hZAeZXBxkHW6kInlQA9nzbOMnMUpUKQDH/C5 ZhbH6ctEqZpOjC2UAJRo3aaVZCf4PHwvFGpK8+6Y= Received: from haasn.dev (unknown [10.30.0.2]) by haasn.dev (Postfix) with ESMTP id F2E1440CCA; Mon, 5 Feb 2024 19:39:25 +0100 (CET) From: Niklas Haas To: ffmpeg-devel@ffmpeg.org Date: Mon, 5 Feb 2024 19:39:21 +0100 Message-ID: <20240205183921.52633-2-ffmpeg@haasn.xyz> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240205183921.52633-1-ffmpeg@haasn.xyz> References: <20240205183921.52633-1-ffmpeg@haasn.xyz> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 2/2] fftools/ffplay: constrain supported YUV color spaces 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 SDL supports only these three matrices. Actually, it only supports these three combinations: BT.601+JPEG, BT.601+MPEG, BT.709+MPEG, but we have no way to restrict the specific *combination* of YUV range and YUV colorspace with the current filter design. See-Also: https://trac.ffmpeg.org/ticket/10839 Instead of an incorrect conversion result, trying to play a YCgCo file with ffplay will simply error out with a "No conversion possible" error. --- fftools/ffplay.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/fftools/ffplay.c b/fftools/ffplay.c index 132f50a5a1..53e6fc0514 100644 --- a/fftools/ffplay.c +++ b/fftools/ffplay.c @@ -940,6 +940,13 @@ static int upload_texture(SDL_Texture **tex, AVFrame *frame) return ret; } +static enum AVColorSpace sdl_supported_color_spaces[] = { + AVCOL_SPC_BT709, + AVCOL_SPC_BT470BG, + AVCOL_SPC_SMPTE170M, + AVCOL_SPC_UNSPECIFIED, +}; + static void set_sdl_yuv_conversion_mode(AVFrame *frame) { #if SDL_VERSION_ATLEAST(2,0,8) @@ -1921,6 +1928,8 @@ static int configure_video_filters(AVFilterGraph *graph, VideoState *is, const c if ((ret = av_opt_set_int_list(filt_out, "pix_fmts", pix_fmts, AV_PIX_FMT_NONE, AV_OPT_SEARCH_CHILDREN)) < 0) goto fail; + if ((ret = av_opt_set_int_list(filt_out, "color_spaces", sdl_supported_color_spaces, AVCOL_SPC_UNSPECIFIED, AV_OPT_SEARCH_CHILDREN)) < 0) + goto fail; last_filter = filt_out; -- 2.43.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".