Skip to content

[codex] Show initial frame while live preview starts#189

Merged
rz-openai merged 2 commits into
mainfrom
dev/rz/live-preview-initial-frame
Jun 26, 2026
Merged

[codex] Show initial frame while live preview starts#189
rz-openai merged 2 commits into
mainfrom
dev/rz/live-preview-initial-frame

Conversation

@rz-openai

Copy link
Copy Markdown
Collaborator

Summary

  • capture a best-effort device screenshot before starting the H.264 live-preview stream
  • display the screenshot as an aspect-fit bootstrap frame until AVFoundation reports live video ready for display
  • bound screenshot capture to two seconds and clean up observers and full-resolution image memory after handoff

Why

Live preview can remain black until enough stream data arrives for AVFoundation to make the first video frame displayable. Showing a fresh screenshot bridges that startup gap without changing persisted capture media.

Impact

Starting or retrying live preview now shows the device immediately, then hands off to the live stream once a real frame is ready. Screenshot failure remains non-fatal and falls back to the existing black surface.

Validation

  • xcodebuild -quiet -project Snap-O.xcodeproj -scheme Snap-O CODE_SIGNING_ALLOWED=NO CODE_SIGNING_REQUIRED=NO build
  • swiftlint lint --strict --no-cache --config .swiftlint.yml Snap-O/LivePreview/LivePreviewSession.swift Snap-O/LivePreview/LivePreviewView.swift
  • SwiftFormat 0.61.1 lint on both changed files

@rz-openai
rz-openai marked this pull request as ready for review June 26, 2026 14:47

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ce81a6577b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread snapo-app-mac/Snap-O/LivePreview/LivePreviewSession.swift Outdated
@rz-openai

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. More of your lovely PRs please.

Reviewed commit: 7af7726ef5

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@rz-openai
rz-openai merged commit 686039d into main Jun 26, 2026
3 checks passed
@rz-openai
rz-openai deleted the dev/rz/live-preview-initial-frame branch June 26, 2026 19:38
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.

1 participant