Skip to content

Commit ea55d25

Browse files
authored
iOS NativeCamera session start/stop synchronization (#1137)
* Fix race condition between engine shutdown and readTextureAsync. * Create a serial queue for the camera session start/stop, pre-emptively release texture handle before resolve in readTextureAsync . * Move texture cache deallocation outside of dispatch_async. * Whitespace * Remove rare hang due to unncessary thread marshalling. Hold onto texture across sessions (hacky fix) * Change to arcana background dispatcher, re-use implData object, remove unncessary main queue dispatch. * Consolidate first time initialization code. * Revert NativeEngine workaround. * Reuse capture session and camera texture delegate * Revert keeping camera texture delegate alive, due to deadlocks when reusing dispatch_queue across sessions. * Move orientation de-register to dealloc, clean up a few comments, clear refreshBgfxHandle * Cleanup * Push temporary readTexture fix * Fix Mac OS build errors * use shared_from_this(). * Perform one final texture cache check before assigning in delegate.
1 parent 758f4b4 commit ea55d25

File tree

3 files changed

+245
-204
lines changed

3 files changed

+245
-204
lines changed

Plugins/NativeCamera/Source/Apple/NativeCameraImpl.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,7 @@ namespace Babylon::Plugins
3434
bool m_overrideCameraTexture{};
3535

3636
CameraDimensions m_cameraDimensions{};
37+
38+
arcana::background_dispatcher<32> m_cameraSessionDispatcher{};
3739
};
3840
}

0 commit comments

Comments
 (0)