forge
Explore
Log in

Don't you dare go Hollow

Commits

Commits on c3273089121706b520cb38f4b341d22cfde05d8eFiltered to scripts/gen_fixtures.shClear filter

2026-10-23

🚚 edith moves to git.tahinli.comAhmet Kaan Gümüş · b02f499
🚚 edith moves to git.tahinli.com

The working tree as of 2026-10-23, as one commit on top of the last one
here. It carries the work up to that date plus the test-slimming work:
integration tests merged into one binary per crate, nextest config,
doctest = false, debug line tables only, perf tests behind --ignored,
and faster generators, reverse, undo, subtitle-export, hevc, stabilise
and hear tests.

2026-09-24

test(anamorphic): the anamorphic fixtures and the suite that pins themAhmet Kaan Gümüş · db45d3c
test(anamorphic): the anamorphic fixtures and the suite that pins them

scripts/gen_fixtures.sh grows the anamorphic block: test_anamorphic.mp4
and .mkv, one 1440x1080 setsar=4/3 source in each container (mkvmerge is
not installed; ffmpeg's own Display* output is the source of truth), and
test_anamorphic_hevc.mkv for the copy door, which only copies HEVC or
AV1 Matroska.

crates/engine/tests/anamorphic.rs pins the whole contract on them:
- the probe reads coded 1440x1080 and drawn 4/3 off both doors, the
  ratio compared reduced because the mkv carries ffmpeg's DAR spelling
  (17280/12960) where the mp4 carries the SAR itself;
- the preview hands out 1920x1080 with picture in every corner (numeric
  gate) and a measured 16:9 display aspect;
- the export re-encodes to the drawn shape, square, the same picture
  the preview showed within encode loss;
- the Matroska copy keeps the aspect beside the coded blocks (read
  back), and the mp4 Exact row refuses in the words 'a copy would lose
  the pixel aspect';
- square files still read one to one, swapped only where their matrix
  turns them.

The HEVC-door tests skip on a machine without the plugin, as
video_copy's decode-back test does.
🐛 demux: close the block walk's unchecked add, and one mkv conventionAhmet Kaan Gümüş · 7a52aa1
🐛 demux: close the block walk's unchecked add, and one mkv convention

Four things the re-verification left behind, each either the same class as what
this lane already fixed or a promise its new text made.

The video block walk's own timestamp -- the one a copy reads -- was still
accumulated unchecked (`cluster_ts + i64::from(block.rel)`), one step before the
scale the subtitle walk widened: a crafted cluster near the top of what an `i64`
holds overflows the add before anything could refuse the product, and the block
is taken at a time that wrapped negative. Both walks now call one `block_ticks`,
and the unit test covers the add as well as both scales.

`VideoMeta::rotation`'s doc listed a spherical projection among the turns refused
at the door, but `projection_rotation` deliberately does not refuse those -- the
pose of a spherical projection is the sphere's orientation, not the picture's --
so the sentence says that instead of claiming a refusal no code makes.

The mkv door fed the *coded* height to the 720-line rule an untagged stream's
matrix is guessed from, where the mp4 door feeds the displayed one. That was
harmless until this lane made the two differ, and then an untagged turned `.mkv`
and its `.mp4` twin landed on different matrices: 1280x640 as stored, 640x1280 as
shown, so bt601 against bt709. Both doors now feed the height the picture is
*shown* at, and `test_rotation90tall.{mp4,mkv}` (generated, untagged in both
containers) pins it -- the assertion fails with the coded height, which was
verified by putting `video.height` back and watching it fail.

And the export test runs on the mkv twin too, because a turn reaches the export
through exactly one number (the source's `Rotation` in the export's rate table),
and only a both-doors test shows a door that reads its own spelling into that
number differently.

cargo check -p engine --all-targets: 0 warnings. cargo test -p engine --test
rotation: 5 passed. subtitles: 22 passed. cargo test -p engine --lib: 392 passed,
0 failed. rustfmt --edition 2024 reports the same nine pre-existing hunks on
demux.rs as base, none in the added code, and none on the test file.
⏪ demux: keep the turn, drop the display size; widen the block walk's ticksAhmet Kaan Gümüş · 9b42f9f
⏪ demux: keep the turn, drop the display size; widen the block walk's ticks

The display-size adoption is reverted: `VideoMeta.width/height` mean exactly
what they meant at base again -- the coded size with the turn applied -- and
nothing reads `pasp`, `DisplayWidth`, `DisplayHeight` or `DisplayUnit` any more.
Reading them without applying the pixel aspect anywhere in the pixel pipeline
made an anamorphic source *worse* rather than better: the canvas of a freshly
opened file is built from `meta.width/height`, while `Render::frame` only rotates
and placement is an aspect-preserving `Fit` of the coded frame, so a 1440x1080
source became a 1440-wide pillarboxed picture inside a 1920x1080 canvas with the
bars baked into the preview and the export; and `CopyPlan::of` hands those two
numbers to `CopyParams`, so an exact Matroska copy declared PixelWidth 1920 while
copying 1440x1080 blocks and dropped the source's display elements -- a file that
plays right nowhere. Anamorphic support is a feature slice (the stretch stage in
`export::place_picture` and in the decode funnel), not a container-reader fix, so
it leaves together with its fixtures and the test that asserted it.

Kept, because they are the defect this lane was chartered for: the Matroska
`Projection` roll is read as the turn it is (`rotation_of_roll`,
`projection_rotation`, with the same refusal by name for anything that is not a
quarter turn) -- now asserted for the mkv twin too, which was generated but read
by nothing before.

And the multiply the subtitle walk had is widened for the block walk a copy
reads: `coded_block`'s `ts_ns` was `block.ts * timestamp_scale` in `i64`, where a
crafted cluster timestamp overflows -- a panic in debug and a negative block time
in release, silently. One `ticks_scaled` now serves both walks, and the unit test
covers both (microseconds at `per_tick` 1_000, nanoseconds at 1).

cargo check -p engine --all-targets: 0 warnings. cargo test -p engine --test
rotation --test subtitles: 4 passed + 22 passed. cargo test -p engine --lib: 392
passed, 0 failed.
🐛 demux: read the turn and the shown size a file states for its pictureAhmet Kaan Gümüş · 30b435d
🐛 demux: read the turn and the shown size a file states for its picture

A Matroska `Projection` roll, the `DisplayWidth`/`DisplayHeight` pair and an
mp4's `pasp` box were read by neither door, so a rotated `.mkv` played and
exported sideways, and an anamorphic source -- HDV's 1440x1080, a DVD's 720x576
with a display width -- probed, previewed and exported squashed. Neither had a
message: both were silent wrong output.

The engine could already turn a picture (`scale::rotate_i420_90s`) and already
collapsed a file's coded size into its displayed one off an mp4 `tkhd` matrix.
Both doors now do the same two steps in the same order: the size the file says
the picture is shown at, then the turn. The roll is *negated* to get the quarter
count -- it counts counter-clockwise degrees where the matrix counts clockwise
turns -- and that direction is measured, not derived: the new
`test_rotation{90,180,270}.mkv` fixtures are the same quadrant source as their
`.mp4` twins (one `ProjectionPoseRoll` of +90, +180, -90, byte-verified by
walking the header), ffmpeg reads each back as the same display matrix, and both
autorotate to the same four corners -- which is what `tests/rotation.rs` asserts
corner by corner, through the preview funnel as well as the probe.

A rectangular projection mirrored or tilted out of its own plane is refused by
name like the mp4 door refuses a 45-degree matrix: mkvmerge v95 states a mirror
with a yaw, and a picture out of plane has no rendition here. A spherical
projection's pose is left alone -- on those the same elements describe the
sphere, and a flat player shows a 360 file rather than refusing it.

The subtitle walk's tick arithmetic is widened to `i128` and made fallible: the
multiply is where a corrupt cluster timestamp overflows, a panic in debug and a
negative cue time in release, silently.

Fixtures live in `assets/`, which is gitignored and symlinked to the shared pool,
so they are generated rather than committed: `scripts/gen_fixtures.sh` writes
both the mkv turns and the anamorphic pair.

Still open, and not made worse here: the anamorphic *placement*. `Composer`
letterboxes, so a 1440x1080 picture in the 1920x1080 canvas the file states gets
bars rather than its samples stretched to the shown shape -- the stretch belongs
in `export::place_picture` after its turn, and in the decode funnel for the
preview.

2026-09-18

🐛 fix(media): audio routing, session audio re-arm, hw trailing-zero NALs, display-matrix rotationAhmet Kaan Gümüş · bc8b82e
🐛 fix(media): audio routing, session audio re-arm, hw trailing-zero NALs, display-matrix rotation

- is_audio admits .mpeg/.mpg so mp3-with-cover files import (was fed to Mp4Demuxer)
- session audio walks past trackless leading sources and re-arms when a
  sounding file joins a silent timeline (fixes add/remove/add silence)
- engine-hw pump clears trailing cabac_zero_word bytes instead of dying
  with code -2; export falls back to software decode before first frame
- tkhd display matrix read for mp4; 90/180/270 turns baked into preview
  and export pixels; other angles refused by name (UnsupportedRotation)

2026-09-12

✨ feat(engine): both Opus seats are ec-opus natives — the library pair is goneAhmet Kaan Gümüş · 597e096
✨ feat(engine): both Opus seats are ec-opus natives — the library pair is gone

The decode seat (SymDecoder::Opus) and the encode seat (encode_opus) move
off ruopus 0.1.2 / opus-rs 0.1.26 onto the codec family's own ec-opus, the
first path dependency across into the sibling edith_codecs workspace. Both
replaced crates leave Cargo.lock with everything they pulled in.

What the swap is measured to do, not hoped to do:

* decode equivalence: a real 5.1 stream decodes to correlation 1.000000
  between the two decoders, and the film seek witness lands on the same
  samples it always did — the 312-sample pre-skip corrections hold unchanged,
  so no constant moved.
* the 128 kbps cap goes to 320, the Sound row's top: opus-rs's packets above
  ~165 kbps were noise to every decoder but its own (re-measured: 0.011
  correlation at 320 through BOTH decoders), and that cliff is the only thing
  the old ceiling stood on. ec-opus's 320 kbps packets read back identically
  through ruopus and through ec-opus. Fidelity at the top of the new band:
  0.9999 (stereo 320), mono 0.9999-1.0000 (was 0.9983-0.9987 at 128).
* mono leaves as Opus now. opus-rs mis-encoded mono at every rate, which is
  what kept a mono mix on the AAC path; a_mono_mix_leaves_as_opus_too pins
  the new behavior and the export.rs unit suite round-trips mono at 96 and
  256. The muxer's family-0 OpusHead needed no change: it already wrote
  mono.
* performance, measured honestly (release, min-of-7 alternating, against
  ruopus WITH the spectrograms/FFT backend the product actually shipped):
  ec-opus is ~1.4-1.7x SLOWER on every path — 5.1 decode 246x realtime
  where ruopus managed 407x; the export seat (encode plus its mandatory
  fidelity decode) 0.27 s against the old seat's 0.18 s per 30 s of stereo.
  Both stay far past realtime (>=88x), so nothing is user-perceptible, but
  the >10% bar is not met numerically; the swap stands on the
  dependency-freedom goal, and the family decoder has the headroom to close
  the gap. KNOWN-OPEN, not silently accepted.
✨ feat(engine): software VP8 decode via dlopen'd libvpx seat in the pluginAhmet Kaan Gümüş · ba33df0
✨ feat(engine): software VP8 decode via dlopen'd libvpx seat in the plugin

VP8 was refused by a stale UNSUPPORTED claim ('no VP8 decoder'); the
vendored cros-codecs VP8 decoder is VA-API-only and the test GPU
exposes no VP8 VA-API profile, so the real seat is software: libvpx.so.9
dlopen'd inside libengine_hw.so (vpx.rs), routed before any GPU device
opens, seek = destroy+re-init on the demuxer's keyframe contract,
CAP_VP8 reported as the plugin's seat. Codec::Vp8 plumbed through
demux (V_VP8 + mp4 vp08), colorspace, refusals; export UI gains a
truthful read-only VP8 row; test_vp8.{webm,mp4} fixtures + capability
row + tests/vp8.rs decode/export twins. Verified by the authoring
session: headless playloop 270 frames 0 dropped, 50/50 seeks, live
harness-driven UI playback, cross-provider review PASS (FFI layouts
against shipped libvpx DWARF, valgrind-clean).

2026-09-06

🐛 fix(engine): a QuickTime .mov keeps its AAC — read v1/v2 sound descriptionsAhmet Kaan Gümüş · 7fbbd0f
🐛 fix(engine): a QuickTime .mov keeps its AAC — read v1/v2 sound descriptions

A Resolve export (qt brand) opened with no sound: mp4 0.14
reads the mp4a sample entry as ISO only, skipping the 8 bytes QuickTime
uses for version/revision/vendor, so a version-1 SoundDescription's
16-byte tail was taken for the first child box and the wave-wrapped esds
behind it never seen -- "trak[2].stbl.esds not found", and with it every
Resolve / Final Cut / `ffmpeg -f mov` file. Vendored mp4 0.14 under
vendor/mp4 (patch table entry, workspace exclude): Mp4aBox::read_box now
reads the version, skips the v1 tail or takes rate/channels from the v2
block, and finds the esds directly or inside `wave`; the crate's ten
lint warnings cleaned with it. New fixture assets/test_qt.mov (ffmpeg -f
mov, same 440/880 tone) and a test in audio_decode that fails on stock
0.14 and passes here.

Verified in the harness on a Resolve export: opens with picture and waveform,
plays (sink RMS -26.9 dBFS), seeks to 00:10 and plays the right audio
(captured peak -11.109 dBFS = source's own). Workspace suite 981/987;
the six failures are five load flakes that pass serially and one
pre-existing failure on clean main (audio_multi layout refusal), logged.

2026-08-26

✅ test(engine): DEBT #64 — prove AC-3 opens out of a standalone .mkaAhmet Kaan Gümüş · ba541e9
✅ test(engine): DEBT #64 — prove AC-3 opens out of a standalone .mka

crate::demux::is_matroska already admits .mka (since 810ded2), so
Track::open already routes an AC-3/E-AC-3 .mka through the same
MkvAc3Track door test_ac3.mkv uses -- the debt's routing gap was
already closed in code, just never proven by a fixture or a test.
Adds test_ac3.mka (2s 440Hz sine, ac3, 2ch 44100) to gen_fixtures.sh
and a test in audio_files.rs asserting it decodes non-silent stereo
audio at the right rate.
🐛 fix(app,engine): pay debts — audio-only fallbacks, panic-proof proxy, .part sweepAhmet Kaan Gümüş · b05a649
🐛 fix(app,engine): pay debts — audio-only fallbacks, panic-proof proxy, .part sweep

Twelve debts paid in one batch:

- engine: NoVideoTrack fallback at every video door — open_stream,
  open_project scaffold, and import() now route a video-extension file
  whose header holds no picture to the audio-only path instead of
  refusing (argv open, saved-project reload, and library import).
- engine: proxy/export worker wrapped in catch_unwind — a decoder panic
  settles the shared slot with Err instead of stranding Making/Cancelling.
- vendor/cros-codecs: AV1 setup_shear multiplies checked — malformed warp
  params are a parse error, not a process abort (live-proven on an AV1 film:
  clean PROXY FAILED notice, slot released, app alive).
- engine: startup sweep of orphan proxy .part files.
- app: Player::has_video probe cache — lane_refuses gates drops on the
  probed kind, not the extension; Silences hidden on soundless clips;
  audio import toast names rate/channels/length; stale no-session proxy
  label cleared.
- tests: audio-only mp4 fixture + gen_fixtures.sh line, 2 engine
  NoVideoTrack tests, toast/lane/view cases (246 bin + 14 audio_files).

Harness-proven this batch (runs 20260826-2306..2315): split-at-playhead
with undo, lane-remove mouse door, fade-out drag, argv audio-only open,
AV1 proxy clean failure.

2026-08-12

✨ feat(audio): convert wide layouts and off-rate sources at import instead of refusingAhmet Kaan Gümüş · c94ba8b
✨ feat(audio): convert wide layouts and off-rate sources at import instead of refusing

An 8-channel Opus track came back "IMPORT FAILED: unsupported channel
layout: 8 channels (max stereo)" and took the picture with it, and a
48 kHz file "audio 48000 Hz 2 ch does not match the timeline's 44100 Hz
2 ch". Both strings are gone: an import converts.

Width: `fold_5_1` becomes `downmix`, a coefficient table per layout from
2.1 to 7.1 (ITU-R BS.775 — front channels keep their side, centre and
surrounds join at -3 dB, LFE dropped, both sides normalised by their own
coefficient sum so a full-scale source cannot clip). 5.1 comes out of the
table bit-identical to what it was. `vorbis_to_film_order` gains the RFC
7845 permutations for 3, 5, 7 and 8 channels beside the 6 it had, so
surround Opus at any width reaches the fold in the order the fold reads.
The AC-3 decoder's own 2.1 passthrough, which it leaves at 3, folds here
too, and a multichannel AAC track in an *mp4* now takes the `rusty_aac`
route the Matroska side already had (`aac_decoder`, one call for both).

Rate: the segment resampler a speeded clip already goes through takes the
source rate over the timeline's into its step, so the two compose into one
interpolation and 48 kHz onto a 44.1 kHz timeline keeps its pitch. All of
it is convert-on-read — per packet in the decoder, per buffer in `emit`,
after the window trim — so there is no upfront pass to show progress for
and nothing to cancel.

What is still refused is the layout alone: a mono track cannot join a
stereo timeline, in the words "audio 1 ch does not match the timeline's
2 ch". The picker's grey-out rule follows the gate rather than leading it.

Measured on a 12.9 GB 2160p AV1 remux with a real-library 7.1 Opus
track: imports, opens as a timeline, and a ten-second WAV export comes
back at RMS 0.0091 left / 0.0085 right.
🔒 chore(privacy): the tests name a key, the machine names the fileAhmet Kaan Gümüş · a893c91
🔒 chore(privacy): the tests name a key, the machine names the file

Nothing in this tree says what is in anybody's library or where it lives.
The handful of tests that are worth nothing against a fixture -- a real
HDR10 grade, a header-stripped BluRay remux, a disc's PGS tracks -- asked
for absolute paths written into their source, and the comments around them
recorded which films the measurements were taken on.

Both go. `engine::real_library::film(key)` reads `real_library.toml` at the
workspace root, which is gitignored: three logical keys named for what the
file *is* (`hevc_4k_hdr`, `h264_dual_audio`, `hevc_4k_pgs`), mapped to
wherever that machine keeps them. A missing manifest, a missing key or a
missing file each say so on stderr and the test passes, which is the
existence gate every one of these already had, in one line instead of five.
`real_library.toml.example` documents the shape and what each key must be.

The comments keep the technical fact and lose the title: a peak of 1759
cd/m^2 is still 1759, the 37 BCP-47 elements are still 37, and the Opus
pre-skip is still measured against ffmpeg -- on "a real 5.1 Opus remux"
rather than on a named one. The synthetic paths in the app's unit tests
("/films/…") were never real and are now anonymous too.
✨ feat(subtitles): as many tracks as you want, embedded in the exportAhmet Kaan Gümüş · 28e2853
✨ feat(subtitles): as many tracks as you want, embedded in the export

Subtitle tracks now work the way audio and video tracks do: add as many
as you like, remove any of them, and every track with cues on the
timeline is written into the exported file.

Add and remove
- "+ S" beside "+ V"/"+ A" imports every subtitle track in a picked
  file; each row carries its own "x". Pointer and keyboard doors share
  one implementation and refuse identically, before any chooser opens.
- Project::remove_subtitles / PlaybackSession::remove_subtitles, with
  the index fixup in one place so a removal cannot repoint the overlay.

Embedded in the output
- ExportSettings.subtitles is a list; the Matroska muxer writes N tracks
  from number 3 up, ceiling derived from the encoding (0x7F -
  SUB_TRACK_FIRST) because track 127 is the all-ones VINT our own reader
  maps to "unknown" and would silently lose.
- mp4 carries them too, as real tx3g timed text. The old "an mp4 carries
  none" was a false refusal: mp4 0.14 has MediaConfig::TtxtConfig all
  along. Samples are built from cue boundaries, so gaps are empty
  samples and the track spans the film.
- of_mp4 reads them back, so edith re-imports its own output. Verified
  against a file ffmpeg muxed, which writes mdhd in microseconds where
  we write milliseconds.
- The export set is derived from timeline_cues per call, so it cannot
  desync; the card names a track it leaves off, and counts past the
  width budget rather than eating the card.

Language and title
- SubtitleTrack carries language and name apart; the guess-them-back
  heuristic is gone. LanguageBCP47 is read and mapped to a 3-letter code
  (ffmpeg reads no BCP-47 at all, so writing it would have made the
  language invisible). A 17-track subtitle library file and a
  dual-language one no longer read "und".

Media bitrate in properties
- engine::probe_bitrate opens no decoder; all three numbers share the
  container's duration, so total >= video + audio holds by construction.
  Within 0.004% of ffprobe across the library.
- Both properties cards show it; a dual-audio file says which of how
  many. The line picks one unit off its smallest stated component, so a
  real value never renders as 0.00.

Off the render thread
- The subtitle walk moved to the background executor at every door:
  1324ms -> 0.1ms on a 3.1GB film, 234ms -> 5.0ms on a 25.4GB/35-track
  one. (The media walk is still on the render thread; separate slice.)

False refusals removed
- .mks and .mka were refused while the compiled-in Matroska reader
  parses them; is_matroska now takes the standard's closed set.
- The audio-only "sound alone" sentence was unreachable when every pick
  was a bitmap track.

Subtitle-free exports stay byte-identical: 294a8b0c (hevc mkv),
8c16b8b1 (default mp4).
🐛 fix(audio): a seek into a Matroska lands on the second it asked forAhmet Kaan Gümüş · 702501a
🐛 fix(audio): a seek into a Matroska lands on the second it asked for

A film played 1.47 s further in than the timeline said after a scrub to
600 s, 3.39 s after one to 610 s -- sound against picture, the oldest
complaint in this project, and the Matroska half of the mp4 fps truncation
that was fixed once and never swept.

One symphonia mkv seek does not land where it is asked to. It goes through
the cue table and stops at the first frame at or *past* the cue's cluster:
asking for 599.83 s on a 2h+ AV1/Opus 5.1 mkv landed the
reader at 601.487 s, asking for 609.83 s at 613.407 s, and on the new 30 s
fixture asking for 25 s lands
at 29.987 s. Samples that far behind a reader cannot be reached by any
window rule downstream, so `emit` had nothing to trim and the film simply
played from the landing while the clock counted from the request.

So the landing is read back and an overshoot is asked again from far enough
before it to swallow the overshoot, and every attempt gets a *new reader* --
symphonia's mkv seek is reliable exactly once per reader: it hands out the
frames it had already queued (they arrive carrying the old block's
timestamp) and its element iterator does not recover, so a second seek on
one reader landed back at the file's first cluster, 0.094 s, whatever it was
asked for. That is a *clip* of a film, and at HEAD the second clip of a
two-clip timeline came out with no audio at all. Opening again costs 2 ms on
a 5 GB film.

Seeking to the beginning is now not seeking: that seek is how the first
167 ms of the same film went missing at open, and 2.35 s more of it at 27 s,
where the iterator left inside a cue's cluster ran on into the wrong one.

Two smaller things the trimming needed to be right at all. A packet's own
timestamp cannot carry the decode position: the frames of one laced block
all share the block's, so the position accumulates from the decoder's count
between blocks, which is what both mp4 readers here already do. And the
pre-skip comes off a landing timestamp, because an Opus track's blocks are
timestamped for the audible stream while the decoder hands its samples back
with the pre-skip still in front of them -- 6.5 ms, measured.

Measured against an ffmpeg decode of the same window, envelope correlation,
real files. A 2h+ AV1/Opus 5.1 mkv at
600/610/1200/5400/6000 s: +1.474/+3.393/+0.094/+0.073/+0.094 s before, ≤1 ms
after. An HEVC/AAC 5.1 mkv at 610 and 1200 s: +2.054/+1.856 before, 0.000
after. An H.264/AAC mkv and an AC-3 mp4 were already exact and stay exact --
the mp4 tables never had this to get wrong. A/V skew after a seek on the AV1
mkv: -0.007 s at 600 s, -0.005 s at 5400 s. The video path was measured at
the same four positions and lands on the requested frame.
🔊 feat(audio): an Opus film is heard, not refusedAhmet Kaan Gümüş · 699950a
🔊 feat(audio): an Opus film is heard, not refused

The refusal was the bug again. `is_audio` said "no opus, ac3 or dts, for
which no pure-Rust decoder exists" while symphonia's own mkv and ogg readers
have always mapped `A_OPUS` and `OpusHead` to `CODEC_ID_OPUS`: the containers
read the format, only the decoder was missing. Symphonia genuinely has none
at any version -- its feature list stops at vorbis and there is no
`symphonia-codec-opus` crate -- so the decoder is `ruopus`, pure Rust, MIT,
no dependencies of its own, and the film plays.

Which crate is not a coin toss. A 5.1 track is four elementary Opus streams
in one packet, all but the last self-delimited (RFC 6716 App. B).
`rusty-opus 0.9.1` -- the sibling of `rusty_aac`/`rusty_mp3` already here --
hands each self-delimited slice to a decoder that parses it as an ordinary
packet, so every stream but the last reads the length prefix as payload: it
was measured on a 5.1 Opus remux as full-scale noise at -13
dBFS over a passage where the film is silent, which is exactly the failure
that "the decoder returns samples" would have shipped. `ruopus` matches
ffmpeg's decode of the same file to a correlation of 1.00000 on all six
channels.

Two things that are Opus's alone: it is stored in Vorbis channel order
(FL, FC, FR, BL, BR, LFE) and the 5.1 fold reads the film order every other
decoder here hands back, so the frame is permuted before it folds; and its
encoder delay lives in the stream (`OpusHead`'s pre-skip, 312 samples) where
neither reader drops it, so that is this track's priming -- sample-exact
against ffmpeg afterwards, 6.5 ms late before.

`.opus` and `.mka` join `is_audio`, `unsupported` asks the other reader
before naming a codec (a refusal that fires on a track which decodes is the
same defect wearing the other face), and `capability_matrix` covers Opus per
container with DTS left as the one live refusal row.
🐛 fix(decode): a film's grain is synthesized into a surface of its ownAhmet Kaan Gümüş · c52b667
🐛 fix(decode): a film's grain is synthesized into a surface of its own

An AV1 frame with `apply_grain` set is *displayed* from a second surface:
the driver writes the reconstructed picture into the render target, which
later frames reference, and the grain-synthesized one into a target the
decoder has to hand it. The vendored backend handed it none -- it passed
`VA_INVALID_SURFACE` as `current_display_picture` while still asking, in
the very same buffer, for the grain -- and radeonsi refuses that picture
outright: `vaEndPicture` answers VA_STATUS_ERROR_INVALID_SURFACE.

That is what killed the only AV1 film in the library at frame 49, its
first picture with grain; 1337 of the first 1504 have it, so AV1 playback
on real media had never worked. Every fixture that said otherwise was
grainless, which is why `test_av1_grain.mkv` is now beside them and why
its test decodes all ninety frames and then asks whether the grain
actually reached the picture -- turning `apply_grain` off would make the
decode succeed too, and would silently strip the film of its texture.

A grainy picture costs two pool frames rather than one, so a sequence
whose header admits grain gets a pool of twice the size; one that does
not is left exactly as it was, as are H.264, HEVC and VP9, which have no
such surface and read back the reconstructed one as always.
🐛 fix(demux): a codec's support is probed per container, not inferred from a neighbourAhmet Kaan Gümüş · 4f4dcb4
🐛 fix(demux): a codec's support is probed per container, not inferred from a neighbour

VP9 was decodable out of an mp4 and refused out of a .webm — `V_VP9` fell
through the Matroska track dispatch into `OtherVideo` and came back as
"V_VP9 video in a Matroska file is not supported", with the VA-API VP9
decoder wired in `engine-hw` the whole time. A browser-downloaded .mkv was one of those
files.

Both dispatches now read one table (`CODEC_IDS`), and the Matroska arm
matches on `Codec` with no wildcard, so a codec added to the enum fails
to compile until it has been routed rather than falling through to a
refusal. A cell that is deliberately absent is a row in `UNSUPPORTED`
with a reason, and the refusal quotes that reason instead of listing
what is supported and leaving the user to guess.

The mp4 video track comes out of `moov.traks` in file order, not a
`HashMap` walk of `Mp4Reader::tracks()`: a file with two video tracks
opened on a different picture from one run to the next, and a saved
.edith reopened on the other one. `audio::audio_track_ids` fixed the same
trap for sound; the naming half of `AudioSession::unsupported` had it too.

VP9 states its bit depth in no container record — an mkv `TrackEntry`
carries none and an mp4's `vpcC` is optional — so it is read off the
first keyframe's uncompressed header. Assumed 8-bit, a profile 2 stream
would decode into an NV12 pool and come back as garbage; 12-bit is
refused by name like 12-bit AV1 and HEVC.

The audio refusals said "AAC and AC-3 only" long after FLAC, MP3, Vorbis,
ALAC and PCM decoded out of a Matroska file. They name the real set now,
per container, because an mp4 video's sound never reaches symphonia and
reads fewer codecs than an mkv does.

tests/capability_matrix.rs holds all of it against real files.

2026-08-11

✨ feat(tonemap): the reference rendition converts a film at the peak the film declaresAhmet Kaan Gümüş · 27097e2
✨ feat(tonemap): the reference rendition converts a film at the peak the film declares

`Demuxer::light().peak()` -- a stream's MaxCLL, or its mastering display's
maximum -- has been read at every open and dropped on the floor. It now reaches
`ToneMapper::new` as `declared_peak`, and `Preset::master_nits_for` is the whole
composition rule: `Reference` takes the film's number (1000 stays the fallback
for a file that declared nothing), `Standard` and `Vivid` keep their fixed 400
and 250, because a picked exposure that moved per file would not be a pick.

One HDR film declares 1759 cd/m^2, so its 1000-nit highlights
land at SDR 215 instead of clipping at white, and BT.2408 diffuse white at 145
instead of 166.

Both sites that build a table have the demuxer in hand already, so nothing is
promoted through `VideoMeta`: the decode funnel reads it before the worker takes
the demuxer, and `source_rate` returns it off the header parse export already
did -- which is what keeps preview and export on one number.

A declared peak is a stranger's number and is checked before it becomes a
divisor: outside 100..=10000, or a NaN, is treated as not declared.

test_hdr_bright.mkv joins the fixtures for it -- the older HDR metadata ones all
say 1000, which no picture can tell apart from the fallback.
✨ feat(demux): a film's real peak brightness is parsed, not assumedAhmet Kaan Gümüş · 5726307
✨ feat(demux): a film's real peak brightness is parsed, not assumed

MaxCLL/MaxFALL and the mastering display's luminances, off all three
places they live: a Matroska Colour element (0x55BC/0x55BD and the
MasteringMetadata floats behind 0x55D0), an mp4 sample entry's clli and
mdcv boxes, and -- for the web rips where the container carries none of
it -- the HEVC SEI messages of the same names in the first access unit.

Carried on Demuxer::light() as ContentLight, whose peak() prefers the
measured content light over the display the grade was approved on.
Nothing reads it yet: wiring it into the tone map, which today assumes a
constant, is its own change.
✨ feat(color): an HDR film reaches the window tone-mapped, and an SDR one is untouchedAhmet Kaan Gümüş · f8dea1c
✨ feat(color): an HDR film reaches the window tone-mapped, and an SDR one is untouched

The tone map existed and nothing called it: a PQ or HLG stream was
converted with its own matrix and then shown as if its curve were SDR --
flat, grey-washed, half the brightness a player gives it. `Render` now
builds one `ToneMapper` per stream (the transfer is a property of the
file, and the LUT is float work over 9 537 nodes) and maps the source
planes into BT.709 SDR before anything else looks at them, in both
branches of the funnel: the fused passthrough conversion and the
graded-then-placed one.

The grade lands *after* the map, on the one scratch copy the placed path
already made -- a look means what it says in the SDR a viewer is shown,
not in the ten stops the file was in. An SDR stream takes neither the
copy nor the map and is byte for byte the picture it was, asserted
against hashes measured before this change (`tonemap_render`).

`MASTER_NITS` is 400, not the 1000 an HDR10 grade is mastered to. Told
1000, BT.2446 Method A puts 203-nit diffuse white on code 166, which
reads as broadcast-dark; told 400 it lands on 205, which is the
brightness mpv shows. The anchor tests carry the recomputed codes rather
than wider tolerances, and HLG's OOTF now follows the assumed peak
through BT.2100's own log term -- its relative diffuse white is 19% of
whatever peak the display has, so it comes out at 170 and no longer
agrees with PQ's absolute 203, which is the standard's behaviour and is
written down beside the assert.

Measured on the real 4K HDR10 film (`hw_decode`, existence-gated): frame
3000 saturation 34.8 -> 98.9, mean luma 107.6 -> 122.2, and 32.5
ms/frame for the map plus the conversion at 3840x1600, inside the 39 ms
budget. New fixture `test_pq.mp4`: four flat patches whose codes are
written into the planes by hand, so a test names the code it feeds and
the code it expects back.
✨ feat(colorspace): a file says which matrix and curve its numbers are in, and edith reads itAhmet Kaan Gümüş · 070ffe6
✨ feat(colorspace): a file says which matrix and curve its numbers are in, and edith reads it

Three tiers, per field: the container's own tags (Matroska `Colour`, mp4
`colr`), then the bitstream's (H.264/HEVC SPS VUI, AV1 `color_config`),
then the ffmpeg/mpv resolution rule -- 720 lines or taller is BT.709,
below it BT.601, limited either way. A code that says nothing, or says
something with no implementation here, falls to the next tier rather than
answering wrongly.

`VideoMeta` carries the answer; nothing consumes it yet. Everything still
renders through the hardcoded BT.601 it always did, which is the bug this
is the foundation for fixing.

The bit-level walks are where this can quietly go wrong: an SPS whose
scaling lists are counted wrongly lands the VUI read in the middle of a
coefficient. Both are measured -- H.264 and HEVC against hand-built
parameter sets (no encoder here writes SPS scaling lists), the rest
against fixtures tagged in the container, tagged only in the bitstream,
and tagged nowhere, plus the two real films: a 4K HDR remux that reads
BT.2020/PQ and a fully untagged 720p one that reads BT.709.
✨ feat(audio): every audio track of an mkv is a row, and the second one playsAhmet Kaan Gümüş · 264c10c
✨ feat(audio): every audio track of an mkv is a row, and the second one plays

A Matroska file was worth exactly one audio stream here -- whichever
track the readers stumbled on first -- so the second language of a
dual-audio remux was invisible and unopenable, and no mkv ever showed
what language its sound was in.

The header walk now collects every audio TrackEntry in file order with
its number, codec id, TrackLanguage and TrackName
(demux::matroska_audio_tracks), and that list is what a stream index
counts in. The index picks an entry, the entry's *track number* is what
each reader is then pointed at -- MkvAudio::open_track for the AC-3
blocks, SymTrack::open_track for symphonia, whose mkv reader keeps the
same number as its track id -- so the two readers cannot disagree about
which track a stream meant. Stream 0 is still the file's first audio
track, sample for sample.

Rows name their codec from the container rather than from symphonia's
registry: the tracks that most need naming are exactly the ones it has
no decoder for, and "opus is not supported" beats "an unsupported
format".

Fixture: test_multiaudio.mkv, two AAC tracks, eng 440/880 Hz and fra
220/330 Hz -- different tones because a mapping that drifts plays the
other language.
Merge remote-tracking branch 'origin/main' into worktree-agent-ab6959260e5ee211cAhmet Kaan Gümüş · 2eb309b
Merge remote-tracking branch 'origin/main' into worktree-agent-ab6959260e5ee211c

# Conflicts:
#	scripts/gen_fixtures.sh
Merge remote-tracking branch 'origin/main' into worktree-agent-ab6959260e5ee211cAhmet Kaan Gümüş · 0776b46
Merge remote-tracking branch 'origin/main' into worktree-agent-ab6959260e5ee211c

# Conflicts:
#	crates/engine/src/audio.rs
✨ feat(av1): 10-bit AV1 opens instead of being refusedAhmet Kaan Gümüş · 25aef8c
✨ feat(av1): 10-bit AV1 opens instead of being refused

The `av1C` record's `high_bitdepth` was an outright refusal ("10-bit AV1 is
not supported yet"), on a comment that had gone stale: the vendored decoder
takes its RT format from the stream and maps Depth10 to YUV420_10, and the
plugin's read-back pool is P010 whenever the demuxer says >8 -- which is how
HEVC Main 10 has been playing all along.

So `parse_av1c` reads the depth instead of refusing it, in both containers
(the mp4 `av1C` box and the Matroska `CodecPrivate`), and 12-bit stays
refused by name in the words HEVC's own depth check uses. Nothing else needs
the plugin any differently: AV1 has no software decoder at any depth, so a
machine without `libengine_hw.so` still refuses it as `needs_plugin` always
has.

Fixture: assets/test_av1_10.mkv (libaom, yuv420p10le), the AV1 seat of the
pair test_hevc.mkv/test_hevc10.mkv already make for HEVC.
Merge remote-tracking branch 'origin/main' into worktree-agent-ab6959260e5ee211cAhmet Kaan Gümüş · 1e8c454
Merge remote-tracking branch 'origin/main' into worktree-agent-ab6959260e5ee211c

# Conflicts:
#	crates/engine/src/audio.rs
#	crates/engine/src/demux.rs
#	crates/engine/tests/audio_decode.rs
#	scripts/gen_fixtures.sh
✨ feat(engine): subtitles come in with the film or beside itAhmet Kaan Gümüş · f4b5fd8
✨ feat(engine): subtitles come in with the film or beside it

A subtitle track was a track this engine walked past: the Matroska track
walk kept video and audio and dropped type 0x11, and a `.srt` next to the
media was a file with no door. Now both arrive as the same thing -- a
list of timed cues -- and a project keeps them.

`subtitle`: the cue model plus the two ways in. Standalone `.srt`,
`.vtt` and `.ass`/`.ssa` go through `oxideav-subtitle` and `oxideav-ass`
rather than through a fresh parser here; an embedded track carries its
timing on the block and its text in it, so each codec is put back into
the shape its own parser reads -- which is what makes an embedded track
and the file it was muxed from come back as the same cues.

What cannot be read is refused by name and still listed: the four PGS
tracks of a BluRay remux are four rows saying they are pictures, not an
empty list and not a file that would not open. A `.srt` that has gone
missing since the save is the same story, and a re-save keeps its row.

`.edith` 10 writes `subtitle <track> <path>` -- the reference only, the
cues stay in the file they came from. v9 and every older dialect load as
the projects with no subtitles that they are.
🔀 merge(A2): H.264 joins AV1 and HEVC in the Matroska gateAhmet Kaan Gümüş · ae661e4
🔀 merge(A2): H.264 joins AV1 and HEVC in the Matroska gate

Both lanes rewrote mkv_track_entry. Main's shape wins -- MkvEntry, the named
refusal, the scratch buffer, bit_depth -- and the H.264 arm is one more entry
in it: parse_avcc beside parse_hvcc, 8-bit as the whole H.264 path here
assumes. The refusal now names all three codecs it does read.
✨ feat(audio): AC-3 and E-AC-3 sound out of a Matroska fileAhmet Kaan Gümüş · a71f015
✨ feat(audio): AC-3 and E-AC-3 sound out of a Matroska file

The "(AAC only)" refusal fired on every A_AC3/A_EAC3 track in an mkv
because a Matroska file's sound reached no reader at all. The blocks of
its first audio track are now indexed beside the picture's and handed to
the oxideav-ac3 decoder the mp4 path already uses, downmix and all.
✨ feat(demux): an H.264 mkv opens like any other fileAhmet Kaan Gümüş · 87953e0
✨ feat(demux): an H.264 mkv opens like any other file

Matroska carried the codec this project decodes best and refused it at the
door: only V_AV1 had an arm. The avcC in CodecPrivate is the same record an
mp4 carries, so the parameter sets come out of it and the length-prefixed
blocks are reframed to Annex-B behind them -- the H.264 dispatch below is
untouched, and so is the AV1 path, whose blocks still go over as they lie.
🔀 merge(T3): mixed frame rates meet mkv HEVC, zero-source survival and the zoomAhmet Kaan Gümüş · 6b5fa2e
🔀 merge(T3): mixed frame rates meet mkv HEVC, zero-source survival and the zoom

`main`'s `open_project` now walks every source with the scaffold in its own
slot (T6), so the per-source `rates` table is built there frame by frame beside
`counts` -- one table in two vectors, grown and shortened together. The codec
gate T1 leans on stays; the frame-rate gate is still gone, and a Matroska file
shot at another rate imports through the very same door an mp4 does, its rate
read off the demuxer's `default_duration`.

Grafted from the losing branch, which had the better arithmetic:

* `Rate::from_fps` is exact. Built on `mux::frame_timing` -- the pair the muxer
  already counts an export's frames in -- divided by that pair and reduced, so
  24000/1001 over 30 is `800/1001` and stays it however far the timeline runs.
  The milli-fps rounding it replaces was a frame off after seven hours; that
  ponytail is gone rather than documented.
* A rate no timescale can *name* is an `Err` in `frame_timing`'s own words
  rather than a silent 1:1, and `matches_timeline` is where a file carrying one
  is refused -- it hands back the `Rate` it accepted the file at, so the number
  the refusal was decided on is the number the file plays by.
* `file_frames` and `file_rate` ask one `source_of`, so a path that names a
  length names a rate too.
* Five more tests in `tests/mixed_fps.rs`, in timeline frames: the exactness of
  the NTSC ratio, a trim of an off-rate clip to the room it was dragged to, the
  neighbouring 30 fps clip still read frame for frame, the linked sound placed
  at its picture's length, and the exported pictures measured against the
  file's own frames rather than merely counted.

...and the note the next builder needs in `copy_audio`: a lane holding a clip
at another rate stays a packet copy on purpose. A clip counts the *timeline's*
frames, so the window the copy trims a source's sound to is whole timeline
seconds and the packets are already in sync; re-encoding it would buy nothing
and cost a generation of loss. A speed is different, and still refused there.

2026-08-10

✨ feat(import): a Matroska film opens, its 10-bit picture and its 5.1 sound alikeAhmet Kaan Gümüş · b083a3b
✨ feat(import): a Matroska film opens, its 10-bit picture and its 5.1 sound alike

mkv HEVC demux (Main/Main10), a P010 pool in the hardware path read back to
I420, mkv audio through symphonia's Matroska reader with rusty_aac decoding
what symphonia's own AAC refuses (anything wider than stereo), and a BS.775
fold of 5.1 down to the stereo the output device takes.

vendor/rusty_aac is 0.5.0 with one local patch: its decoder's IMDCT caches the
cosine matrix instead of calling cos() per term, 11x faster and the difference
between playable and not.
✨ feat(timeline): a clip shot at another rate plays at the speed it was shot atAhmet Kaan Gümüş · 26af1e4
✨ feat(timeline): a clip shot at another rate plays at the speed it was shot at

A frame rate of its own is no longer a refusal at import. Every frame
number in the edit list counts the *timeline's* frames -- a clip's
in/out included -- and a file shot at another rate is converted once, at
the decoder's door: `Rate` (milli-fps rational, `Speed`'s floor/ceil
pair) says which frame of the file a timeline-rate frame is. Playback
opens its worker through it and stamps the pictures coming back through
its inverse; the export walks its span through it after the speed, so a
2x 24 fps clip on a 30 fps timeline is exactly both.

