Skip to content

improve the iOS camera plugin thread model #96429

@hellohuanlin

Description

@hellohuanlin

Use case

This issue will be the main issue that tracks various threading problems in iOS camera plugin.

Proposal

We wrote up a formal proposal to improve the thread model, with detailed execution plan in the end. There are also a couple non-threading issues that we'd like to address in the spirit of "yak shaving".

Action Items

We need to fix these threading related issues:

  • Rename "dispatchQueue" to "sessionQueue"
  • Dispatch engine API calls on iOS main queue
  • Handle all SampleBuffer callbacks on the session queue
  • Write photo file in IO queue
  • Thread safety for state access
    • Fix _dispatchQueue race condition which is causing a known crash
    • Fix FLTSavePhotoDelegate's reference
    • Fix _camera ivar
    • Fix dispatch orientation change on the session queue (_deviceOrientation, _lockedCaptureOrientation, _isRecording)
  • Pixel buffer with queues

These are optional cleanups not related to threading:

Metadata

Metadata

Assignees

Labels

p: cameraThe camera pluginplatform-iosiOS applications specifically

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions