forge
Explore
Log in

Don't you dare go Hollow

Commits

Commits on 8c7bf808ae19e1655737ac07a94de22b5002565f

2026-08-09

🧹 chore(playback): S6 follow-ups — epsilon frame conversion, drop dead frames()Ahmet Kaan Gümüş · 79c1a91
🧹 chore(playback): S6 follow-ups — epsilon frame conversion, drop dead frames()

secs_to_frame with 1e-6 epsilon: bare truncation landed one frame
early for boundary seconds (122.999... -> 122); floor semantics kept
for mid-frame positions. frames() getter had zero callers since the
app moved to try_frame().
✨ feat(app): clips lane — cut/delete/undo, drag-scrubAhmet Kaan Gümüş · 5372bfd
✨ feat(app): clips lane — cut/delete/undo, drag-scrub

- clips lane: one box per clip, proportional widths, click-select,
  ACCENT-tinted selection; plain divs keep spacebar focus
- keys c (cut at playhead) / x or delete / z (undo) + drawn buttons;
  is_held guards all four against auto-repeat editing
- drag-scrub on the root div (gpui has no mouse capture — release
  outside the window is caught by clearing scrub on a moved event
  with no left button); throttle: seek only on frame change + 100ms,
  always commit on release
- cached duration deleted — timeline_duration() dynamic, so delete
  shrinks ruler and timecode immediately
✨ feat(playback): edit-list traversal — timeline frames, cut/delete/undoAhmet Kaan Gümüş · 7d2251c
✨ feat(playback): edit-list traversal — timeline frames, cut/delete/undo

PlaybackSession owns a Project. try_frame() rewrites every frame index from
source to timeline and reopens the next clip's range when a worker ends, so a
timeline of clips plays as one contiguous sequence; is_eos() is the real end.
seek() maps timeline seconds through the edit list and feeds the audio worker
one segment list for the whole rest of the timeline, so clip joins are gapless.
cut_at is metadata only, delete_clip/undo reseek onto the new mapping.

frames() stays for now: the app switches to try_frame in the UI slice.
✨ feat(engine): clips primitives — edit-list model, bounded decode, segmented audioAhmet Kaan Gümüş · e75a7ba
✨ feat(engine): clips primitives — edit-list model, bounded decode, segmented audio

Lane 1 of the clips slice; PlaybackSession traversal comes next.

- project.rs: Clip/Project — cut (metadata-only, refuses no-op
  splits), delete (closes gap, keeps ≥1 clip), undo snapshots,
  timeline↔source mapping with boundary sweep tests
- decode: open_range(start, end) — both backends stop after end-1,
  empty/inverted ranges disconnect cleanly without spawning a worker
- audio: open_segments — one worker walks the edit list; segments
  bit-exact vs equivalent seeks, joins gapless by contiguity assert,
  head+tail trim inside a single AAC packet handled
🐛 fix(engine-audio): paused seek ate 1.49s of post-seek audioAhmet Kaan Gümüş · e259516
🐛 fix(engine-audio): paused seek ate 1.49s of post-seek audio

S6 verifier finding: ao_flush is consumed only by the next RT
callback; while paused there are none, so the new feeder filled the
ring behind the pending flag and the first post-resume callback
drained the new stream's head (measured 151 underruns = 1.49s = ring
capacity, audio then 1.5s ahead of picture).

ao_write now refuses samples while a flush is pending (accept()
mirrors consume(); feeder's retry loop parks until the RT thread
takes the flag). Probe re-run: paused seek 86 underruns = no-drop
baseline; mid-play unchanged at 130.
✨ feat(app): click-to-seek ruler, post-EOF restartAhmet Kaan Gümüş · 14821ab
✨ feat(app): click-to-seek ruler, post-EOF restart

Ruler takes a left click and seeks to the fraction of its own box that was
hit; an invisible overlay canvas records those bounds at prepaint because a
mouse listener only ever sees the window position. Player::seek clears the
app-side EOF flags (held/eos/done) and raises pending_seek, which keeps the
repaint loop alive while paused until the target frame is displayed. Space
and the transport button restart from zero once the timeline is finished.
✨ feat(playback): seek — rebuild workers, epoch-guarded feeder, clock re-anchorAhmet Kaan Gümüş · e4ca3bd
✨ feat(playback): seek — rebuild workers, epoch-guarded feeder, clock re-anchor

PlaybackSession::seek(secs) replaces both decode workers instead of
steering them: a fresh channel cannot hold a stale frame, and it works
after EOF where the old workers have already exited.

The audio device stays open across a seek. An epoch counter, bumped and
flushed while holding the device lock and re-checked by the feeder inside
that same lock right before every write, is what stops a superseded feeder
from landing stale PCM behind the flush. `fed` is re-based on the device
position, which keeps counting across a flush, so the audio-EOF test stays
exact.
✨ feat(engine): seek primitives — video open_at, ao_flush, audio open_atAhmet Kaan Gümüş · 96ae365
✨ feat(engine): seek primitives — video open_at, ao_flush, audio open_at

Lane 1 of the seek slice; PlaybackSession orchestration comes next.

