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 0E45A4A15F for ; Fri, 22 Mar 2024 21:02:59 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 6F20368D40F; Fri, 22 Mar 2024 23:02:57 +0200 (EET) Received: from mail-ed1-f46.google.com (mail-ed1-f46.google.com [209.85.208.46]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 60E4068D3C1 for ; Fri, 22 Mar 2024 23:02:50 +0200 (EET) Received: by mail-ed1-f46.google.com with SMTP id 4fb4d7f45d1cf-563c403719cso3059151a12.2 for ; Fri, 22 Mar 2024 14:02:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1711141369; x=1711746169; darn=ffmpeg.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=hUn+2hh8+Vgxeik3UcZT6MU5WsgkQBMNbEsoLDdho04=; b=TWEcnGZnMS6BLf+4PvbD9nLhqsFud7B4DRAlwLNJbv5Nn3kQMacXDa2Ht4Jowe6D5l c8Gs/FjcZ69nyYiRrrcIzg/77lzul9R7ChTYZG8rSqJpneK/rEZ9ugqjUPHQPrkAp1Zv vkAQ4LRdr/uJaVt9sClsIn9YNJ93LItgI3lBiGnyjJHo0jzVl4Kr+oNcfFYnU/FOXlYQ TTit/UQk06TEx69OSBNpmd1zFkVtpjS2XuVgSm/TsVpFbgSwrkkdvJ+95+yrmvFV5Yz1 CMLj7nzapAYDjpTRgfKYT0KCPHzzu/Lgd+rEbpgxXXbGFXQEHqs0aGt2kHE6suZiA4e7 /MaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711141369; x=1711746169; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=hUn+2hh8+Vgxeik3UcZT6MU5WsgkQBMNbEsoLDdho04=; b=K1khPXRp+oncgGVNrSeHETCe2GzcT+IL2h90mlCQ0FV63Adhuyj0eTI4awjXLDG9ve OI9JKCpTwggCF1xNdcATGooJle+tpMPrqWi2mlsB/4fM9WtG4qpe8ZCY3Bgh0b5wkTlZ IFSgyNdMhIozKpHE4VRMm6vaYlMwwT5knHJvyCIImUzw7/v07365qW8NFvs5y9PJzI1e B0JpOn3lzkC5X7albFuD22Id1V8uqLupXCIrAe0oqBOTkCO9Wq6IJwo+cyWyk69LLSxK 1uNLX4eIJdeBn7KXHgk6SXwKtwQBkq0z7//N8yKrJlO84jkRAncGVeQ2doKxlOG4nym0 4UZw== X-Gm-Message-State: AOJu0YxcAGncKc63gKhMiQYjIQfSwgsnphaxEkMSkCi9SLfng1Yc64zh UXpDK8deIDiWCuUyR+dYxO5JG1Sezs9v/K/CmZmBIDCMtgu1IuzsvnNfk6mi X-Google-Smtp-Source: AGHT+IHmqfda9PeZK05BMRfs88jlplRDj/27PIa+fyhD5S30/4Q7tF3z4LpjJoNbO0jZzZO3Qo2nAA== X-Received: by 2002:a50:9984:0:b0:56b:f2d6:4be1 with SMTP id m4-20020a509984000000b0056bf2d64be1mr457617edb.4.1711141369239; Fri, 22 Mar 2024 14:02:49 -0700 (PDT) Received: from Mac-Pro.homenet.telecomitalia.it.homenet.telecomitalia.it (host-79-43-243-1.retail.telecomitalia.it. [79.43.243.1]) by smtp.gmail.com with ESMTPSA id d12-20020a50fe8c000000b0056a033fa007sm198677edt.64.2024.03.22.14.02.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Mar 2024 14:02:48 -0700 (PDT) From: Damiano Galassi To: ffmpeg-devel@ffmpeg.org Date: Fri, 22 Mar 2024 22:02:39 +0100 Message-Id: <20240322210239.68833-1-damiog@gmail.com> X-Mailer: git-send-email 2.39.3 (Apple Git-146) MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH] avfilter: propagate colorspace and color_range from buffer filter and between AVFilterLink. 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: Damiano Galassi 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: There two new fields were never sent down the filter chain, and no filter after the first had colorspace and color_range set, causing breakage in zscale and possible other filters. --- libavfilter/avfilter.c | 4 ++++ libavfilter/buffersrc.c | 2 ++ 2 files changed, 6 insertions(+) diff --git a/libavfilter/avfilter.c b/libavfilter/avfilter.c index 831871de90..153fb700d3 100644 --- a/libavfilter/avfilter.c +++ b/libavfilter/avfilter.c @@ -391,6 +391,10 @@ int ff_filter_config_links(AVFilterContext *filter) link->w = inlink->w; if (!link->h) link->h = inlink->h; + if (link->colorspace == AVCOL_SPC_UNSPECIFIED) + link->colorspace = inlink->color_range; + if (link->color_range == AVCOL_RANGE_UNSPECIFIED) + link->color_range = inlink->color_range; } else if (!link->w || !link->h) { av_log(link->src, AV_LOG_ERROR, "Video source filters must set their output link's " diff --git a/libavfilter/buffersrc.c b/libavfilter/buffersrc.c index ddcd403785..2760097edf 100644 --- a/libavfilter/buffersrc.c +++ b/libavfilter/buffersrc.c @@ -499,6 +499,8 @@ static int config_props(AVFilterLink *link) link->w = c->w; link->h = c->h; link->sample_aspect_ratio = c->pixel_aspect; + link->colorspace = c->color_space; + link->color_range = c->color_range; if (c->hw_frames_ctx) { link->hw_frames_ctx = av_buffer_ref(c->hw_frames_ctx); -- 2.39.3 (Apple Git-146) _______________________________________________ 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".