Skip to content

Recover failed iPad PiP display layers - #99

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

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
Contributor

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?

@SandiyosDev SandiyosDev mentioned this pull request Oct 7, 2026
@SandiyosDev

Copy link
Copy Markdown
Collaborator

both commits are in #108 with you as the author, plus a cap commit on top
closing this one, a repro is still welcome if you have one

@SandiyosDev SandiyosDev closed this Oct 7, 2026
@alantangok

Copy link
Copy Markdown
Contributor Author

Device information

  • Client: iPad Air (5th generation), 64 GB (iPad13,17).
  • Current device OS: iPadOS 26.6 (23G71).
  • Host: Mac.
  • OpenParsec: development build before the PiP recovery fix.

Steps to reproduce

  1. Connect OpenParsec to the Mac host and start streaming.
  2. Enable Picture in Picture and enter PiP mode.
  3. Observe the video in the PiP window.

Actual result

The PiP window displays a black image instead of the host video.

Expected result

The PiP window continues to display the live host video while the session remains connected.

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