- demux/decode: stss sync lookup, DecodeSession::open_at decodes from
  the keyframe and discards to the target; Frame.index stays absolute.
  HW plugin ABI: vh_open renamed vh_open_at(path, target) — discards
  skip the vaGetImage readback; measured seek cost 65ms HW / 222ms SW
- engine-audio: ao_flush drains the ring consumer-side in the RT
  callback (one-shot atomic), stale PCM unplayable even when paused;
  played-position atomics untouched so clock math survives
- audio: open_at walks stts, 2-packet AAC pre-roll (MDCT overlap
  reconstructed exactly — verified 0-diff before the first PNS band),
  sample-exact trim; priming skip and seek discard unified. AAC seek
  is deliberately not bit-exact: symphonia's PNS noise LCG state
  depends on packet history; bounded <1e-3 by test instead
✨ feat(app): editor-shell UI — transport, timecode, playhead rulerAhmet Kaan Gümüş · 1c1f5e0
✨ feat(app): editor-shell UI — transport, timecode, playhead ruler

Shell C chrome around the picture: filename header, letterboxed video
region, and a fixed-height bottom panel with the transport row (drawn
play/pause glyph, HH:MM:SS:FF readout), a read-only playhead ruler and
two empty track lanes for the clips slice.

Play state is read from the clock every render -- no shadow flag -- and
the readout clamps to frame_count/frame_rate, since the clock keeps
running past the last frame once wall time takes over at audio EOF.
The button is a plain div, so the root's own focus handler wins the
click and the space bar keeps working after a press; the toggle
handlers notify, which also replaces the animation frame as the thing
that repaints a paused (or finished) timeline.
🐛 fix(playback): dead audio output froze the clock foreverAhmet Kaan Gümüş · 752c6a0
🐛 fix(playback): dead audio output froze the clock forever

Verifier finding: feed() noticed the plugin dying (write -> None) but
only set fed_all; tick()'s switch-to-wall needed position >= fed,
which a frozen position can never satisfy. Explicit died flag now
hands the timeline to wall time on the next tick.
✨ feat(playback): A/V session — audio-master clock, real-speed video, space to pauseAhmet Kaan Gümüş · 63e6964
✨ feat(playback): A/V session — audio-master clock, real-speed video, space to pause

engine::playback::PlaybackSession wires DecodeSession + AudioSession +
AoSession + PlaybackClock together behind open/play/pause/toggle/now/tick.
A feeder thread pours decoded chunks into the device ring; tick() polls the
device position into the clock and switches to wall time at audio EOF.
Every audio failure (no track, no plugin, no daemon) degrades to a
wall-paced silent session.

The app renders against the clock: drain every due frame, show the last
(drop-when-behind), hold one that is early. Space toggles playback.
✨ feat(engine): audio decode, PipeWire output plugin, playback clockAhmet Kaan Gümüş · 229a569
✨ feat(engine): audio decode, PipeWire output plugin, playback clock

Wave 1 of the audio slice — three independent modules, app wiring
comes next:

- audio.rs: AAC-LC via standalone symphonia AacDecoder over the
  existing mp4 demuxer; priming trim read from the container elst
  (verified against ffprobe); channel identity pinned by
  zero-crossing tests on the 440/880 Hz fixture
- engine-audio: dlopen'd PipeWire cdylib (ao_* C ABI). App binary
  keeps zero libpipewire linkage; daemon absent fails open() in ~1ms.
  Fill capped at 1024 frames/callback: uncapped, PipeWire hands the
  sink-sized buffer and the position clock steps 256ms at a time.
  Stream time rate is 1/48000 regardless of stream rate — position
  is rescaled or the clock runs 8.8% fast on 44.1k content
- clock.rs: PlaybackClock, audio-driven with wall fallback; audio
  positions relative to last re-anchor so restarted streams re-sync;
  paused == frozen exactly, all re-anchoring through one path
🔧 chore: add A/V test fixture to gen_fixturesAhmet Kaan Gümüş · fc06b75
🔧 chore: add A/V test fixture to gen_fixtures

Stereo AAC with distinct L/R frequencies (440/880 Hz) so channel
mapping mistakes are audible; 1 Hz volume pulse makes A/V drift
visible against the burned-in frame counter.
🎉 feat: MVP decode pipeline — mp4 → H.264 → gpui previewAhmet Kaan Gümüş · 0acbf8d
🎉 feat: MVP decode pipeline — mp4 → H.264 → gpui preview

- engine: mp4 demux → Annex-B, rusty_h264 software decode, BT.601
  I420→BGRA; decode on worker thread behind a bounded channel
- engine-hw: optional VA-API decode plugin (cros-codecs) behind a
  C ABI, dlopen'd at runtime with silent software fallback; the app
  binary keeps zero libva/gbm/drm linkage so it runs on any distro
- app: gpui window, per-frame RenderImage swap + drop_image
- vendor/: cros-libva + cros-codecs with 3 LOCAL PATCH fixes (libva
  1.23 struct init, radeonsi 64x64 min context, pub surface()) —
  upstream is dormant, so vendor/ is adopted code, not a temp fork
- fixtures are gitignored; scripts/gen_fixtures.sh regenerates them