Repository navigation
cmux-next: video backgrounds fade in and free their decoder when out of sight - #21720
Conversation
…of sight The first frame now fades in over the poster instead of cutting. A video no one can see (hidden, minimized, covered, screens asleep) for a minute drops its items, freeing the decoder and frame buffers, and resumes at the frame it held when seen again. A video held for Low Power Mode or Reduce Motion is still on screen and keeps its frame. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Receipt for
|
|
Not verified: macOS jobs did not run: compile and app tests were skipped on CI passes on Written by |
|
Bead |
… ready Review fixes: the seek after a decoder release waits for the new item to be ready (a seek sent before then can be dropped or undone by the looper) and uses zero tolerance both ways, not the next keyframe. The players take their clock, so the release deadline test steps a manual clock; the restore test checks the time it came back at. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…me test holds still Re-review fixes: the entry is stored before the readiness observation, so an item already ready (reported inline) seeks and clears its pending restore instead of leaving it set. The resume test restores while held in Low Power, so a restart from 0 cannot reach the mark by playing; it checks 0.95-1.05 s. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The batch Swift run failed aVideoNoOneCanSeeGivesBackItsDecoderAndPicksUpWhereItWas (from #21720): AVPlayerLooper inserts items once the asset's duration loads, so checking them right after attaching raced it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Phase 2 of the backgrounds plan (briefs/next-backgrounds-plan.md): video background playback.
What changes
Motionfade tokenfadeIn) instead of cutting from the still. Frames that stop, such as a released decoder, still hide at once, which leaves the poster underneath.BackdropVideoPlayersnow tracks which windows could be seen at all (BackdropVideoView.canBeSeen): on screen, not minimized or app-hidden, not covered by other windows, screens awake, session active.releaseAfter(60 s), the shared player:AVQueuePlayerand seeks to the saved frame, so the windows' layers keep their player.BackdropImageStorealready snapshots a video's first frame on first decode, so launches reuse it. I've dropped that item from the plan.Tests
In
CmuxNextAppTests/VideoWallpaperTests:aVideoNoOneCanSeeGivesBackItsDecoderAndPicksUpWhereItWas: a video held for Low Power keeps its items. A hidden one releases them, comes back on the same player when seen, and plays.theDecoderGoesOnlyAfterTheDeadline: the release waits forreleaseAfter, and updates while hidden don't reset it.Verification
lint-ios-package-conventions.sh: clean.dev-build: pick a video background, hide cmux for over a minute, then show it again. The video should come back at the same frame and fade in.WINDOW
None.
Changelog
Changed: Video backgrounds fade in, and stop using video memory while no one can see them.
🤖 Generated with Claude Code
Need help on this PR? Tag
@codesmith-botwith what you need.Summary by cubic
Video backgrounds in cmux-next now fade in over their poster and free their hardware decoder when no one can see them.
releaseAfter(60 s), the shared player saves its position, drops its items, and frees the decoder and its frame buffers.AVQueuePlayerand, once the new item is ready, seeks to the saved frame with zero tolerance, so layers keep their player and the video resumes at the exact frame it held.Written for commit 7175953. Summary will update on new commits.