Repository navigation
feat(video): publish the 3D layout a source declares - #1154
RockJohnson503 wants to merge 1 commit into
Conversation
The engine read a source's stereo declaration (Matroska StereoMode, an MP4's st3d or vexu, the MV-HEVC multilayer disposition) for the visionOS stereo session only. A host that badges a 3D title, or draws the two views itself under .mono, had to guess from the file name. sourceVideoStereoLayout publishes it at load as a VideoStereoLayout: mono, multiview, side by side, over-under, frame sequence (each packing with rightViewFirst for the inverted order) or other. It reads the same on every system and under every stereoPresentation, is kept across reloads and is reset on stop. VideoStereoLayout.resolve is the one mapping from the side data. StereoVideoSignal.resolve reads it under .automatic, so a host sees the declaration the session plays from. The signal it picks and its log lines are unchanged.
There was a problem hiding this comment.
Automated review
Status: 🟡 Minor follow-ups. Only small touch-ups left.
This PR publishes the 3D layout a source declares as sourceVideoStereoLayout (a new public VideoStereoLayout). The value is read once in the load probe from the same side data and multilayer disposition that the stereo session already uses. The direction is right: the engine exposes what it already knows, so hosts no longer guess from file names. The .automatic branch of StereoVideoSignal.resolve now goes through VideoStereoLayout.resolve and keeps its old behaviour. Multilayer is still checked first and still needs HEVC. Side-by-side and over-under still map to the same packing, and every other case still logs "no stereo".
Findings
- Nit: The Stereo layout section says "Kept across reloads, reset on stop" but does not say what a disc title switch does. The Scan type section just above does say it. One clause would settle it, for example "not re-read on a disc title switch (a disc's MPEG-TS or PS declares no stereo)". (
docs/api.md:1327)
Checklist: CHANGELOG yes, docs yes, tests yes, traits both ways n.a.
Needs a device run: Nothing new beyond CI. The visionOS stereo session should be unchanged. Only a Vision Pro run would confirm that MV-HEVC and packed HEVC still pick the same signal, though the refactor keeps the old mapping.
Thanks for a clean, well-scoped change with docs in every page that owns the topic.
Automated review by Quint (Claude) of 805d4ef. It reads the code, it does not build or run it; a maintainer reviews and merges.
| - A packed frame does not declare whether each view keeps full or half size. The frame size and `sourceVideoPixelAspectRatio` tell. | ||
| - It is the declaration, not the presentation. It reads the same under every `stereoPresentation` and on every system, those that play 3D in 2D included. | ||
| - nil before load, without video, when the source declares nothing, and on the probe-free remote-HLS bypass. | ||
| - Kept across reloads, reset on stop. |
There was a problem hiding this comment.
Nit: the Scan type section above says what happens on a disc title switch, but this section does not. The PR body says the layout is not re-read on a title switch, like sourceVideoStreamFormat. A reader comparing the two sections may wonder whether the omission matters. Suggest adding: "Kept across reloads, not re-read on a disc title switch (a disc's MPEG-TS or PS declares no stereo), reset on stop."
Summary
Publishes the 3D layout a source declares, so a host that badges a 3D title, or draws the two views itself, reads it instead of guessing from the file name. Today the engine reads the declaration for the visionOS stereo session only.
What changed
VideoStereoLayout:.mono,.multiview,.sideBySide(rightViewFirst:),.overUnder(rightViewFirst:),.frameSequence(rightViewFirst:),.other.@Published sourceVideoStereoLayout, set by the load probe next tosourceVideoStreamFormat. nil before load, without video, when the source declares nothing and on the remote-HLS bypass. Kept across reloads, reset on stop.stereoPresentation. Frame sequence (Matroskablock_lr, a 3D Blu-ray MVC remux) and 2D are published too, though no session presents them.VideoStereoLayout.resolveis the one mapping from the side data.StereoVideoSignal.resolvereads it under.automatic. The signal it picks and its log lines are unchanged.sourceVideoStreamFormat: a disc's MPEG-TS or PS carries no stereo declaration.api.md(a row, a Stereo layout section, a line understereoPresentation),features.md,formats.md,guide.md,source-map.md. CHANGELOG under Unreleased..monothat publishesblock_lrandleft_right, keeps them across a reload and clears them on stop. The two Matroska fixtures inIssue435MultiviewCarriageTestsdropprivateso both suites share them.Test plan
block_lrandleft_right. The side data FFmpeg reports for Matroskamono,right_left,bottom_top,block_rl,checkerboardand an MP4st3dmono was checked with ffprobe (FFmpeg 9.0.2).swift buildpasses.swift test: 6885 tests pass.swift test --enable-all-traits: 7383 tests pass.check-doc-links.py,check-source-map.pyandcheck-test-hygiene.pypass.Checklist
CHANGELOG.mdupdatedfeat(...),fix(...),chore(...))