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 DB7DE4AC89 for ; Mon, 17 Jun 2024 20:07:20 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 15EF968D73F; Mon, 17 Jun 2024 23:07:18 +0300 (EEST) Received: from mail-pj1-f41.google.com (mail-pj1-f41.google.com [209.85.216.41]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id DD3A868D4C1 for ; Mon, 17 Jun 2024 23:07:11 +0300 (EEST) Received: by mail-pj1-f41.google.com with SMTP id 98e67ed59e1d1-2c2c9199568so4080565a91.0 for ; Mon, 17 Jun 2024 13:07:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1718654829; x=1719259629; 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=uM5iSQTDO5LcXUs3s+jTVDg3QRimfCj78k11OQBQyRQ=; b=VHcKQy6KrjQXj+REldm0gpsoHttL8YERWMz60Fi9ZM9GmQTqAB4VTha2f6+kQqAYGZ dRp5jE5D1U9wOhWRJ7WNEgW3Ulu61QSrx3e3h17EUcm7PxbaofA7NjD9DrJYpkS5pMEJ Q5AbZBhA9DmpOpqsGgoB8Ot5i94nIJ0KtIvtFWqiF3x3k4Yzb+b6XxglXXm4QKGdVVlH aS9laqji1xvxyy4uyAX8I+VFtwp2zHIz5UbAf/F5Ss6oMqGnV6zEuYDhMqb8BYKLLPag UZnLq2o3vOoFVz2XVH+OkU/epXrppVnMsm8w2UoIGRP5/Ac4aZXo04X3sYjyBlDhS9nM mHmA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718654829; x=1719259629; 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=uM5iSQTDO5LcXUs3s+jTVDg3QRimfCj78k11OQBQyRQ=; b=pnLpKuuPR5FkVqCcrCe0KuUsOeWMV6pDZjtocHkKDC7pTvx8u2FDmplOwUUX9mdEYD WHkCyRSGPjSMhfMo1FUcBzi6Z3ZbveApyL544SEfvLZg1llRSpOwnIMhN8ubZovz3pOo ePW724JYeuZUjaaBU0n5XFPInekV4DaJsxNKsbtBhJ+YQA1TMoqchKbFFnNotAkhFXee rU5R6Yzw56682pNOGJEl90s1U9JWe/UhRkv0o3SgxtzAIHqb5aPlWruRCZa8BoqKsTZQ Q8LRC2gAa9KpATeNIY2xwry2x97sLuxSZCr34q1l+ESn7xd2qh8BOPlV+Pbcmj/i+mWX 6tJQ== X-Gm-Message-State: AOJu0Yw2tqc2ciz35lhYB86BdkTBqFryFtE4pE1eWI/MOXkVtcErYZMg wZik25ZiJS/tOGmM0gG9xRqaoufYfKNHxfjsFVEcQg+A0S54gWBviaqfmg== X-Google-Smtp-Source: AGHT+IGB44lAbKIb+yAL3zRb0L6uRyRQGIyNOR2HikdI1va4hMy20MoAdnIEiiFBWG66YeJN7zuU3A== X-Received: by 2002:a17:90a:d983:b0:2c2:c799:eb29 with SMTP id 98e67ed59e1d1-2c4dbd463c3mr9119896a91.49.1718654828913; Mon, 17 Jun 2024 13:07:08 -0700 (PDT) Received: from [192.168.0.16] ([190.194.167.233]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2c4c468e62fsm9386037a91.55.2024.06.17.13.07.07 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 17 Jun 2024 13:07:08 -0700 (PDT) Message-ID: Date: Mon, 17 Jun 2024 17:07:10 -0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird To: ffmpeg-devel@ffmpeg.org References: <20240617192019.512769-1-derek.buitenhuis@gmail.com> <20240617192019.512769-5-derek.buitenhuis@gmail.com> Content-Language: en-US From: James Almer In-Reply-To: <20240617192019.512769-5-derek.buitenhuis@gmail.com> Subject: Re: [FFmpeg-devel] [PATCH v3 4/5] avformat/mov: Add support for exporting Video Extension Usage info 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 4:20 PM, Derek Buitenhuis wrote: > This box is provided by files created by the Apple Vision Pro, as well > as the iPhone 15+ when capture for Vision Pro is enabled. > > The boxes are a mix of things documented by Apple in some PDFs, their > API docs, and reverse engineering. Ideally we will have a real spec > one day. > > Links: > *https://developer.apple.com/av-foundation/Stereo-Video-ISOBMFF-Extensions.pdf > *https://developer.apple.com/documentation/videotoolbox/kvtcompressionpropertykey_horizontaldisparityadjustment > *https://developer.apple.com/documentation/videotoolbox/kvtcompressionpropertykey_stereocamerabaseline > *https://developer.apple.com/documentation/videotoolbox/kvtcompressionpropertykey_heroeye > > Signed-off-by: Derek Buitenhuis > --- > libavformat/mov.c | 283 ++++++++++++++++++++++++++++++++++++++++++++++ > 1 file changed, 283 insertions(+) > > diff --git a/libavformat/mov.c b/libavformat/mov.c > index 9016cd5ad0..5724b4ef93 100644 > --- a/libavformat/mov.c > +++ b/libavformat/mov.c > @@ -6477,6 +6477,288 @@ static int mov_read_sv3d(MOVContext *c, AVIOContext *pb, MOVAtom atom) > return 0; > } > > +static int mov_read_vexu_proj(MOVContext *c, AVIOContext *pb, MOVAtom atom) > +{ > + AVStream *st; > + MOVStreamContext *sc; > + int size; > + uint32_t tag; > + enum AVSphericalProjection projection; > + > + if (c->fc->nb_streams < 1) > + return 0; > + > + st = c->fc->streams[c->fc->nb_streams - 1]; > + sc = st->priv_data; > + > + if (atom.size != 16) { > + av_log(c->fc, AV_LOG_ERROR, "Invalid size for proj box: %"PRIu64"\n", atom.size); > + return AVERROR_INVALIDDATA; > + } > + > + size = avio_rb32(pb); > + if (size != 16) { > + av_log(c->fc, AV_LOG_ERROR, "Invalid size for prji box: %d\n", size); > + return AVERROR_INVALIDDATA; > + } > + > + tag = avio_rl32(pb); > + if (tag != MKTAG('p','r','j','i')) { > + av_log(c->fc, AV_LOG_ERROR, "Invalid child box of proj box: 0x%08X\n", tag); > + return AVERROR_INVALIDDATA; > + } > + > + avio_skip(pb, 1); // version > + avio_skip(pb, 3); // flags > + > + tag = avio_rl32(pb); > + switch (tag) { > + case MKTAG('r','e','c','t'): > + projection = AV_SPHERICAL_RECTILINEAR; > + break; > + case MKTAG('e','q','u','i'): > + projection = AV_SPHERICAL_EQUIRECTANGULAR; > + break; > + case MKTAG('h','e','q','u'): > + projection = AV_SPHERICAL_HALF_EQUIRECTANGULAR; > + break; > + case MKTAG('f','i','s','h'): > + projection = AV_SPHERICAL_FISHEYE; > + break; > + default: > + av_log(c->fc, AV_LOG_ERROR, "Invalid projection type in prji box: 0x%08X\n", tag); > + return AVERROR_INVALIDDATA; > + } > + > + sc->spherical = av_spherical_alloc(&sc->spherical_size); > + if (!sc->spherical) > + return AVERROR(ENOMEM); > + > + sc->spherical->projection = projection; > + > + return 0; > +} > + > +static int mov_read_eyes(MOVContext *c, AVIOContext *pb, MOVAtom atom) > +{ > + AVStream *st; > + MOVStreamContext *sc; > + int size, flags = 0; > + int64_t remaining; > + uint32_t tag, baseline = 0; > + enum AVStereo3DView view = AV_STEREO3D_VIEW_PACKED; > + enum AVStereo3DPrimaryEye primary_eye = AV_PRIMARY_EYE_NONE; > + AVRational horizontal_disparity_adjustment = { 0, 0 }; nit: { 0, 1 }. Should be ok either way. _______________________________________________ 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".