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 D27B34B642 for ; Mon, 10 Jun 2024 18:45:17 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id B6A2D68D7C2; Mon, 10 Jun 2024 21:44:34 +0300 (EEST) Received: from mail-wm1-f43.google.com (mail-wm1-f43.google.com [209.85.128.43]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 239B168D721 for ; Mon, 10 Jun 2024 21:44:27 +0300 (EEST) Received: by mail-wm1-f43.google.com with SMTP id 5b1f17b1804b1-421820fc26dso13381135e9.2 for ; Mon, 10 Jun 2024 11:44:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1718045066; x=1718649866; 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=6p2QZrm5rm9Q5zwyniEl/BIzhSrwtK9lasf9smGdW7Q=; b=OKn3gggw0psw8aOz/3Z1BfA6xXzpkLjP7w+smdPY0u1OIdrNfZ6C5L94GXg5jgkkkw +RYy9P8/DxyTzDV6mA4UWkaC8XYRjpJuHz7p2lVteaZpwbow6LM1Aze4/zMAxCjJnySI JwVmzao3s5BcAxyGCQ+WNKvQm5SYXIrZa2nzZPu3SalSJE6GLrAmcc7ebMjRTmHlLQ94 Y912vRo2kdjNA9BmEnX3HKmgw3wfDeldKWz7gOdz65RtQs9s4Oa7WsrtTBWilBg/9k5g YYqQTGnUTrumipFi6beYyPY9nNoUS7ojcF/wbyQHHoaMFn8ICUnYkQuy36w8bCiS8DT+ Igkw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718045066; x=1718649866; 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=6p2QZrm5rm9Q5zwyniEl/BIzhSrwtK9lasf9smGdW7Q=; b=HVXpSAUB4EGZxWWK7oLso8ES8O0Ak992n10ZOjEwpYvz1UqME4Jm6YNbkhyghUYfHn 1IFS+4ySqsLY92s+6b43LqHgQndUTECYAMTkFoMQulN43Q2vj8aXydNja70Dfga5bqNb vVQKenJtsoo3VDmbus73ZQxQV9wnMQYGwjnbS2/yVDTGsTQLQ+MRR8YzHx32y0UZVZO3 HsABqLG+yFy1a/zNtYpoyEJ2UEA+gCPsdTdp7nYtAM6ON8pz22MXiuFOoX56QzQ+GdSR GucZSjQ+Owd5zL8cNOPxXvWGwrNGZf429nszmpmJTNPOJ+ZLljI8y3285BH1rnqZdftH dD+Q== X-Gm-Message-State: AOJu0YyfxCnt/WY85numMYBfUDU4M/Va02Gi7ami1cQLMuCWJtbTD50a sHmDlTUSYIGYDsTjZjVR37peXraOL192yNfNOrzpQOlU/Ax9F+3PmSepTQ== X-Google-Smtp-Source: AGHT+IFVjqUwqFZv5KTDSmNTJoIU8Y02ymz3TxsH31FcSOMmGoOs3LJdqNgPGCR/G6a45EBw0mVhqg== X-Received: by 2002:a05:600c:b8a:b0:422:47a:15c8 with SMTP id 5b1f17b1804b1-422047a1766mr19701245e9.12.1718045065852; Mon, 10 Jun 2024 11:44:25 -0700 (PDT) Received: from localhost.localdomain ([51.191.0.41]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4218193b0c0sm64659165e9.31.2024.06.10.11.44.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Jun 2024 11:44:25 -0700 (PDT) From: Derek Buitenhuis To: ffmpeg-devel@ffmpeg.org Date: Mon, 10 Jun 2024 19:44:07 +0100 Message-ID: <20240610184408.68171-6-derek.buitenhuis@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240610184408.68171-1-derek.buitenhuis@gmail.com> References: <20240610184408.68171-1-derek.buitenhuis@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 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 b164bb0adb..a118ade089 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".