Nothing in `project.rs` changed: placement, trim, split, paste and speed
are the same arithmetic on one clock, and a single-rate project takes
the identity map everywhere it used to take nothing.

A library row now names the *file's* rate rather than the timeline's,
which was true only while every source shared it.
✨ feat(timeline): clips play at a speed of their ownAhmet Kaan Gümüş · f8effe8
✨ feat(timeline): clips play at a speed of their own

A clip gains a rate (`Speed`, thousandths of real time, 0.25x to 4x) and
every speed question is answered at the mapping seams that were already
there: `Clip::frames` is the source range divided by the rate, `end` is
built on it, and `map`/`span_at`/`composite_span_at` walk the offset
through `Speed::source_at`. `in_frame`/`out_frame` stay *source* frames,
so a trim and a split still address the file.

The picture needs no new decoder: the span says how many source frames it
reads, and `try_frame` brings the decoder's numbers back through the same
rate -- at 2x two decoded frames land on one timeline frame and the
display's drop-when-behind policy takes it from there. The sound is
resampled per segment inside the worker playback and the audio export
already share (linear interpolation, carried across packet seams), so the
pitch moves with the rate: tape, not pitch-preserve, and the card says so.
Each segment is told how much timeline it owes and pads or trims to it,
which is what keeps a run of speeded cuts from drifting.

