feat: Concurrent/Cancellable configure (#2282)

* feat: Cancellable `configure`

* Android

* Update Podfile.lock

* Configure outside of lock

* Update lockfiles

* Use `bundle` for CI

* Update script

* Update Podfile.lock

* fix: Set config at end

* Lint
This commit is contained in:
Marc Rousavy 2023-12-13 16:38:02 +01:00 committed by GitHub
parent 5a81fabedd
commit 977bf56c6d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 4362 additions and 5059 deletions

View File

@ -51,6 +51,7 @@ jobs:
with: with:
ruby-version: 2.6.10 ruby-version: 2.6.10
bundler-cache: true bundler-cache: true
working-directory: package/example/ios
- name: Restore Pods cache - name: Restore Pods cache
uses: actions/cache@v3 uses: actions/cache@v3
@ -63,7 +64,7 @@ jobs:
restore-keys: | restore-keys: |
${{ runner.os }}-pods- ${{ runner.os }}-pods-
- name: Install Pods - name: Install Pods
run: pod install run: bundle exec pod install
- name: Install xcpretty - name: Install xcpretty
run: gem install xcpretty run: gem install xcpretty
- name: Build App - name: Build App
@ -112,6 +113,7 @@ jobs:
with: with:
ruby-version: 2.6.10 ruby-version: 2.6.10
bundler-cache: true bundler-cache: true
working-directory: package/example/ios
- name: Restore Pods cache - name: Restore Pods cache
uses: actions/cache@v3 uses: actions/cache@v3
@ -124,7 +126,7 @@ jobs:
restore-keys: | restore-keys: |
${{ runner.os }}-pods- ${{ runner.os }}-pods-
- name: Install Pods - name: Install Pods
run: pod install run: bundle exec pod install
- name: Install xcpretty - name: Install xcpretty
run: gem install xcpretty run: gem install xcpretty
- name: Build App - name: Build App

View File

@ -65,6 +65,7 @@ class CameraSession(private val context: Context, private val cameraManager: Cam
// Camera Configuration // Camera Configuration
private var configuration: CameraConfiguration? = null private var configuration: CameraConfiguration? = null
private var currentConfigureCall: Long = System.currentTimeMillis()
// Camera State // Camera State
private var captureSession: CameraCaptureSession? = null private var captureSession: CameraCaptureSession? = null
@ -112,15 +113,26 @@ class CameraSession(private val context: Context, private val cameraManager: Cam
} }
suspend fun configure(lambda: (configuration: CameraConfiguration) -> Unit) { suspend fun configure(lambda: (configuration: CameraConfiguration) -> Unit) {
// This is the latest call to configure()
val now = System.currentTimeMillis()
currentConfigureCall = now
Log.i(TAG, "Updating CameraSession Configuration...")
// Let caller configure a new configuration for the Camera.
val config = CameraConfiguration.copyOf(this.configuration)
lambda(config)
val diff = CameraConfiguration.difference(this.configuration, config)
if (!diff.hasAnyDifference) {
Log.w(TAG, "Called configure(...) but nothing changed...")
return
}
mutex.withLock { mutex.withLock {
Log.i(TAG, "Updating CameraSession Configuration...") // Cancel configuration if there has already been a new config
if (currentConfigureCall != now) {
val config = CameraConfiguration.copyOf(this.configuration) // configure() has been called again just now, skip this one so the new call takes over.
lambda(config)
val diff = CameraConfiguration.difference(this.configuration, config)
if (!diff.hasAnyDifference) {
Log.w(TAG, "Called configure(...) but nothing changed...")
return return
} }

View File

@ -27,5 +27,7 @@ echo "pod setup"
pod setup pod setup
echo "yarn" echo "yarn"
yarn yarn
echo "bundle install"
bundle install
echo "pod install" echo "pod install"
pod install bundle exec pod install

View File

@ -1,19 +1,19 @@
PODS: PODS:
- boost (1.76.0) - boost (1.76.0)
- DoubleConversion (1.1.6) - DoubleConversion (1.1.6)
- FBLazyVector (0.72.3) - FBLazyVector (0.72.7)
- FBReactNativeSpec (0.72.3): - FBReactNativeSpec (0.72.7):
- RCT-Folly (= 2021.07.22.00) - RCT-Folly (= 2021.07.22.00)
- RCTRequired (= 0.72.3) - RCTRequired (= 0.72.7)
- RCTTypeSafety (= 0.72.3) - RCTTypeSafety (= 0.72.7)
- React-Core (= 0.72.3) - React-Core (= 0.72.7)
- React-jsi (= 0.72.3) - React-jsi (= 0.72.7)
- ReactCommon/turbomodule/core (= 0.72.3) - ReactCommon/turbomodule/core (= 0.72.7)
- fmt (6.2.1) - fmt (6.2.1)
- glog (0.3.5) - glog (0.3.5)
- hermes-engine (0.72.3): - hermes-engine (0.72.7):
- hermes-engine/Pre-built (= 0.72.3) - hermes-engine/Pre-built (= 0.72.7)
- hermes-engine/Pre-built (0.72.3) - hermes-engine/Pre-built (0.72.7)
- libevent (2.1.12) - libevent (2.1.12)
- libwebp (1.3.2): - libwebp (1.3.2):
- libwebp/demux (= 1.3.2) - libwebp/demux (= 1.3.2)
@ -47,26 +47,26 @@ PODS:
- fmt (~> 6.2.1) - fmt (~> 6.2.1)
- glog - glog
- libevent - libevent
- RCTRequired (0.72.3) - RCTRequired (0.72.7)
- RCTTypeSafety (0.72.3): - RCTTypeSafety (0.72.7):
- FBLazyVector (= 0.72.3) - FBLazyVector (= 0.72.7)
- RCTRequired (= 0.72.3) - RCTRequired (= 0.72.7)
- React-Core (= 0.72.3) - React-Core (= 0.72.7)
- React (0.72.3): - React (0.72.7):
- React-Core (= 0.72.3) - React-Core (= 0.72.7)
- React-Core/DevSupport (= 0.72.3) - React-Core/DevSupport (= 0.72.7)
- React-Core/RCTWebSocket (= 0.72.3) - React-Core/RCTWebSocket (= 0.72.7)
- React-RCTActionSheet (= 0.72.3) - React-RCTActionSheet (= 0.72.7)
- React-RCTAnimation (= 0.72.3) - React-RCTAnimation (= 0.72.7)
- React-RCTBlob (= 0.72.3) - React-RCTBlob (= 0.72.7)
- React-RCTImage (= 0.72.3) - React-RCTImage (= 0.72.7)
- React-RCTLinking (= 0.72.3) - React-RCTLinking (= 0.72.7)
- React-RCTNetwork (= 0.72.3) - React-RCTNetwork (= 0.72.7)
- React-RCTSettings (= 0.72.3) - React-RCTSettings (= 0.72.7)
- React-RCTText (= 0.72.3) - React-RCTText (= 0.72.7)
- React-RCTVibration (= 0.72.3) - React-RCTVibration (= 0.72.7)
- React-callinvoker (0.72.3) - React-callinvoker (0.72.7)
- React-Codegen (0.72.3): - React-Codegen (0.72.7):
- DoubleConversion - DoubleConversion
- FBReactNativeSpec - FBReactNativeSpec
- glog - glog
@ -81,11 +81,11 @@ PODS:
- React-rncore - React-rncore
- ReactCommon/turbomodule/bridging - ReactCommon/turbomodule/bridging
- ReactCommon/turbomodule/core - ReactCommon/turbomodule/core
- React-Core (0.72.3): - React-Core (0.72.7):
- glog - glog
- hermes-engine - hermes-engine
- RCT-Folly (= 2021.07.22.00) - RCT-Folly (= 2021.07.22.00)
- React-Core/Default (= 0.72.3) - React-Core/Default (= 0.72.7)
- React-cxxreact - React-cxxreact
- React-hermes - React-hermes
- React-jsi - React-jsi
@ -95,7 +95,7 @@ PODS:
- React-utils - React-utils
- SocketRocket (= 0.6.1) - SocketRocket (= 0.6.1)
- Yoga - Yoga
- React-Core/CoreModulesHeaders (0.72.3): - React-Core/CoreModulesHeaders (0.72.7):
- glog - glog
- hermes-engine - hermes-engine
- RCT-Folly (= 2021.07.22.00) - RCT-Folly (= 2021.07.22.00)
@ -109,7 +109,7 @@ PODS:
- React-utils - React-utils
- SocketRocket (= 0.6.1) - SocketRocket (= 0.6.1)
- Yoga - Yoga
- React-Core/Default (0.72.3): - React-Core/Default (0.72.7):
- glog - glog
- hermes-engine - hermes-engine
- RCT-Folly (= 2021.07.22.00) - RCT-Folly (= 2021.07.22.00)
@ -122,23 +122,23 @@ PODS:
- React-utils - React-utils
- SocketRocket (= 0.6.1) - SocketRocket (= 0.6.1)
- Yoga - Yoga
- React-Core/DevSupport (0.72.3): - React-Core/DevSupport (0.72.7):
- glog - glog
- hermes-engine - hermes-engine
- RCT-Folly (= 2021.07.22.00) - RCT-Folly (= 2021.07.22.00)
- React-Core/Default (= 0.72.3) - React-Core/Default (= 0.72.7)
- React-Core/RCTWebSocket (= 0.72.3) - React-Core/RCTWebSocket (= 0.72.7)
- React-cxxreact - React-cxxreact
- React-hermes - React-hermes
- React-jsi - React-jsi
- React-jsiexecutor - React-jsiexecutor
- React-jsinspector (= 0.72.3) - React-jsinspector (= 0.72.7)
- React-perflogger - React-perflogger
- React-runtimeexecutor - React-runtimeexecutor
- React-utils - React-utils
- SocketRocket (= 0.6.1) - SocketRocket (= 0.6.1)
- Yoga - Yoga
- React-Core/RCTActionSheetHeaders (0.72.3): - React-Core/RCTActionSheetHeaders (0.72.7):
- glog - glog
- hermes-engine - hermes-engine
- RCT-Folly (= 2021.07.22.00) - RCT-Folly (= 2021.07.22.00)
@ -152,7 +152,7 @@ PODS:
- React-utils - React-utils
- SocketRocket (= 0.6.1) - SocketRocket (= 0.6.1)
- Yoga - Yoga
- React-Core/RCTAnimationHeaders (0.72.3): - React-Core/RCTAnimationHeaders (0.72.7):
- glog - glog
- hermes-engine - hermes-engine
- RCT-Folly (= 2021.07.22.00) - RCT-Folly (= 2021.07.22.00)
@ -166,7 +166,7 @@ PODS:
- React-utils - React-utils
- SocketRocket (= 0.6.1) - SocketRocket (= 0.6.1)
- Yoga - Yoga
- React-Core/RCTBlobHeaders (0.72.3): - React-Core/RCTBlobHeaders (0.72.7):
- glog - glog
- hermes-engine - hermes-engine
- RCT-Folly (= 2021.07.22.00) - RCT-Folly (= 2021.07.22.00)
@ -180,7 +180,7 @@ PODS:
- React-utils - React-utils
- SocketRocket (= 0.6.1) - SocketRocket (= 0.6.1)
- Yoga - Yoga
- React-Core/RCTImageHeaders (0.72.3): - React-Core/RCTImageHeaders (0.72.7):
- glog - glog
- hermes-engine - hermes-engine
- RCT-Folly (= 2021.07.22.00) - RCT-Folly (= 2021.07.22.00)
@ -194,7 +194,7 @@ PODS:
- React-utils - React-utils
- SocketRocket (= 0.6.1) - SocketRocket (= 0.6.1)
- Yoga - Yoga
- React-Core/RCTLinkingHeaders (0.72.3): - React-Core/RCTLinkingHeaders (0.72.7):
- glog - glog
- hermes-engine - hermes-engine
- RCT-Folly (= 2021.07.22.00) - RCT-Folly (= 2021.07.22.00)
@ -208,7 +208,7 @@ PODS:
- React-utils - React-utils
- SocketRocket (= 0.6.1) - SocketRocket (= 0.6.1)
- Yoga - Yoga
- React-Core/RCTNetworkHeaders (0.72.3): - React-Core/RCTNetworkHeaders (0.72.7):
- glog - glog
- hermes-engine - hermes-engine
- RCT-Folly (= 2021.07.22.00) - RCT-Folly (= 2021.07.22.00)
@ -222,7 +222,7 @@ PODS:
- React-utils - React-utils
- SocketRocket (= 0.6.1) - SocketRocket (= 0.6.1)
- Yoga - Yoga
- React-Core/RCTSettingsHeaders (0.72.3): - React-Core/RCTSettingsHeaders (0.72.7):
- glog - glog
- hermes-engine - hermes-engine
- RCT-Folly (= 2021.07.22.00) - RCT-Folly (= 2021.07.22.00)
@ -236,7 +236,7 @@ PODS:
- React-utils - React-utils
- SocketRocket (= 0.6.1) - SocketRocket (= 0.6.1)
- Yoga - Yoga
- React-Core/RCTTextHeaders (0.72.3): - React-Core/RCTTextHeaders (0.72.7):
- glog - glog
- hermes-engine - hermes-engine
- RCT-Folly (= 2021.07.22.00) - RCT-Folly (= 2021.07.22.00)
@ -250,7 +250,7 @@ PODS:
- React-utils - React-utils
- SocketRocket (= 0.6.1) - SocketRocket (= 0.6.1)
- Yoga - Yoga
- React-Core/RCTVibrationHeaders (0.72.3): - React-Core/RCTVibrationHeaders (0.72.7):
- glog - glog
- hermes-engine - hermes-engine
- RCT-Folly (= 2021.07.22.00) - RCT-Folly (= 2021.07.22.00)
@ -264,11 +264,11 @@ PODS:
- React-utils - React-utils
- SocketRocket (= 0.6.1) - SocketRocket (= 0.6.1)
- Yoga - Yoga
- React-Core/RCTWebSocket (0.72.3): - React-Core/RCTWebSocket (0.72.7):
- glog - glog
- hermes-engine - hermes-engine
- RCT-Folly (= 2021.07.22.00) - RCT-Folly (= 2021.07.22.00)
- React-Core/Default (= 0.72.3) - React-Core/Default (= 0.72.7)
- React-cxxreact - React-cxxreact
- React-hermes - React-hermes
- React-jsi - React-jsi
@ -278,66 +278,66 @@ PODS:
- React-utils - React-utils
- SocketRocket (= 0.6.1) - SocketRocket (= 0.6.1)
- Yoga - Yoga
- React-CoreModules (0.72.3): - React-CoreModules (0.72.7):
- RCT-Folly (= 2021.07.22.00) - RCT-Folly (= 2021.07.22.00)
- RCTTypeSafety (= 0.72.3) - RCTTypeSafety (= 0.72.7)
- React-Codegen (= 0.72.3) - React-Codegen (= 0.72.7)
- React-Core/CoreModulesHeaders (= 0.72.3) - React-Core/CoreModulesHeaders (= 0.72.7)
- React-jsi (= 0.72.3) - React-jsi (= 0.72.7)
- React-RCTBlob - React-RCTBlob
- React-RCTImage (= 0.72.3) - React-RCTImage (= 0.72.7)
- ReactCommon/turbomodule/core (= 0.72.3) - ReactCommon/turbomodule/core (= 0.72.7)
- SocketRocket (= 0.6.1) - SocketRocket (= 0.6.1)
- React-cxxreact (0.72.3): - React-cxxreact (0.72.7):
- boost (= 1.76.0) - boost (= 1.76.0)
- DoubleConversion - DoubleConversion
- glog - glog
- hermes-engine - hermes-engine
- RCT-Folly (= 2021.07.22.00) - RCT-Folly (= 2021.07.22.00)
- React-callinvoker (= 0.72.3) - React-callinvoker (= 0.72.7)
- React-debug (= 0.72.3) - React-debug (= 0.72.7)
- React-jsi (= 0.72.3) - React-jsi (= 0.72.7)
- React-jsinspector (= 0.72.3) - React-jsinspector (= 0.72.7)
- React-logger (= 0.72.3) - React-logger (= 0.72.7)
- React-perflogger (= 0.72.3) - React-perflogger (= 0.72.7)
- React-runtimeexecutor (= 0.72.3) - React-runtimeexecutor (= 0.72.7)
- React-debug (0.72.3) - React-debug (0.72.7)
- React-hermes (0.72.3): - React-hermes (0.72.7):
- DoubleConversion - DoubleConversion
- glog - glog
- hermes-engine - hermes-engine
- RCT-Folly (= 2021.07.22.00) - RCT-Folly (= 2021.07.22.00)
- RCT-Folly/Futures (= 2021.07.22.00) - RCT-Folly/Futures (= 2021.07.22.00)
- React-cxxreact (= 0.72.3) - React-cxxreact (= 0.72.7)
- React-jsi - React-jsi
- React-jsiexecutor (= 0.72.3) - React-jsiexecutor (= 0.72.7)
- React-jsinspector (= 0.72.3) - React-jsinspector (= 0.72.7)
- React-perflogger (= 0.72.3) - React-perflogger (= 0.72.7)
- React-jsi (0.72.3): - React-jsi (0.72.7):
- boost (= 1.76.0) - boost (= 1.76.0)
- DoubleConversion - DoubleConversion
- glog - glog
- hermes-engine - hermes-engine
- RCT-Folly (= 2021.07.22.00) - RCT-Folly (= 2021.07.22.00)
- React-jsiexecutor (0.72.3): - React-jsiexecutor (0.72.7):
- DoubleConversion - DoubleConversion
- glog - glog
- hermes-engine - hermes-engine
- RCT-Folly (= 2021.07.22.00) - RCT-Folly (= 2021.07.22.00)
- React-cxxreact (= 0.72.3) - React-cxxreact (= 0.72.7)
- React-jsi (= 0.72.3) - React-jsi (= 0.72.7)
- React-perflogger (= 0.72.3) - React-perflogger (= 0.72.7)
- React-jsinspector (0.72.3) - React-jsinspector (0.72.7)
- React-logger (0.72.3): - React-logger (0.72.7):
- glog - glog
- react-native-blur (4.3.2): - react-native-blur (4.3.2):
- React-Core - React-Core
- react-native-cameraroll (5.7.2): - react-native-cameraroll (5.10.0):
- React-Core - React-Core
- react-native-mmkv (2.10.2): - react-native-mmkv (2.11.0):
- MMKV (>= 1.2.13) - MMKV (>= 1.2.13)
- React-Core - React-Core
- react-native-safe-area-context (4.7.1): - react-native-safe-area-context (4.8.0):
- React-Core - React-Core
- react-native-video (5.2.1): - react-native-video (5.2.1):
- React-Core - React-Core
@ -348,7 +348,7 @@ PODS:
- React - React
- React-callinvoker - React-callinvoker
- React-Core - React-Core
- React-NativeModulesApple (0.72.3): - React-NativeModulesApple (0.72.7):
- hermes-engine - hermes-engine
- React-callinvoker - React-callinvoker
- React-Core - React-Core
@ -357,17 +357,17 @@ PODS:
- React-runtimeexecutor - React-runtimeexecutor
- ReactCommon/turbomodule/bridging - ReactCommon/turbomodule/bridging
- ReactCommon/turbomodule/core - ReactCommon/turbomodule/core
- React-perflogger (0.72.3) - React-perflogger (0.72.7)
- React-RCTActionSheet (0.72.3): - React-RCTActionSheet (0.72.7):
- React-Core/RCTActionSheetHeaders (= 0.72.3) - React-Core/RCTActionSheetHeaders (= 0.72.7)
- React-RCTAnimation (0.72.3): - React-RCTAnimation (0.72.7):
- RCT-Folly (= 2021.07.22.00) - RCT-Folly (= 2021.07.22.00)
- RCTTypeSafety (= 0.72.3) - RCTTypeSafety (= 0.72.7)
- React-Codegen (= 0.72.3) - React-Codegen (= 0.72.7)
- React-Core/RCTAnimationHeaders (= 0.72.3) - React-Core/RCTAnimationHeaders (= 0.72.7)
- React-jsi (= 0.72.3) - React-jsi (= 0.72.7)
- ReactCommon/turbomodule/core (= 0.72.3) - ReactCommon/turbomodule/core (= 0.72.7)
- React-RCTAppDelegate (0.72.3): - React-RCTAppDelegate (0.72.7):
- RCT-Folly - RCT-Folly
- RCTRequired - RCTRequired
- RCTTypeSafety - RCTTypeSafety
@ -379,54 +379,54 @@ PODS:
- React-RCTNetwork - React-RCTNetwork
- React-runtimescheduler - React-runtimescheduler
- ReactCommon/turbomodule/core - ReactCommon/turbomodule/core
- React-RCTBlob (0.72.3): - React-RCTBlob (0.72.7):
- hermes-engine - hermes-engine
- RCT-Folly (= 2021.07.22.00) - RCT-Folly (= 2021.07.22.00)
- React-Codegen (= 0.72.3) - React-Codegen (= 0.72.7)
- React-Core/RCTBlobHeaders (= 0.72.3) - React-Core/RCTBlobHeaders (= 0.72.7)
- React-Core/RCTWebSocket (= 0.72.3) - React-Core/RCTWebSocket (= 0.72.7)
- React-jsi (= 0.72.3) - React-jsi (= 0.72.7)
- React-RCTNetwork (= 0.72.3) - React-RCTNetwork (= 0.72.7)
- ReactCommon/turbomodule/core (= 0.72.3) - ReactCommon/turbomodule/core (= 0.72.7)
- React-RCTImage (0.72.3): - React-RCTImage (0.72.7):
- RCT-Folly (= 2021.07.22.00) - RCT-Folly (= 2021.07.22.00)
- RCTTypeSafety (= 0.72.3) - RCTTypeSafety (= 0.72.7)
- React-Codegen (= 0.72.3) - React-Codegen (= 0.72.7)
- React-Core/RCTImageHeaders (= 0.72.3) - React-Core/RCTImageHeaders (= 0.72.7)
- React-jsi (= 0.72.3) - React-jsi (= 0.72.7)
- React-RCTNetwork (= 0.72.3) - React-RCTNetwork (= 0.72.7)
- ReactCommon/turbomodule/core (= 0.72.3) - ReactCommon/turbomodule/core (= 0.72.7)
- React-RCTLinking (0.72.3): - React-RCTLinking (0.72.7):
- React-Codegen (= 0.72.3) - React-Codegen (= 0.72.7)
- React-Core/RCTLinkingHeaders (= 0.72.3) - React-Core/RCTLinkingHeaders (= 0.72.7)
- React-jsi (= 0.72.3) - React-jsi (= 0.72.7)
- ReactCommon/turbomodule/core (= 0.72.3) - ReactCommon/turbomodule/core (= 0.72.7)
- React-RCTNetwork (0.72.3): - React-RCTNetwork (0.72.7):
- RCT-Folly (= 2021.07.22.00) - RCT-Folly (= 2021.07.22.00)
- RCTTypeSafety (= 0.72.3) - RCTTypeSafety (= 0.72.7)
- React-Codegen (= 0.72.3) - React-Codegen (= 0.72.7)
- React-Core/RCTNetworkHeaders (= 0.72.3) - React-Core/RCTNetworkHeaders (= 0.72.7)
- React-jsi (= 0.72.3) - React-jsi (= 0.72.7)
- ReactCommon/turbomodule/core (= 0.72.3) - ReactCommon/turbomodule/core (= 0.72.7)
- React-RCTSettings (0.72.3): - React-RCTSettings (0.72.7):
- RCT-Folly (= 2021.07.22.00) - RCT-Folly (= 2021.07.22.00)
- RCTTypeSafety (= 0.72.3) - RCTTypeSafety (= 0.72.7)
- React-Codegen (= 0.72.3) - React-Codegen (= 0.72.7)
- React-Core/RCTSettingsHeaders (= 0.72.3) - React-Core/RCTSettingsHeaders (= 0.72.7)
- React-jsi (= 0.72.3) - React-jsi (= 0.72.7)
- ReactCommon/turbomodule/core (= 0.72.3) - ReactCommon/turbomodule/core (= 0.72.7)
- React-RCTText (0.72.3): - React-RCTText (0.72.7):
- React-Core/RCTTextHeaders (= 0.72.3) - React-Core/RCTTextHeaders (= 0.72.7)
- React-RCTVibration (0.72.3): - React-RCTVibration (0.72.7):
- RCT-Folly (= 2021.07.22.00) - RCT-Folly (= 2021.07.22.00)
- React-Codegen (= 0.72.3) - React-Codegen (= 0.72.7)
- React-Core/RCTVibrationHeaders (= 0.72.3) - React-Core/RCTVibrationHeaders (= 0.72.7)
- React-jsi (= 0.72.3) - React-jsi (= 0.72.7)
- ReactCommon/turbomodule/core (= 0.72.3) - ReactCommon/turbomodule/core (= 0.72.7)
- React-rncore (0.72.3) - React-rncore (0.72.7)
- React-runtimeexecutor (0.72.3): - React-runtimeexecutor (0.72.7):
- React-jsi (= 0.72.3) - React-jsi (= 0.72.7)
- React-runtimescheduler (0.72.3): - React-runtimescheduler (0.72.7):
- glog - glog
- hermes-engine - hermes-engine
- RCT-Folly (= 2021.07.22.00) - RCT-Folly (= 2021.07.22.00)
@ -434,71 +434,48 @@ PODS:
- React-debug - React-debug
- React-jsi - React-jsi
- React-runtimeexecutor - React-runtimeexecutor
- React-utils (0.72.3): - React-utils (0.72.7):
- glog - glog
- RCT-Folly (= 2021.07.22.00) - RCT-Folly (= 2021.07.22.00)
- React-debug - React-debug
- ReactCommon/turbomodule/bridging (0.72.3): - ReactCommon/turbomodule/bridging (0.72.7):
- DoubleConversion - DoubleConversion
- glog - glog
- hermes-engine - hermes-engine
- RCT-Folly (= 2021.07.22.00) - RCT-Folly (= 2021.07.22.00)
- React-callinvoker (= 0.72.3) - React-callinvoker (= 0.72.7)
- React-cxxreact (= 0.72.3) - React-cxxreact (= 0.72.7)
- React-jsi (= 0.72.3) - React-jsi (= 0.72.7)
- React-logger (= 0.72.3) - React-logger (= 0.72.7)
- React-perflogger (= 0.72.3) - React-perflogger (= 0.72.7)
- ReactCommon/turbomodule/core (0.72.3): - ReactCommon/turbomodule/core (0.72.7):
- DoubleConversion - DoubleConversion
- glog - glog
- hermes-engine - hermes-engine
- RCT-Folly (= 2021.07.22.00) - RCT-Folly (= 2021.07.22.00)
- React-callinvoker (= 0.72.3) - React-callinvoker (= 0.72.7)
- React-cxxreact (= 0.72.3) - React-cxxreact (= 0.72.7)
- React-jsi (= 0.72.3) - React-jsi (= 0.72.7)
- React-logger (= 0.72.3) - React-logger (= 0.72.7)
- React-perflogger (= 0.72.3) - React-perflogger (= 0.72.7)
- RNFastImage (8.6.3): - RNFastImage (8.6.3):
- React-Core - React-Core
- SDWebImage (~> 5.11.1) - SDWebImage (~> 5.11.1)
- SDWebImageWebPCoder (~> 0.8.4) - SDWebImageWebPCoder (~> 0.8.4)
- RNGestureHandler (2.12.1): - RNGestureHandler (2.14.0):
- RCT-Folly (= 2021.07.22.00)
- React-Core - React-Core
- RNReanimated (3.5.4): - RNReanimated (3.6.1):
- DoubleConversion - RCT-Folly (= 2021.07.22.00)
- FBLazyVector
- glog
- hermes-engine
- RCT-Folly
- RCTRequired
- RCTTypeSafety
- React-callinvoker
- React-Core - React-Core
- React-Core/DevSupport
- React-Core/RCTWebSocket
- React-CoreModules
- React-cxxreact
- React-hermes
- React-jsi
- React-jsiexecutor
- React-jsinspector
- React-RCTActionSheet
- React-RCTAnimation
- React-RCTAppDelegate
- React-RCTBlob
- React-RCTImage
- React-RCTLinking
- React-RCTNetwork
- React-RCTSettings
- React-RCTText
- ReactCommon/turbomodule/core - ReactCommon/turbomodule/core
- Yoga - RNScreens (3.29.0):
- RNScreens (3.24.0): - RCT-Folly (= 2021.07.22.00)
- React-Core - React-Core
- React-RCTImage
- RNStaticSafeAreaInsets (2.2.0): - RNStaticSafeAreaInsets (2.2.0):
- React-Core - React-Core
- RNVectorIcons (10.0.0): - RNVectorIcons (10.0.2):
- RCT-Folly (= 2021.07.22.00)
- React-Core - React-Core
- SDWebImage (5.11.1): - SDWebImage (5.11.1):
- SDWebImage/Core (= 5.11.1) - SDWebImage/Core (= 5.11.1)
@ -507,7 +484,7 @@ PODS:
- libwebp (~> 1.0) - libwebp (~> 1.0)
- SDWebImage/Core (~> 5.10) - SDWebImage/Core (~> 5.10)
- SocketRocket (0.6.1) - SocketRocket (0.6.1)
- VisionCamera (3.6.15): - VisionCamera (3.6.16):
- React - React
- React-callinvoker - React-callinvoker
- React-Core - React-Core
@ -594,7 +571,7 @@ EXTERNAL SOURCES:
:podspec: "../node_modules/react-native/third-party-podspecs/glog.podspec" :podspec: "../node_modules/react-native/third-party-podspecs/glog.podspec"
hermes-engine: hermes-engine:
:podspec: "../node_modules/react-native/sdks/hermes-engine/hermes-engine.podspec" :podspec: "../node_modules/react-native/sdks/hermes-engine/hermes-engine.podspec"
:tag: hermes-2023-03-20-RNv0.72.0-49794cfc7c81fb8f69fd60c3bbf85a7480cc5a77 :tag: hermes-2023-08-07-RNv0.72.4-813b2def12bc9df02654b3e3653ae4a68d0572e0
RCT-Folly: RCT-Folly:
:podspec: "../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec" :podspec: "../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec"
RCTRequired: RCTRequired:
@ -691,65 +668,65 @@ EXTERNAL SOURCES:
SPEC CHECKSUMS: SPEC CHECKSUMS:
boost: 57d2868c099736d80fcd648bf211b4431e51a558 boost: 57d2868c099736d80fcd648bf211b4431e51a558
DoubleConversion: 5189b271737e1565bdce30deb4a08d647e3f5f54 DoubleConversion: 5189b271737e1565bdce30deb4a08d647e3f5f54
FBLazyVector: 4cce221dd782d3ff7c4172167bba09d58af67ccb FBLazyVector: 5fbbff1d7734827299274638deb8ba3024f6c597
FBReactNativeSpec: c6bd9e179757b3c0ecf815864fae8032377903ef FBReactNativeSpec: 638095fe8a01506634d77b260ef8a322019ac671
fmt: ff9d55029c625d3757ed641535fd4a75fedc7ce9 fmt: ff9d55029c625d3757ed641535fd4a75fedc7ce9
glog: 04b94705f318337d7ead9e6d17c019bd9b1f6b1b glog: 04b94705f318337d7ead9e6d17c019bd9b1f6b1b
hermes-engine: 10fbd3f62405c41ea07e71973ea61e1878d07322 hermes-engine: 9180d43df05c1ed658a87cc733dc3044cf90c00a
libevent: 4049cae6c81cdb3654a443be001fb9bdceff7913 libevent: 4049cae6c81cdb3654a443be001fb9bdceff7913
libwebp: 1786c9f4ff8a279e4dac1e8f385004d5fc253009 libwebp: 1786c9f4ff8a279e4dac1e8f385004d5fc253009
MMKV: f21593c0af4b3f2a0ceb8f820f28bb639ea22bb7 MMKV: f21593c0af4b3f2a0ceb8f820f28bb639ea22bb7
MMKVCore: 31b4cb83f8266467eef20a35b6d78e409a11060d MMKVCore: 31b4cb83f8266467eef20a35b6d78e409a11060d
RCT-Folly: 424b8c9a7a0b9ab2886ffe9c3b041ef628fd4fb1 RCT-Folly: 424b8c9a7a0b9ab2886ffe9c3b041ef628fd4fb1
RCTRequired: a2faf4bad4e438ca37b2040cb8f7799baa065c18 RCTRequired: 83bca1c184feb4d2e51c72c8369b83d641443f95
RCTTypeSafety: cb09f3e4747b6d18331a15eb05271de7441ca0b3 RCTTypeSafety: 13c4a87a16d7db6cd66006ce9759f073402ef85b
React: 13109005b5353095c052f26af37413340ccf7a5d React: e67aa9f99957c7611c392b5e49355d877d6525e2
React-callinvoker: c8c87bce983aa499c13cb06d4447c025a35274d6 React-callinvoker: 2790c09d964c2e5404b5410cde91b152e3746b7b
React-Codegen: 712d523524d89d71f1cf7cc624854941be983c4d React-Codegen: e6e05e105ca7cdb990f4d609985a2a689d8d0653
React-Core: 688f88b7f3a3d30b4848036223f8b07102c687e5 React-Core: 9283f1e7d0d5e3d33ad298547547b1b43912534c
React-CoreModules: 63c063a3ade8fb3b1bec5fd9a50f17b0421558c6 React-CoreModules: 6312c9b2fec4329d9ae6a2b8c350032d1664c51b
React-cxxreact: 37765b4975541105b2a3322a4b473417c158c869 React-cxxreact: 7da72565656c8ac7f97c9a031d0b199bbdec0640
React-debug: 51f11ef8db14b47f24e71c42a4916d4192972156 React-debug: 4accb2b9dc09b575206d2c42f4082990a52ae436
React-hermes: 935ae71fb3d7654e947beba8498835cd5e479707 React-hermes: 1299a94f255f59a72d5baa54a2ca2e1eee104947
React-jsi: ec628dc7a15ffea969f237b0ea6d2fde212b19dd React-jsi: 2208de64c3a41714ac04e86975386fc49116ea13
React-jsiexecutor: 59d1eb03af7d30b7d66589c410f13151271e8006 React-jsiexecutor: c49502e5d02112247ee4526bc3ccfc891ae3eb9b
React-jsinspector: b511447170f561157547bc0bef3f169663860be7 React-jsinspector: 8baadae51f01d867c3921213a25ab78ab4fbcd91
React-logger: c5b527272d5f22eaa09bb3c3a690fee8f237ae95 React-logger: 8edc785c47c8686c7962199a307015e2ce9a0e4f
react-native-blur: cfdad7b3c01d725ab62a8a729f42ea463998afa2 react-native-blur: cfdad7b3c01d725ab62a8a729f42ea463998afa2
react-native-cameraroll: 134805127580aed23403b8c2cb1548920dd77b3a react-native-cameraroll: 4701ae7c3dbcd3f5e9e150ca17f250a276154b35
react-native-mmkv: 9ae7ca3977e8ef48dbf7f066974eb844c20b5fd7 react-native-mmkv: e97c0c79403fb94577e5d902ab1ebd42b0715b43
react-native-safe-area-context: 9697629f7b2cda43cf52169bb7e0767d330648c2 react-native-safe-area-context: d1c8161a1e9560f7066e8926a7d825eb57c5dab5
react-native-video: c26780b224543c62d5e1b2a7244a5cd1b50e8253 react-native-video: c26780b224543c62d5e1b2a7244a5cd1b50e8253
react-native-worklets-core: b4094f51cb2bc649e297206425cb8956f4945e3e react-native-worklets-core: b4094f51cb2bc649e297206425cb8956f4945e3e
React-NativeModulesApple: c57f3efe0df288a6532b726ad2d0322a9bf38472 React-NativeModulesApple: b6868ee904013a7923128892ee4a032498a1024a
React-perflogger: 6bd153e776e6beed54c56b0847e1220a3ff92ba5 React-perflogger: 31ea61077185eb1428baf60c0db6e2886f141a5a
React-RCTActionSheet: c0b62af44e610e69d9a2049a682f5dba4e9dff17 React-RCTActionSheet: 392090a3abc8992eb269ef0eaa561750588fc39d
React-RCTAnimation: f9bf9719258926aea9ecb8a2aa2595d3ff9a6022 React-RCTAnimation: 4b3cc6a29474bc0d78c4f04b52ab59bf760e8a9b
React-RCTAppDelegate: e5ac35d4dbd1fae7df3a62b47db04b6a8d151592 React-RCTAppDelegate: 89b015b29885109addcabecdf3b2e833905437c7
React-RCTBlob: c4f1e69a6ef739aa42586b876d637dab4e3b5bed React-RCTBlob: 3e23dcbe6638897b5605e46d0d62955d78e8d27b
React-RCTImage: e5798f01aba248416c02a506cf5e6dfcba827638 React-RCTImage: 8a5d339d614a90a183fc1b8b6a7eb44e2e703943
React-RCTLinking: f5b6227c879e33206f34e68924c458f57bbb96d9 React-RCTLinking: b37dfbf646d77c326f9eae094b1fcd575b1c24c7
React-RCTNetwork: d5554fbfac1c618da3c8fa29933108ea22837788 React-RCTNetwork: 8bed9b2461c7d8a7d14e63df9b16181c448beebc
React-RCTSettings: 189c71e3e6146ba59f4f7e2cbeb494cf2ad42afa React-RCTSettings: 506a5f09a455123a8873801b70aa7b4010b76b01
React-RCTText: 19425aea9d8b6ccae55a27916355b17ab577e56e React-RCTText: 3c71ecaad8ee010b79632ea2590f86c02f5cce17
React-RCTVibration: 388ac0e1455420895d1ca2548401eed964b038a6 React-RCTVibration: d1b78ca38f61ea4b3e9ebb2ddbd0b5662631d99b
React-rncore: 755a331dd67b74662108f2d66a384454bf8dc1a1 React-rncore: bfc2f6568b6fecbae6f2f774e95c60c3c9e95bf2
React-runtimeexecutor: 369ae9bb3f83b65201c0c8f7d50b72280b5a1dbc React-runtimeexecutor: 47b0a2d5bbb416db65ef881a6f7bdcfefa0001ab
React-runtimescheduler: 837c1bebd2f84572db17698cd702ceaf585b0d9a React-runtimescheduler: 7649c3b46c8dee1853691ecf60146a16ae59253c
React-utils: bcb57da67eec2711f8b353f6e3d33bd8e4b2efa3 React-utils: 56838edeaaf651220d1e53cd0b8934fb8ce68415
ReactCommon: 3ccb8fb14e6b3277e38c73b0ff5e4a1b8db017a9 ReactCommon: 5f704096ccf7733b390f59043b6fa9cc180ee4f6
RNFastImage: 5c9c9fed9c076e521b3f509fe79e790418a544e8 RNFastImage: 5c9c9fed9c076e521b3f509fe79e790418a544e8
RNGestureHandler: c0d04458598fcb26052494ae23dda8f8f5162b13 RNGestureHandler: 32a01c29ecc9bb0b5bf7bc0a33547f61b4dc2741
RNReanimated: ab2e96c6d5591c3dfbb38a464f54c8d17fb34a87 RNReanimated: fdbaa9c964bbab7fac50c90862b6cc5f041679b9
RNScreens: b21dc57dfa2b710c30ec600786a3fc223b1b92e7 RNScreens: 3c5b9f4a9dcde752466854b6109b79c0e205dad3
RNStaticSafeAreaInsets: 055ddbf5e476321720457cdaeec0ff2ba40ec1b8 RNStaticSafeAreaInsets: 055ddbf5e476321720457cdaeec0ff2ba40ec1b8
RNVectorIcons: 8b5bb0fa61d54cd2020af4f24a51841ce365c7e9 RNVectorIcons: 23b6e11af4aaf104d169b1b0afa7e5cf96c676ce
SDWebImage: a7f831e1a65eb5e285e3fb046a23fcfbf08e696d SDWebImage: a7f831e1a65eb5e285e3fb046a23fcfbf08e696d
SDWebImageWebPCoder: 908b83b6adda48effe7667cd2b7f78c897e5111d SDWebImageWebPCoder: 908b83b6adda48effe7667cd2b7f78c897e5111d
SocketRocket: f32cd54efbe0f095c4d7594881e52619cfe80b17 SocketRocket: f32cd54efbe0f095c4d7594881e52619cfe80b17
VisionCamera: 2455110d07faac2da182a26c2bfeb0b9a0e34875 VisionCamera: 06f5b990082ec783a58dcadc5bac677974f7a580
Yoga: 8796b55dba14d7004f980b54bcc9833ee45b28ce Yoga: 4c3aa327e4a6a23eeacd71f61c81df1bcdf677d5
PODFILE CHECKSUM: 27f53791141a3303d814e09b55770336416ff4eb PODFILE CHECKSUM: 27f53791141a3303d814e09b55770336416ff4eb
COCOAPODS: 1.14.3 COCOAPODS: 1.11.3

View File

@ -501,6 +501,7 @@
GCC_PREPROCESSOR_DEFINITIONS = ( GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1", "DEBUG=1",
"$(inherited)", "$(inherited)",
_LIBCPP_ENABLE_CXX17_REMOVED_UNARY_BINARY_FUNCTION,
); );
GCC_SYMBOLS_PRIVATE_EXTERN = NO; GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
@ -520,6 +521,11 @@
ONLY_ACTIVE_ARCH = YES; ONLY_ACTIVE_ARCH = YES;
OTHER_CFLAGS = "$(inherited)"; OTHER_CFLAGS = "$(inherited)";
OTHER_CPLUSPLUSFLAGS = "$(inherited)"; OTHER_CPLUSPLUSFLAGS = "$(inherited)";
OTHER_LDFLAGS = (
"$(inherited)",
"-Wl",
"-ld_classic",
);
OTHER_SWIFT_FLAGS = "$(inherited) -DVISION_CAMERA_ENABLE_FRAME_PROCESSORS"; OTHER_SWIFT_FLAGS = "$(inherited) -DVISION_CAMERA_ENABLE_FRAME_PROCESSORS";
REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native"; REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native";
SDKROOT = iphoneos; SDKROOT = iphoneos;
@ -562,6 +568,10 @@
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = i386; "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = i386;
GCC_C_LANGUAGE_STANDARD = gnu99; GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_NO_COMMON_BLOCKS = YES; GCC_NO_COMMON_BLOCKS = YES;
GCC_PREPROCESSOR_DEFINITIONS = (
"$(inherited)",
_LIBCPP_ENABLE_CXX17_REMOVED_UNARY_BINARY_FUNCTION,
);
GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES; GCC_WARN_UNDECLARED_SELECTOR = YES;
@ -578,6 +588,11 @@
MTL_ENABLE_DEBUG_INFO = NO; MTL_ENABLE_DEBUG_INFO = NO;
OTHER_CFLAGS = "$(inherited)"; OTHER_CFLAGS = "$(inherited)";
OTHER_CPLUSPLUSFLAGS = "$(inherited)"; OTHER_CPLUSPLUSFLAGS = "$(inherited)";
OTHER_LDFLAGS = (
"$(inherited)",
"-Wl",
"-ld_classic",
);
OTHER_SWIFT_FLAGS = "$(inherited) -DVISION_CAMERA_ENABLE_FRAME_PROCESSORS"; OTHER_SWIFT_FLAGS = "$(inherited) -DVISION_CAMERA_ENABLE_FRAME_PROCESSORS";
REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native"; REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native";
SDKROOT = iphoneos; SDKROOT = iphoneos;

View File

@ -7,7 +7,7 @@
"android": "react-native run-android", "android": "react-native run-android",
"ios": "react-native run-ios", "ios": "react-native run-ios",
"start": "react-native start", "start": "react-native start",
"pods": "cd ios && pod install", "pods": "cd ios && bundle exec pod install",
"lint": "eslint . --fix", "lint": "eslint . --fix",
"lint-ci": "yarn lint -f ../node_modules/@firmnav/eslint-github-actions-formatter/dist/formatter.js", "lint-ci": "yarn lint -f ../node_modules/@firmnav/eslint-github-actions-formatter/dist/formatter.js",
"typescript": "tsc --noEmit" "typescript": "tsc --noEmit"

File diff suppressed because it is too large Load Diff

View File

@ -16,6 +16,7 @@ import Foundation
class CameraSession: NSObject, AVCaptureVideoDataOutputSampleBufferDelegate, AVCaptureAudioDataOutputSampleBufferDelegate { class CameraSession: NSObject, AVCaptureVideoDataOutputSampleBufferDelegate, AVCaptureAudioDataOutputSampleBufferDelegate {
// Configuration // Configuration
var configuration: CameraConfiguration? var configuration: CameraConfiguration?
var currentConfigureCall: DispatchTime = .now()
// Capture Session // Capture Session
let captureSession = AVCaptureSession() let captureSession = AVCaptureSession()
let audioCaptureSession = AVCaptureSession() let audioCaptureSession = AVCaptureSession()
@ -98,6 +99,10 @@ class CameraSession: NSObject, AVCaptureVideoDataOutputSampleBufferDelegate, AVC
The `configuration` object is a copy of the currently active configuration that can be modified by the caller in the lambda. The `configuration` object is a copy of the currently active configuration that can be modified by the caller in the lambda.
*/ */
func configure(_ lambda: (_ configuration: CameraConfiguration) throws -> Void) { func configure(_ lambda: (_ configuration: CameraConfiguration) throws -> Void) {
// This is the latest call to configure()
let time = DispatchTime.now()
currentConfigureCall = time
ReactLogger.log(level: .info, message: "Updating Session Configuration...") ReactLogger.log(level: .info, message: "Updating Session Configuration...")
// Let caller configure a new configuration for the Camera. // Let caller configure a new configuration for the Camera.
@ -109,8 +114,14 @@ class CameraSession: NSObject, AVCaptureVideoDataOutputSampleBufferDelegate, AVC
} }
let difference = CameraConfiguration.Difference(between: configuration, and: config) let difference = CameraConfiguration.Difference(between: configuration, and: config)
// Set up Camera (Video) Capture Session (on camera queue) // Set up Camera (Video) Capture Session (on camera queue, acts like a lock)
CameraQueues.cameraQueue.async { CameraQueues.cameraQueue.async {
// Cancel configuration if there has already been a new config
guard self.currentConfigureCall == time else {
// configure() has been called again just now, skip this one so the new call takes over.
return
}
do { do {
// If needed, configure the AVCaptureSession (inputs, outputs) // If needed, configure the AVCaptureSession (inputs, outputs)
if difference.isSessionConfigurationDirty { if difference.isSessionConfigurationDirty {
@ -175,32 +186,32 @@ class CameraSession: NSObject, AVCaptureVideoDataOutputSampleBufferDelegate, AVC
if difference.inputChanged { if difference.inputChanged {
self.delegate?.onSessionInitialized() self.delegate?.onSessionInitialized()
} }
// After configuring, set this to the new configuration.
self.configuration = config
} catch { } catch {
self.onConfigureError(error) self.onConfigureError(error)
} }
}
// Set up Audio Capture Session (on audio queue) // Set up Audio Capture Session (on audio queue)
if difference.audioSessionChanged { if difference.audioSessionChanged {
CameraQueues.audioQueue.async { CameraQueues.audioQueue.async {
do { do {
// Lock Capture Session for configuration // Lock Capture Session for configuration
ReactLogger.log(level: .info, message: "Beginning AudioSession configuration...") ReactLogger.log(level: .info, message: "Beginning AudioSession configuration...")
self.audioCaptureSession.beginConfiguration() self.audioCaptureSession.beginConfiguration()
try self.configureAudioSession(configuration: config) try self.configureAudioSession(configuration: config)
// Unlock Capture Session again and submit configuration to Hardware // Unlock Capture Session again and submit configuration to Hardware
self.audioCaptureSession.commitConfiguration() self.audioCaptureSession.commitConfiguration()
ReactLogger.log(level: .info, message: "Committed AudioSession configuration!") ReactLogger.log(level: .info, message: "Committed AudioSession configuration!")
} catch { } catch {
self.onConfigureError(error) self.onConfigureError(error)
}
} }
} }
} }
// After configuring, set this to the new configuration.
configuration = config
} }
/** /**

File diff suppressed because it is too large Load Diff