Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Separate VisionCamera into React, Core and FrameProcessors subspecs #2764

Merged
merged 2 commits into from
Apr 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
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.
Loading