Rounding is where a rate could break the lane, so it does not: `Speed::fit`
never hands a trim more source than its room holds, and `Speed::split_at`
refuses a cut a slow clip's rate cannot address rather than leaving two
halves that no longer add up. The fuzz sweeps set_speed in with the rest.

- card in the eq/colour pattern, on `j` and in the clip menu; a drag is one
  undo step for the whole linked group, 1.00x reachable by hand and by `r`
- clip boxes carry a "2.00x" mark, and their width, waveform and details
  row are the timeline length
- WAV/FLAC honour it; mp4 and AV1 *refuse* by name -- that path copies AAC
  packets and a resample is not a copy (ponytail names the upgrade path)
- .edith v8 carries the rate; v7 and older load at 1.00x
- `assets/test_speed_sync.mp4`: one flash, one beep, same instant. At 2x
  they still land together, to the frame.
✨ feat(timeline): still images import and place as clipsAhmet Kaan Gümüş · 30d430d
✨ feat(timeline): still images import and place as clips

A PNG, JPEG or WebP is a source like any other: it imports into the
library, drags onto a video lane, shows at the playhead, trims, saves and
exports. `engine::is_image` is the door, beside `is_audio`, and every
choice it forces is made in one place.

The decisions, spelled out:

- Extensions: png, jpg, jpeg, webp -- exactly what the `image` crate is
  built with here. Anything else is refused by the door that refuses a
  .txt.
