Skip to content

Recover failed iPad PiP display layers - #99

Open
alantangok wants to merge 2 commits into
hugeBlack:mainfrom
alantangok:alan/fix/ipad-pip-recovery
Open

alantangok wants to merge 2 commits into
hugeBlack:mainfrom
alantangok:alan/fix/ipad-pip-recovery

Conversation

@alantangok

@alantangok alantangok commented Sep 14, 2026 •

Copy link
Copy Markdown

Summary

  • flush and rebuild the cached format only when the display layer reports recoverable decoder starvation through requiresFlushToResumeDecoding
  • mark only the first successfully created post-recovery frame for immediate display
  • treat other failed-layer states as terminal: log the status/error once and stop or fail PiP cleanly without a repeated flush loop
  • keep the existing GL capture/enqueue path unchanged and avoid a broader display-layer/controller rebuild

Verification

  • unsigned Release iOS device build succeeded
  • Xcode Release static analysis succeeded
  • temporary state-machine checks cover steady, recoverable, and terminal failure paths; the pre-fix terminal flush loop was reproduced before the change
  • no project file, .checkpoint, or scripts/ changes

Device validation still required

  • repeated PiP/background/foreground and stream-resolution changes to exercise decoder-starvation recovery
  • terminal failure fault injection: confirm one log, one stop/failure callback, and no repeated flush loop
  • repeat PiP start/stop after terminal failure and confirm graceful rejection until teardown/setup
  • test iOS 15–17 and iOS 18+; migration to sampleBufferRenderer is intentionally out of scope

Split from #93.

@SandiyosDev

Copy link
Copy Markdown
Collaborator

This one I can take

before I merge, the flush branch needs a cap so a decoder that stays starved doesn't flush on every frame forever, the NSLog should go through sdkLog like the rest of the app, and displayImmediatelyAfterRecovery is written from both threads outside the lock you added

@SandiyosDev

Copy link
Copy Markdown
Collaborator

What was your repro for the black PiP?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants