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 6D95548A0F for ; Sat, 22 Jun 2024 15:32:18 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 3649D68D653; Sat, 22 Jun 2024 18:31:47 +0300 (EEST) Received: from mail-pf1-f169.google.com (mail-pf1-f169.google.com [209.85.210.169]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 5654268D602 for ; Sat, 22 Jun 2024 18:31:40 +0300 (EEST) Received: by mail-pf1-f169.google.com with SMTP id d2e1a72fcca58-70671ecd334so126037b3a.0 for ; Sat, 22 Jun 2024 08:31:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1719070297; x=1719675097; 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=uBVkSWgJQ7hxhQvvZKdnMrMJSox5bjDYEobbQkYuIAE=; b=dblcBOqz59nHEGmaJ62FVw27IUGJMeXGHY1eekgICUUF+mFNRHQDySdVwgznKhb12S /LU1mwNCRFGj1sCWkK2I6HS+FYbErQhf5m9LmzfWJuJfri6+mHLR/Cq/t0uVzFRN3Vts f20Xlq2yoUlQ6kyC/c0rqLghXkjVue4KwKPQ+1E9QoD0ASmkLkOVnyuqxatcrAPEyGvW bZ+2lLtFOZgz/sUc6Xmv2BVX8w+3GYX26P5V/LQFiihZKZGT8u6as9z+jPrJZ8JTFi63 KiGm8iYu5r4MrLT4r7nT+xlzFCdmr8VWQGxIR246CoqkBh6EdXwM6YnlSoJrA1HWNyNl U2lQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719070297; x=1719675097; 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=uBVkSWgJQ7hxhQvvZKdnMrMJSox5bjDYEobbQkYuIAE=; b=EENCWg0kUPpgAEy6LYQRNt11PX+4iIDmgUOWQs4WwiACZJluS/GYgJ5FFBXPtMN0P1 3btOQ8IlYtHKZH3uDl/kBXtnmEjy5qF1n4oh0Que+wKzDggxNqGK23OVaw9iW0lpNa5L H7eXqzCZ1kkzN5gTzIiEzw6OH6CscIC9NW77aVDRj7BTBziOfi7cp/59ZUwLmT+HTduc opxVaVpKSE9+hpHtiHzHMEhJEeuFiOslBaZ39w9XyeY6m1YozaYvXoSHADj645vEhQtl Ek5FSo1o/DmBPQFvNJtp46WFq9Yt8li/uGkUEXjtClTp/Jvrt1NXkJINtzR2uPuaSKEC TO0Q== X-Gm-Message-State: AOJu0Yw/TYoa3D5amOC6ufwMModjjB/8gr2tSv6kzAzVFJWsoPLP8Igt nK7efb3y/oKNkpEzLJ54YVvd1m6b5XG9M1bCsoJ0r8f+XSUdriyBk1YZ9w== X-Google-Smtp-Source: AGHT+IFB/ETjME5qcVwOOJVkXe8pyxbCoySy9ILUbnTBX4ZGjbh7QS79It4XgDnFLszziPPFczCazw== X-Received: by 2002:a05:6a20:3ba5:b0:1b7:d72e:9e5e with SMTP id adf61e73a8af0-1bcf44ee325mr723285637.37.1719070297350; Sat, 22 Jun 2024 08:31:37 -0700 (PDT) Received: from localhost.localdomain ([190.194.167.233]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7066ac98fc9sm1164709b3a.193.2024.06.22.08.31.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 22 Jun 2024 08:31:36 -0700 (PDT) From: James Almer To: ffmpeg-devel@ffmpeg.org Date: Sat, 22 Jun 2024 12:31:20 -0300 Message-ID: <20240622153122.6220-6-jamrial@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240622153122.6220-1-jamrial@gmail.com> References: <20240622153122.6220-1-jamrial@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 6/8 v2] avutil/stereo3d: add a new allocator function that returns a size 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: av_stereo3d_alloc() is not useful in scenarios where you need to know the runtime size of AVStereo3D. Signed-off-by: James Almer --- libavutil/stereo3d.c | 8 ++++++++ libavutil/stereo3d.h | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/libavutil/stereo3d.c b/libavutil/stereo3d.c index e8e5030db9..c182b18e52 100644 --- a/libavutil/stereo3d.c +++ b/libavutil/stereo3d.c @@ -32,6 +32,11 @@ static void get_defaults(AVStereo3D *stereo) } AVStereo3D *av_stereo3d_alloc(void) +{ + return av_stereo3d_alloc_size(NULL); +} + +AVStereo3D *av_stereo3d_alloc_size(size_t *size) { AVStereo3D *stereo = av_mallocz(sizeof(AVStereo3D)); if (!stereo) @@ -39,6 +44,9 @@ AVStereo3D *av_stereo3d_alloc(void) get_defaults(stereo); + if (size) + *size = sizeof(*stereo); + return stereo; } diff --git a/libavutil/stereo3d.h b/libavutil/stereo3d.h index e3af519e03..31167c14fa 100644 --- a/libavutil/stereo3d.h +++ b/libavutil/stereo3d.h @@ -251,6 +251,14 @@ typedef struct AVStereo3D { */ AVStereo3D *av_stereo3d_alloc(void); +/** + * Allocate an AVStereo3D structure and set its fields to default values. + * The resulting struct can be freed using av_freep(). + * + * @return An AVStereo3D filled with default values or NULL on failure. + */ +AVStereo3D *av_stereo3d_alloc_size(size_t *size); + /** * Allocate a complete AVFrameSideData and add it to the frame. * -- 2.45.2 _______________________________________________ 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".