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 A7A46496F1 for ; Mon, 17 Jun 2024 13:42:47 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 03F4168D795; Mon, 17 Jun 2024 16:42:07 +0300 (EEST) Received: from mail-wm1-f48.google.com (mail-wm1-f48.google.com [209.85.128.48]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 9E61D68D76D for ; Mon, 17 Jun 2024 16:41:57 +0300 (EEST) Received: by mail-wm1-f48.google.com with SMTP id 5b1f17b1804b1-4217d808034so38175235e9.3 for ; Mon, 17 Jun 2024 06:41:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1718631716; x=1719236516; 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=sOyWr0NQ8NVMunluntBog7eG4FXYiLZY3pjGphecwDI=; b=dbvoCKnGnIwdigcJSmnzMaOtzlYswv6/fkOw9eqwyvMzPHcOXAtmHZFmu/y20q+dkQ JSxIAo2I6WIPCjOZZu2nZ7ahZ0SGpbh42YEaoCtxvQ3kMPgEEl65cQ2UROGEVz8a3gaj w5ZMysj0LKoMZPgkcXNZOJmuQufG2Q0cMSz/Gh67vsoOjEIPDPvSVFFJv5a+S795/BrS C0n6iXMMrH1wCtX/baEO8Y3Gn0nZrenQtc9Y/lJXE2YxVDFoEl7ZxpDgTzlbAxVkyOPV SpWaCGVJNy2YCKj8gCQrqUYNkPLeIuWdC4Bbc2waqNmTca2DN0L8HQyjAvjIyQgegTEt 6G0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718631716; x=1719236516; 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=sOyWr0NQ8NVMunluntBog7eG4FXYiLZY3pjGphecwDI=; b=QS03r85H4Ptl8jjG7uhvxI+tUVnCA/HX5xDDoxmU1+lJOl2AeT47Yhh5Hl3R3+vzpf UG6utACou2AMIJ75tuafsoXyEmdVmgYBYaD+3abPaeglt0a9U8242csG+9t45ju8pIAQ Exg4+S9OQxOprL+QfxJaXUTYXER9FqNgTQtebAVi9Zs5KmPL22ypp8DmA1AXUNEVNP+L pvQ+rerkBvwIO6JXDBoboHns1CJKnh5yJwHtUu+Qoh0MqwwgiDQhdMrM2lHylFDmVQdw wytbLTT9jA0ttMQe2irIJ/h9Mt0YVM2uGWF4kk25lSNHUwjvNGKIF5NVRJt/9EARTOkx ItTw== X-Gm-Message-State: AOJu0YzdDNwTBiaOUQBa02oYFjK8ZdhYESBA91gbndADjJCOvZh9TQUh 5oUyS6Warm5UR7qbePIm9hbXPR3bTNxkG9cWgwT68u9BvLGHBzs3O96XZg== X-Google-Smtp-Source: AGHT+IF9v3/De3WKKY5y4ymEDvnmjDsc9EBU9+aYauW6igiKOoNlze8QHSNg/eKCjXtKil2ICHuzug== X-Received: by 2002:a05:600c:46ce:b0:421:81b7:49ef with SMTP id 5b1f17b1804b1-423048227a4mr73814045e9.8.1718631716492; Mon, 17 Jun 2024 06:41:56 -0700 (PDT) Received: from localhost.localdomain (0540dce9.skybroadband.com. [5.64.220.233]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3607509c790sm11915391f8f.38.2024.06.17.06.41.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Jun 2024 06:41:55 -0700 (PDT) From: Derek Buitenhuis To: ffmpeg-devel@ffmpeg.org Date: Mon, 17 Jun 2024 14:41:41 +0100 Message-ID: <20240617134141.224614-6-derek.buitenhuis@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240617134141.224614-1-derek.buitenhuis@gmail.com> References: <20240617134141.224614-1-derek.buitenhuis@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v2 5/5] avformat/mov: Add support for reading and exporting horizontal field of view 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: These boxes are created by the Apple Vision Pro and the iPhone 15+ when capture for the Vision Pro is enabled. Based off of the swift API: * https://developer.apple.com/documentation/coremedia/kcmformatdescriptionextension_horizontalfieldofview Signed-off-by: Derek Buitenhuis --- libavformat/mov.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/libavformat/mov.c b/libavformat/mov.c index a7ca0b5a3c..391b11a4e1 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -6755,6 +6755,34 @@ static int mov_read_vexu(MOVContext *c, AVIOContext *pb, MOVAtom atom) return 0; } +static int mov_read_hfov(MOVContext *c, AVIOContext *pb, MOVAtom atom) +{ + AVStream *st; + MOVStreamContext *sc; + + if (c->fc->nb_streams < 1) + return 0; + + st = c->fc->streams[c->fc->nb_streams - 1]; + sc = st->priv_data; + + if (atom.size != 4) { + av_log(c->fc, AV_LOG_ERROR, "Invalid size of hfov box: %"PRIu64"\n", atom.size); + return AVERROR_INVALIDDATA; + } + + + if (!sc->stereo3d) { + sc->stereo3d = av_stereo3d_alloc(); + if (!sc->stereo3d) + return AVERROR(ENOMEM); + } + + sc->stereo3d->horizontal_field_of_view = avio_rb32(pb); + + return 0; +} + static int mov_parse_uuid_spherical(MOVStreamContext *sc, AVIOContext *pb, size_t len) { int ret = 0; @@ -8874,6 +8902,7 @@ static const MOVParseTableEntry mov_default_parse_table[] = { { MKTAG('s','t','3','d'), mov_read_st3d }, /* stereoscopic 3D video box */ { MKTAG('s','v','3','d'), mov_read_sv3d }, /* spherical video box */ { MKTAG('v','e','x','u'), mov_read_vexu }, /* video extension usage */ +{ MKTAG('h','f','o','v'), mov_read_hfov }, { MKTAG('d','O','p','s'), mov_read_dops }, { MKTAG('d','m','l','p'), mov_read_dmlp }, { MKTAG('S','m','D','m'), mov_read_smdm }, -- 2.43.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".