- Length: an image has none, so it is *held to* ten minutes (600 s at the
  timeline's rate) and *placed* at five seconds. The cap is finite on
  purpose -- a u32::MAX sentinel would hand a trim drag a wall past
  anything the timeline can hold -- and it is recomputed identically at
  load, so a clip trimmed out to it reopens.
- Image-first project: its own picture is the canvas (a still *has* a
  resolution, unlike a song) at 30 fps, silent, one 5 s clip on V1. The
  A2 audio-only precedent for everything else.
- Scaling: none of its own. The still is decoded once to I420 and goes
  through the same grade, the same `Composer` and the same conversion a
  decoded picture does, so a 640x360 image on a 1280x720 canvas is
  letterboxed by its fit policy and never stretched.
- Lanes: the mirror of a song. A still goes on the video lane it was
  asked for or on V1, never on an audio one, and never as a grouped take
  -- a clip on A1 playing a PNG is a segment the audio worker cannot
  open. Hand-written projects are refused by name.
- The timeline's audio parameters are now the first source that *could*
  have any, so an image as source 0 no longer holds every later import to
  its silence.

Playback opens a still worker (one conversion, then a memcpy per frame,
as the black-gap worker does); the export's `ClipDecoder` hands the same
planes out for as long as the span runs, so a mixed video/still timeline
encodes at the cut.

tests: engine/tests/images.rs -- import registers only, placed pixels
match the file's own (top/bottom bands catch a flip, RGB order catches a
swap), trim walls at the cap, .edith round trip incl. the audio-lane
refusal, mp4 export pixel-checked at the cut, audio-lane placement lands
on V1. Fixture: scripts/gen_fixtures.sh writes assets/test_still.png.
✨ feat(import): imported files land in the library, never on the timelineAhmet Kaan Gümüş · 5cb33d8
✨ feat(import): imported files land in the library, never on the timeline

An import is not a decision about where a file plays. It registers a source,
notes its native length and stops there; the timeline changes when the user
drags the row onto a lane.

- `PlaybackSession::import`/`import_audio` probe, check and register only,
  returning the source index. No clip, no reseek, and no undo step -- a
  library row changes nothing playable, so there is nothing for `z` to take
  back, and the notice no longer pretends otherwise.
- `PlaybackSession::file_frames` is the native length of a file this session
  has taken in, so a row that has never been placed is placeable at its full
  length. `place_stream_at` takes it from there instead of a `frames`
  argument, and the app drops the clips-derived guesser that returned 0 for a
  source with no clips.
- `PlaybackSession::open_library` is the first import into an empty window:
  the file's canvas, rate and clock over an empty timeline.
- Doors: the Import button, a file dropped on the window and every argv
  argument after the first fill the library. A file *named first* at launch is
  an open, not an import, and still becomes the timeline.
- Fixture + tests: a 25 fps H.264 file, refused by name at both video doors.
🐛 fix(engine): hvc1-tagged HEVC files import tooAhmet Kaan Gümüş · 8dd1c77
🐛 fix(engine): hvc1-tagged HEVC files import too

mp4 0.14 recognises only a hev1 sample entry, so an hvc1-tagged HEVC file -- what Apple and ffmpeg's mov muxer write -- read back as no video track at all. Its sample tables parse regardless of the entry the crate dropped, so the fourcc is read out of stsd by hand and the track is taken as HEVC; the parameter sets come from hvcC either way.
✨ feat(engine): AV1 import via the VA-API pluginAhmet Kaan Gümüş · 6d3e3ba
✨ feat(engine): AV1 import via the VA-API plugin

