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 9CCA5481B8 for ; Fri, 12 Jan 2024 08:30:17 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 773FB68D069; Fri, 12 Jan 2024 10:30:04 +0200 (EET) Received: from haasn.dev (haasn.dev [78.46.187.166]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id BA72A68CD4C for ; Fri, 12 Jan 2024 10:29:56 +0200 (EET) Received: from haasn.dev (unknown [10.30.0.2]) by haasn.dev (Postfix) with ESMTP id 47424414B5; Fri, 12 Jan 2024 09:29:56 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=haasn.xyz; s=mail; t=1705048196; bh=ChD+VxHxXTPMpgHvi1xBqe1vQtRXYZqpMfWMMcVa5h0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=O3Jca0SdsFgrFVJi/ulq0fQNfspykMk/SmMI+IJqifY5PPBYpWS1WZxPbhPVk0NWY n66MIoM99SzR/dIpn5jogtv8F7bhVVn66fz81eB2JSIi2fq8ynTDS4dbQsLZ3qihaK 1kjddQum+B4XVwrmUdSAMkIYQKwTmtu8ESxrAE94= From: Niklas Haas To: ffmpeg-devel@ffmpeg.org Date: Fri, 12 Jan 2024 09:25:58 +0100 Message-ID: <20240112082950.41637-2-ffmpeg@haasn.xyz> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240112082950.41637-1-ffmpeg@haasn.xyz> References: <20240112082950.41637-1-ffmpeg@haasn.xyz> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 01/11] avfilter/buffersrc: promote unspecified color metadata 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 Currently, this only affects untagged RGB/XYZ/Gray, which get forced to their corresponding metadata before entering the filter graph. The main justification for this change, however, is the planned ability to add automatic promotion of unspecified yuv to mpeg range yuv. Notably, this change will never allow accidentally cross-promoting unspecified to jpeg or to a specific YUV matrix, since that is still bound by the constraints of YUV range negotiation as set up by query_formats. --- libavfilter/buffersrc.c | 5 +++++ tests/ref/fate/rgb24-mkv | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/libavfilter/buffersrc.c b/libavfilter/buffersrc.c index afe69433b2..e10653c866 100644 --- a/libavfilter/buffersrc.c +++ b/libavfilter/buffersrc.c @@ -277,6 +277,11 @@ FF_DISABLE_DEPRECATION_WARNINGS FF_ENABLE_DEPRECATION_WARNINGS #endif + if (copy->colorspace == AVCOL_SPC_UNSPECIFIED) + copy->colorspace = ctx->outputs[0]->colorspace; + if (copy->color_range == AVCOL_RANGE_UNSPECIFIED) + copy->color_range = ctx->outputs[0]->color_range; + ret = ff_filter_frame(ctx->outputs[0], copy); if (ret < 0) return ret; diff --git a/tests/ref/fate/rgb24-mkv b/tests/ref/fate/rgb24-mkv index 99234f1052..1cbed136dd 100644 --- a/tests/ref/fate/rgb24-mkv +++ b/tests/ref/fate/rgb24-mkv @@ -1,5 +1,5 @@ -e181dc84058c3584598333dabd110123 *tests/data/fate/rgb24-mkv.matroska -58225 tests/data/fate/rgb24-mkv.matroska +7d767e8238c674ecfa80458cb281c09e *tests/data/fate/rgb24-mkv.matroska +58236 tests/data/fate/rgb24-mkv.matroska #tb 0: 1/10 #media_type 0: video #codec_id 0: rawvideo -- 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".