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 2EFEF46A9D for ; Thu, 29 Feb 2024 16:43:46 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 0D3B968D1C7; Thu, 29 Feb 2024 18:43:26 +0200 (EET) Received: from mail-lf1-f50.google.com (mail-lf1-f50.google.com [209.85.167.50]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id DBE5A68D131 for ; Thu, 29 Feb 2024 18:43:17 +0200 (EET) Received: by mail-lf1-f50.google.com with SMTP id 2adb3069b0e04-5132181d54bso1239622e87.3 for ; Thu, 29 Feb 2024 08:43:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1709224997; x=1709829797; darn=ffmpeg.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=Jn00ofpgSy8nSFbrmdXNMoL41nTDmAAd+fucyZstd4w=; b=LP7WjELH4NY4RN93sMJcVZxf0eGZVFn6x7oGWtdx0KiLhiNGC7DclgusZgid3YASYQ t4Q9LtaGWXDDcjMsptp0bJ8aRx+lq6jiP5Wm4Ml/wgfVBqVb+erR7fqibnta7ulRueEI E+SQPd9NvlqtNcvOCJkofQPArYNark6KpiCBXvFLJnubhQxYQ1LHJN0u2+xdG+QCZtXH emXDg0iJ00YH8QSnLMMw4F9EyqgwIZ80FsZfDYlweil7P4C0w+lZa0fM2M4/zi9tx0+X CzKsROXIFB3nYr/Z8u8r8ff8feqWmPU4GcUSiSbbojIJgfblMSeYIu0S8WfMEsigjEro a+fw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709224997; x=1709829797; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Jn00ofpgSy8nSFbrmdXNMoL41nTDmAAd+fucyZstd4w=; b=gT2vW3448vvZjY2+XYp4AgJrqNkRy6JsWUVLr6++BZo0nhDw6laFXKub7uLTZC9QWx CUxybbjUR0JBsGOlSJQ+fxC1ABgjGxQ+VZurRaDEne48G9kK5CIiYFq4o0+Ttg5UUFDo ysrYT8oV+oUB5oS2Se3SGyo3BNfO/KoFSRdFMzBaRfgmvFwEUOGYkMoGPSXjeswR1We0 Vy9r6XHFi5/L0o3q1krquHvYJMK//mzOI3Bv2mpkclaKilrhaxZG0a7n4PvmBxb75nyA Cedtnyb5Rk8hyh1aSNXdX0IOp8P4BKYNhPqoZfzcTRx2b3it0FkJei8OHEuCHeN34pBM LcJg== X-Gm-Message-State: AOJu0YyoFvdaXLd1kItVC3Br+Lk6rFVJ8gixMHpaye+by6snKBiRxAl/ BvOPkEOKU6hcYIioxI8J6iDTGfrh/2aej5TD6HaSRrp21GmvTEv0cYfeGM1W X-Google-Smtp-Source: AGHT+IGpRnr2bQyntLDse5TdbrG5v4pVxpfMr6hplFjDsX2C8GkGjSNditGmgsLhyrj5zPWDtj35Pw== X-Received: by 2002:a05:6512:48d7:b0:513:203e:588d with SMTP id er23-20020a05651248d700b00513203e588dmr1633637lfb.64.1709224996941; Thu, 29 Feb 2024 08:43:16 -0800 (PST) Received: from localhost.localdomain (91-153-198-187.elisa-laajakaista.fi. [91.153.198.187]) by smtp.gmail.com with ESMTPSA id k6-20020ac24566000000b00513290734cbsm206248lfm.292.2024.02.29.08.43.16 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Feb 2024 08:43:16 -0800 (PST) From: =?UTF-8?q?Jan=20Ekstr=C3=B6m?= To: ffmpeg-devel@ffmpeg.org Date: Thu, 29 Feb 2024 18:42:49 +0200 Message-ID: <20240229164307.3535613-3-jeebjp@gmail.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240229164307.3535613-1-jeebjp@gmail.com> References: <20240229164307.3535613-1-jeebjp@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v7 02/14] avutil/frame: add helper for freeing arrays of side data 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 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: --- libavutil/frame.c | 5 +++++ libavutil/frame.h | 11 +++++++++++ 2 files changed, 16 insertions(+) diff --git a/libavutil/frame.c b/libavutil/frame.c index d94710687b..615dcb1b83 100644 --- a/libavutil/frame.c +++ b/libavutil/frame.c @@ -90,6 +90,11 @@ static void frame_side_data_wipe(AVFrame *frame) wipe_side_data(&frame->side_data, &frame->nb_side_data); } +void av_frame_side_data_free(AVFrameSideData ***sd, int *nb_sd) +{ + wipe_side_data(sd, nb_sd); +} + AVFrame *av_frame_alloc(void) { AVFrame *frame = av_malloc(sizeof(*frame)); diff --git a/libavutil/frame.h b/libavutil/frame.h index c0c1b23db7..921f2212cf 100644 --- a/libavutil/frame.h +++ b/libavutil/frame.h @@ -1049,6 +1049,17 @@ int av_frame_apply_cropping(AVFrame *frame, int flags); */ const char *av_frame_side_data_name(enum AVFrameSideDataType type); +/** + * Free all side data entries and their contents, then zeroes out the + * struct values. + * + * @param sd pointer to array of side data to free. Will be set to NULL + * upon return. + * @param nb_sd pointer to an integer containing the number of entries in + * the array. Will be set to 0 upon return. + */ +void av_frame_side_data_free(AVFrameSideData ***sd, int *nb_sd); + /** * @} */ -- 2.44.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".