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 3BE834B886 for ; Mon, 17 Jun 2024 16:54:02 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 2FDE168D76F; Mon, 17 Jun 2024 19:54:00 +0300 (EEST) Received: from mail-pf1-f171.google.com (mail-pf1-f171.google.com [209.85.210.171]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 414AF68CF01 for ; Mon, 17 Jun 2024 19:53:53 +0300 (EEST) Received: by mail-pf1-f171.google.com with SMTP id d2e1a72fcca58-7046211e455so3266665b3a.3 for ; Mon, 17 Jun 2024 09:53:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1718643230; x=1719248030; darn=ffmpeg.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:to:subject:user-agent:mime-version:date:message-id:from :to:cc:subject:date:message-id:reply-to; bh=VT1/86/bAOxDF5XUNKwFMeMZzTSVuN1LDMDONWlOB8Q=; b=QuWpuP0oRTjTaLus1rMh12kuK45zXcUJ1PkfVv+nG9j4IwU1BohVl3cSVA/q3c4xj8 RXcjJFm0UWbn5/FIkOpFc4i7QJGNNPIdkF/SmawuarzJEc/9z7WU3HyNTj8ob97oPvgE FnuKUv6FIqitVVe0rxk7B+jW6lbBX2tjSHPqhXzkMZPzMqpFJRHDB4YVXOuIea3m1BJd u2oQZaYbziPYMMsVihAWSt/tOruezII0M5sTdGQC0inudWH2O1NkUm7EpVIeH7MpKZ8D Gy4vIMUtyOV3QsQGkh3QFqF1ZQ2dq5aT++VsRAHByM3jeQgrOKnXRkWYKUnnNwvxT5Zx Q4Rw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718643230; x=1719248030; h=content-transfer-encoding:in-reply-to:from:content-language :references:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=VT1/86/bAOxDF5XUNKwFMeMZzTSVuN1LDMDONWlOB8Q=; b=YjkvKTbTJOLFi81OvgOSdQQt2C/a+pQ4E5CEYKua6nrsTq7YYbSLpoP5ftsZHUjY01 BbDZsBxn+a9qf8IC4fVpDrCCaxUKMcQPKt8//iDHzmQ1jg+vUKuukKCtZv/bg4ArLoUu NmyrpNRGchl/pA6pafGAO1Mj7Qg+Nsn4HIw/YNeTaxR5SYdIFn15N1iGh/G6wr0lliSd pfpxIPLGGsyowg55AMNOZkf0fc4xFXJ+XlihCjKrzNKQHGmCI6afQhYyYWV7rzz6I/8X s/vqjjeHQSNsYYqun1z9omc/jiT/jcYiy7ae3V4F9Z5uY16WaLSXCIp/jrpazZXq9H44 vmqg== X-Gm-Message-State: AOJu0YwfNDCzWqdzqAizZUda1ayHW2wYPD9VMntuoR8fdTE64h2vBq6H sk2lZqxwQ2xLbaCo5z5POyBPq+fE5Mx0y3VG5vEP48LaI71di3yhJZyxnw== X-Google-Smtp-Source: AGHT+IFWy5QsSjVoXbzmwAbOPr1g1nlDtSyuTbrhDA87z5FNZsPg2uLypK/SWYlETOYQ/3oLZgcj8g== X-Received: by 2002:a05:6a21:9988:b0:1b6:da8b:9c with SMTP id adf61e73a8af0-1bae7f142demr10275744637.28.1718643230179; Mon, 17 Jun 2024 09:53:50 -0700 (PDT) Received: from [192.168.0.16] ([190.194.167.233]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1f855e7ca78sm80802465ad.106.2024.06.17.09.53.48 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 17 Jun 2024 09:53:49 -0700 (PDT) Message-ID: <361003f7-6234-4803-9089-5d4b69b537df@gmail.com> Date: Mon, 17 Jun 2024 13:53:51 -0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird To: ffmpeg-devel@ffmpeg.org References: <20240617134141.224614-1-derek.buitenhuis@gmail.com> <20240617134141.224614-3-derek.buitenhuis@gmail.com> Content-Language: en-US From: James Almer In-Reply-To: <20240617134141.224614-3-derek.buitenhuis@gmail.com> Subject: Re: [FFmpeg-devel] [PATCH v2 2/5] avutil/stereo3d: Fill out stereo info provided by Vision Pro files 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-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: On 6/17/2024 10:41 AM, Derek Buitenhuis wrote: > Based on what is in the files themselves, and what the API provides > to users. > > URLs: > * https://developer.apple.com/documentation/videotoolbox/kvtcompressionpropertykey_heroeye > * https://developer.apple.com/documentation/videotoolbox/kvtcompressionpropertykey_stereocamerabaseline > * https://developer.apple.com/documentation/videotoolbox/kvtcompressionpropertykey_horizontaldisparityadjustment > * https://developer.apple.com/documentation/coremedia/kcmformatdescriptionextension_horizontalfieldofview > > Signed-off-by: Derek Buitenhuis > --- > libavutil/stereo3d.c | 52 +++++++++++++++++++++++++++++ > libavutil/stereo3d.h | 78 ++++++++++++++++++++++++++++++++++++++++++++ > libavutil/version.h | 2 +- > 3 files changed, 131 insertions(+), 1 deletion(-) > > diff --git a/libavutil/stereo3d.c b/libavutil/stereo3d.c > index 9c29ab01b5..a40a9439bb 100644 > --- a/libavutil/stereo3d.c > +++ b/libavutil/stereo3d.c > @@ -55,6 +55,18 @@ static const char * const stereo3d_type_names[] = { > [AV_STEREO3D_COLUMNS] = "interleaved columns", > }; > > +static const char * const stereo3d_view_names[] = { > + [AV_STEREO3D_VIEW_PACKED] = "packed", > + [AV_STEREO3D_VIEW_LEFT] = "left", > + [AV_STEREO3D_VIEW_RIGHT] = "right", > +}; > + > +static const char * const stereo3d_primary_eye_names[] = { > + [AV_PRIMARY_EYE_NONE] = "none", > + [AV_PRIMARY_EYE_LEFT] = "left", > + [AV_PRIMARY_EYE_RIGHT] = "right", > +}; > + > const char *av_stereo3d_type_name(unsigned int type) > { > if (type >= FF_ARRAY_ELEMS(stereo3d_type_names)) > @@ -74,3 +86,43 @@ int av_stereo3d_from_name(const char *name) > > return -1; > } > + > +const char *av_stereo3d_view_name(unsigned int view) > +{ > + if (view >= FF_ARRAY_ELEMS(stereo3d_view_names)) > + return "unknown"; > + > + return stereo3d_view_names[view]; > +} > + > +int av_stereo3d_view_from_name(const char *name) > +{ > + int i; > + > + for (i = 0; i < FF_ARRAY_ELEMS(stereo3d_view_names); i++) { > + if (av_strstart(name, stereo3d_view_names[i], NULL)) > + return i; > + } > + > + return -1; > +} > + > +const char *av_stereo3d_primary_eye_name(unsigned int eye) > +{ > + if (eye >= FF_ARRAY_ELEMS(stereo3d_primary_eye_names)) > + return "unknown"; > + > + return stereo3d_primary_eye_names[eye]; > +} > + > +int av_stereo3d_primary_eye_from_name(const char *name) > +{ > + int i; > + > + for (i = 0; i < FF_ARRAY_ELEMS(stereo3d_primary_eye_names); i++) { > + if (av_strstart(name, stereo3d_primary_eye_names[i], NULL)) > + return i; > + } > + > + return -1; > +} > diff --git a/libavutil/stereo3d.h b/libavutil/stereo3d.h > index 3aab959b79..d35e46e670 100644 > --- a/libavutil/stereo3d.h > +++ b/libavutil/stereo3d.h > @@ -158,6 +158,26 @@ enum AVStereo3DView { > AV_STEREO3D_VIEW_RIGHT, > }; > > +/** > + * List of possible primary eyes. > + */ > +enum AVStereo3DPrimaryEye { > + /** > + * Neither eye. > + */ > + AV_PRIMARY_EYE_NONE, > + > + /** > + * Left eye. > + */ > + AV_PRIMARY_EYE_LEFT, > + > + /** > + * Right eye > + */ > + AV_PRIMARY_EYE_RIGHT, > +}; > + > /** > * Inverted views, Right/Bottom represents the left view. > */ > @@ -185,6 +205,28 @@ typedef struct AVStereo3D { > * Determines which views are packed. > */ > enum AVStereo3DView view; > + > + /** > + * Which eye is the primary eye when rendering in 2D. > + */ > + enum AVStereo3DPrimaryEye primary_eye; > + > + /** > + * The distance between the centres of the lenses of the camera system, > + * in micrometers. Zero if unset. > + */ > + uint32_t baseline; > + > + /** > + * Relative shift of the left and right images, which changes the zero parallax plane. > + * Range -10000 to 10000, mapped to -1.0 to 1.0. Zero if unset. Maybe this should be an AVRational then. > + */ > + int32_t horizontal_disparity_adjustment; > + > + /** > + * Horizontal field of view in thousanths of a degree. Zero if unset. > + */ > + uint32_t horizontal_field_of_view; > } AVStereo3D; > > /** > @@ -222,6 +264,42 @@ const char *av_stereo3d_type_name(unsigned int type); > */ > int av_stereo3d_from_name(const char *name); > > +/** > + * Provide a human-readable name of a given stereo3d view. > + * > + * @param type The input stereo3d view value. > + * > + * @return The name of the stereo3d view value, or "unknown". > + */ > +const char *av_stereo3d_view_name(unsigned int view); > + > +/** > + * Get the AVStereo3DView form a human-readable name. > + * > + * @param name The input string. > + * > + * @return The AVStereo3DView value, or -1 if not found. > + */ > +int av_stereo3d_view_from_name(const char *name); > + > +/** > + * Provide a human-readable name of a given stereo3d primary eye. > + * > + * @param type The input stereo3d primary eye value. > + * > + * @return The name of the stereo3d primary eye value, or "unknown". > + */ > +const char *av_stereo3d_primary_eye_name(unsigned int eye); > + > +/** > + * Get the AVStereo3DPrimaryEye form a human-readable name. > + * > + * @param name The input string. > + * > + * @return The AVStereo3DPrimaryEye value, or -1 if not found. > + */ > +int av_stereo3d_primary_eye_from_name(const char *name); > + > /** > * @} > */ > diff --git a/libavutil/version.h b/libavutil/version.h > index 7df546ee22..8044fd3935 100644 > --- a/libavutil/version.h > +++ b/libavutil/version.h > @@ -79,7 +79,7 @@ > */ > > #define LIBAVUTIL_VERSION_MAJOR 59 > -#define LIBAVUTIL_VERSION_MINOR 23 > +#define LIBAVUTIL_VERSION_MINOR 24 > #define LIBAVUTIL_VERSION_MICRO 100 > > #define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \ _______________________________________________ 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".