Skip to content

Fix trailing frame capture after recording ended#55704

Open
huntie wants to merge 5 commits intofacebook:mainfrom
huntie:export-D93863310
Open

Fix trailing frame capture after recording ended#55704
huntie wants to merge 5 commits intofacebook:mainfrom
huntie:export-D93863310

Conversation

@huntie
Copy link
Member

@huntie huntie commented Feb 23, 2026

Summary:
Previously, this could lead to capturing an additional 120-240 new frames.
Also refactor to de-nest and simplify coroutine logic.

Changelog: [Internal]

Differential Revision: D93863310

@meta-cla meta-cla bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Feb 23, 2026
@meta-codesync
Copy link

meta-codesync bot commented Feb 23, 2026

@huntie has exported this pull request. If you are a Meta employee, you can view the originating Diff in D93863310.

@huntie huntie changed the title Simplify coroutines in FrameTimingsObserver Fix trailing frame capture after recording ended Feb 24, 2026
huntie added a commit to huntie/react-native that referenced this pull request Feb 24, 2026
Summary:

Previously, this could lead to capturing an additional 120-240 new frames.

Also refactor to de-nest and simplify coroutine logic.

Changelog: [Internal]

Differential Revision: D93863310
huntie added a commit to huntie/react-native that referenced this pull request Feb 24, 2026
Summary:
Pull Request resolved: facebook#55704

Previously, this could lead to capturing an additional 120-240 new frames.

Also refactor to de-nest and simplify coroutine logic.

Changelog: [Internal]

Differential Revision: D93863310
huntie added a commit to huntie/react-native that referenced this pull request Feb 25, 2026
Summary:

Previously, this could lead to capturing an additional 120-240 new frames.

Also refactor to de-nest and simplify coroutine logic.

Changelog: [Internal]

Differential Revision: D93863310
huntie added a commit to huntie/react-native that referenced this pull request Feb 25, 2026
Summary:

Previously, this could lead to capturing an additional 120-240 new frames.

Also refactor to de-nest and simplify coroutine logic.

Changelog: [Internal]

Differential Revision: D93863310
huntie added a commit to huntie/react-native that referenced this pull request Feb 25, 2026
Summary:

Previously, this could lead to capturing an additional 120-240 new frames.

Also refactor to de-nest and simplify coroutine logic.

Changelog: [Internal]

Differential Revision: D93863310
huntie added a commit to huntie/react-native that referenced this pull request Feb 25, 2026
Summary:
Pull Request resolved: facebook#55704

Previously, this could lead to capturing an additional 120-240 new frames.

Also refactor to de-nest and simplify coroutine logic.

Changelog: [Internal]

Differential Revision: D93863310
huntie added a commit to huntie/react-native that referenced this pull request Feb 25, 2026
Summary:
Pull Request resolved: facebook#55704

Previously, this could lead to capturing an additional 120-240 new frames.

Also refactor to de-nest and simplify coroutine logic.

Changelog: [Internal]

Differential Revision: D93863310
Summary:
Small refactor — locate public methods first, sort private methods in call order.

Changelog: [Internal]

Differential Revision: D94366535
…facebook#55731)

Summary:

Changelog: [Internal]

Differential Revision: D94256691
Summary:
Previously, screenshot capture was initiated on a background thread, so `PixelCopy` could run during a later frame than the one being reported. Screenshots now correctly correspond to their frame metrics callback.

Changelog: [Internal]

Differential Revision: D94368259
Summary:
The shared `bitmapBuffer` could be overwritten by a new `PixelCopy` request on the main thread while a previous frame's encoding coroutine was still reading from it. Each frame now gets its own bitmap, recycled after encoding.

NOTE: This will come at a slight perf cost (allocating extra new bitmaps in memory), for the tradeoff of correctness.

Changelog: [Internal]

Differential Revision: D94368260
Summary:

Previously, this could lead to capturing an additional 120-240 new frames.

Changelog: [Internal]

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

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported meta-exported p: Facebook Partner: Facebook Partner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants