From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.ffmpeg.org (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTPS id DAC294B355 for ; Wed, 21 May 2025 12:48:59 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTP id 622F268D2D5; Wed, 21 May 2025 15:48:36 +0300 (EEST) Received: from haasn.dev (haasn.dev [78.46.187.166]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTP id 1B45268CF23 for ; Wed, 21 May 2025 15:48:27 +0300 (EEST) Received: from haasn.dev (unknown [10.30.1.1]) by haasn.dev (Postfix) with UTF8SMTP id DCC6E41C83; Wed, 21 May 2025 14:48:26 +0200 (CEST) From: Niklas Haas To: ffmpeg-devel@ffmpeg.org Date: Wed, 21 May 2025 14:43:48 +0200 Message-ID: <20250521124824.49657-3-ffmpeg@haasn.xyz> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250521124824.49657-1-ffmpeg@haasn.xyz> References: <20250521124824.49657-1-ffmpeg@haasn.xyz> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v2 02/17] swscale/format: add ff_fmt_clear() 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 Reset an SwsFormat to its fully unset/invalid state. --- libswscale/format.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/libswscale/format.h b/libswscale/format.h index 3b6d745159..be92038f4f 100644 --- a/libswscale/format.h +++ b/libswscale/format.h @@ -85,6 +85,20 @@ typedef struct SwsFormat { SwsColor color; } SwsFormat; +static inline void ff_fmt_clear(SwsFormat *fmt) +{ + *fmt = (SwsFormat) { + .format = AV_PIX_FMT_NONE, + .range = AVCOL_RANGE_UNSPECIFIED, + .csp = AVCOL_SPC_UNSPECIFIED, + .loc = AVCHROMA_LOC_UNSPECIFIED, + .color = { + .prim = AVCOL_PRI_UNSPECIFIED, + .trc = AVCOL_TRC_UNSPECIFIED, + }, + }; +} + /** * This function also sanitizes and strips the input data, removing irrelevant * fields for certain formats. -- 2.49.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".