AV1 arrives in Matroska, never in an mp4 -- `mp4 0.14` knows no `av01`
sample entry at all -- so the demuxer grows a second container:
`MkvDemuxer` walks the EBML itself, indexes every block of the AV1 track
in one header-only pass (payloads are seeked over) and hands each block
to the decoder as the temporal unit it is, with the `av1C` sequence
header re-injected ahead of every keyframe the way the H.264 parameter
sets are.

Matroska indexes neither the frame count nor the frame rate, which is why
that walk exists: the count is the blocks of the track and the rate is
`DefaultDuration` in nanoseconds (33333333 = 30 fps to seven digits,
where the millisecond block timestamps beside it would say 30.30).
Keyframe flags come out of the same pass, so a seek lands on a sync point
without a Cues element and without guessing at the bitstream.

Audio is picture-only for now: a Matroska file is a silent source and
says so by name ("A_AAC audio in a Matroska file is not wired to the
decoder yet") rather than failing in the mp4 reader's words. 10- and
12-bit AV1 are refused at open like HEVC Main 10, for the same 8-bit
read-back reason.

No new dependency: symphonia's mkv reader drops the keyframe flag and
`DefaultDuration` and offers no frame count, so it could not have done
the job. edith keeps its 7 DT_NEEDED entries.
Merge S5a audio-file import into stream-picker mainAhmet Kaan Gümüş · 1bb8ee2
Merge S5a audio-file import into stream-picker main

Both sides taught `audio` a new axis and they meet on one type: S5a made
`Track` an enum over the mp4/AAC reader and symphonia's, main gave every
reader a `(path, stream)` address. The merged `Track::open(path, stream)`
keeps both -- the stream index lives inside `AacTrack::open`, and a
standalone audio file, which has exactly one track by construction, refuses
any stream above 0 rather than quietly serving the only one it has.

- `AudioProbe` is S5a's `{sample_rate, channels}`: equality is playability,
  so an mp3 may share a timeline with mp4s. Copyability is a separate
  refusal, at export, and stays AAC-only through `copy_track`.
- `probe_streams` reads a standalone file through symphonia instead of
  walking it as an mp4 -- an ALAC .m4a parses as an mp4 whose only audio
  track is not AAC, so the mp4 walk would call it undecodable where
  symphonia decodes it.
- Which lane a source lands on is decided once, in `place_stream_at`: a
  file with no picture is placed on the audio lane alone, everything else
  is pasted as a grouped take. The front-end only owes the refusal notice.
- `unsupported()` and the NTSC/VP9 work are untouched; `is_audio` files
  never reach the former, since a song cannot open a timeline at all.
✨ feat(engine): HEVC import via the VA-API pluginAhmet Kaan Gümüş · 85c152d
✨ feat(engine): HEVC import via the VA-API plugin

The demuxer takes a hev1 track alongside avc1 and vp09. Its parameter sets are
read out of the file by hand: mp4 0.14 reads one byte of hvcC and skips the
rest, so the VPS, SPS and PPS an HEVC decoder cannot start without are
unreachable through the crate. A small ISO-BMFF walk finds the track's hvcC and
the record gives both the parameter sets and the NAL length prefix width -- the
avcC one is now read the same way instead of assumed to be four bytes, which is
one hardcoded guess less on the H.264 path too.

Samples are repacked to Annex-B exactly as H.264's are, parameter sets ahead of
every sync sample, because a hardware decoder that joins the stream at a seek
has nothing else to configure itself from.

Main 10 is refused at open by name: the plugin's NV12 pool and its vaGetImage
read-back are 8-bit, and a 10-bit stream decoded into them would be garbage
shown as a picture rather than an honest no. Same reasoning as the software
refusal, which is now one message shared by every codec that has no software
decoder at all.

The C ABI is unchanged again: the plugin demuxes the file it is given, so an
older libengine_hw.so still loads, still decodes H.264, and simply returns null
for an HEVC path.
✨ feat(engine): common audio files import and playAhmet Kaan Gümüş · fe53979
✨ feat(engine): common audio files import and play

mp3, wav, flac, ogg-vorbis, ALAC and ADTS join a timeline as sources with
no picture: symphonia's own probe reads them, the audio lane holds them,
and the video lane refuses them by name. The mp4/AAC path is untouched --
it is still the only one that yields packets an export can copy, so a
timeline carrying anything else is refused at export with the file and its
format named rather than exported silent.

A source with no picture is as long as it plays, rounded up to whole
frames; import, load and the library row all derive its length from that.
✨ feat(engine): VP9 import via the VA-API pluginAhmet Kaan Gümüş · 03a34d3
✨ feat(engine): VP9 import via the VA-API plugin

The demuxer takes a vp09 track alongside avc1 and hands its samples through
untouched -- an mp4 VP9 sample is a self-contained superframe, so there is no
avcC repack and no parameter sets to re-inject. VideoMeta carries the codec,
and the plugin picks its cros-codecs decoder from it.

The C ABI is unchanged on purpose: the plugin demuxes the file it is given,
so the codec is a property of the container rather than of the call, and a
libengine_hw.so built before this still loads and still decodes H.264 -- it
simply returns null for a VP9 path, the same no it gives for an unsupported
profile.

There is no software VP9 decoder to fall back to, so a VP9 file the plugin
will not take is refused at open, by name, where the front-end can show it --
never a black screen, and never VP9 bytes fed to rusty_h264. One timeline
stays one codec, and export re-encodes to H.264 as before; only audio is
ever copied packet for packet.