Skip to content

Commit

Permalink
feat: Separate VisionCamera into React, Core and `FrameProcessors…
Browse files Browse the repository at this point in the history
…` subspecs (#2764)

* feat: Separate VisionCamera into `React`, `Core` and `FrameProcessors` subspecs

* Split utils
  • Loading branch information
mrousavy authored Apr 21, 2024
1 parent f7dbb24 commit 464ea94
Show file tree
Hide file tree
Showing 67 changed files with 27 additions and 22 deletions.
34 changes: 18 additions & 16 deletions package/VisionCamera.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -51,24 +51,26 @@ Pod::Spec.new do |s|

s.requires_arc = true

s.dependency "React-Core"

s.subspec 'Core' do |core|
# VisionCamera Core Swift codebase
core.source_files = [
"ios/*.{m,mm,swift}",
"ios/Core/*.{m,mm,swift}",
"ios/Extensions/*.{m,mm,swift}",
"ios/Parsers/*.{m,mm,swift}",
"ios/React Utils/*.{m,mm,swift}",
"ios/Types/*.{m,mm,swift}",
"ios/CameraBridge.h",
]
core.source_files = "ios/Core/**/*.swift"

core.pod_target_xcconfig = {
"SWIFT_ACTIVE_COMPILATION_CONDITIONS" => "$(inherited) #{enableLocation ? "VISION_CAMERA_ENABLE_LOCATION" : ""}",
}
end

s.subspec 'React' do |core|
# VisionCamera React-specific Swift codebase
core.source_files = [
"ios/React/**/*.swift",
"ios/React/**/*.{h,m}",
]
core.public_header_files = [
"ios/React/CameraBridge.h"
]

core.dependency "React-Core"
if enableFrameProcessors
core.dependency "VisionCamera/FrameProcessors"
end
Expand All @@ -77,13 +79,9 @@ Pod::Spec.new do |s|
if enableFrameProcessors
s.subspec 'FrameProcessors' do |fp|
# VisionCamera Frame Processors C++ codebase (optional)
fp.dependency "React"
fp.dependency "React-callinvoker"
fp.dependency "react-native-worklets-core"

fp.source_files = [
# C++ sources
"ios/Frame Processor/*.{h,m,mm,cpp}",
"ios/Frame Processor/**/*.{h,m,mm}",
"cpp/**/*.{h,cpp}",
]
fp.public_header_files = [
Expand All @@ -102,6 +100,10 @@ Pod::Spec.new do |s|
"CLANG_CXX_LANGUAGE_STANDARD" => "c++17",
"HEADER_SEARCH_PATHS" => "$(inherited) \"$(PODS_TARGET_SRCROOT)/cpp/\"/** "
}

fp.dependency "React"
fp.dependency "React-callinvoker"
fp.dependency "react-native-worklets-core"
end
end
end
12 changes: 6 additions & 6 deletions package/example/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -468,17 +468,17 @@ PODS:
- React-Core
- SocketRocket (0.6.1)
- VisionCamera (4.0.0-beta.16):
- React-Core
- VisionCamera/Core (= 4.0.0-beta.16)
- VisionCamera/FrameProcessors (= 4.0.0-beta.16)
- VisionCamera/Core (4.0.0-beta.16):
- React-Core
- VisionCamera/FrameProcessors
- VisionCamera/React (= 4.0.0-beta.16)
- VisionCamera/Core (4.0.0-beta.16)
- VisionCamera/FrameProcessors (4.0.0-beta.16):
- React
- React-callinvoker
- React-Core
- react-native-worklets-core
- VisionCamera/React (4.0.0-beta.16):
- React-Core
- VisionCamera/FrameProcessors
- Yoga (1.14.0)

DEPENDENCIES:
Expand Down Expand Up @@ -708,7 +708,7 @@ SPEC CHECKSUMS:
RNStaticSafeAreaInsets: 055ddbf5e476321720457cdaeec0ff2ba40ec1b8
RNVectorIcons: 23b6e11af4aaf104d169b1b0afa7e5cf96c676ce
SocketRocket: f32cd54efbe0f095c4d7594881e52619cfe80b17
VisionCamera: 129f7e33050d9f45660e4510565ebbd1a0c15126
VisionCamera: f3bb394c7c842ff1ced88ee49294b329eb6d952f
Yoga: 4c3aa327e4a6a23eeacd71f61c81df1bcdf677d5

PODFILE CHECKSUM: 29d07573cd9f2aa1ecf53c481819da07fd66822e
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ import Foundation

#if VISION_CAMERA_ENABLE_FRAME_PROCESSORS

/**
* A binding for implementing the protocol required by the Frame Processors runtime.
*/
extension CameraViewManager: VisionCameraProxyDelegate {
func getDispatchQueue() -> DispatchQueue {
return CameraQueues.videoQueue
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 464ea94

Please sign in to comment.