Skip to content

Commit

Permalink
Add patch
Browse files Browse the repository at this point in the history
  • Loading branch information
evdokimovs committed Jan 26, 2024
1 parent 855fb1a commit 2b9c480
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 0 deletions.
2 changes: 2 additions & 0 deletions build/macos-arm64/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ copy: common-copy

.PHONY: patch
patch: common-patch
cd $(SRC_DIR) && \
patch -p2 < $(PATCH_DIR)/capture_device_support_on_old_macos.patch

.PHONY: build
build: patch
Expand Down
2 changes: 2 additions & 0 deletions build/macos-x64/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ copy: common-copy

.PHONY: patch
patch: common-patch
cd $(SRC_DIR) && \
patch -p2 < $(PATCH_DIR)/capture_device_support_on_old_macos.patch

.PHONY: build
build: patch
Expand Down
23 changes: 23 additions & 0 deletions patch/capture_device_support_on_old_macos.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
--- a/src/sdk/objc/components/capturer/RTCCameraVideoCapturer.m
+++ b/src/sdk/objc/components/capturer/RTCCameraVideoCapturer.m
@@ -118,11 +118,15 @@ - (void)dealloc {
}

+ (NSArray<AVCaptureDevice *> *)captureDevices {
- AVCaptureDeviceDiscoverySession *session = [AVCaptureDeviceDiscoverySession
- discoverySessionWithDeviceTypes:@[ AVCaptureDeviceTypeBuiltInWideAngleCamera ]
- mediaType:AVMediaTypeVideo
- position:AVCaptureDevicePositionUnspecified];
- return session.devices;
+ if (@available(macOS 10.15, *)) {
+ AVCaptureDeviceDiscoverySession *session = [AVCaptureDeviceDiscoverySession
+ discoverySessionWithDeviceTypes:@[ AVCaptureDeviceTypeBuiltInWideAngleCamera ]
+ mediaType:AVMediaTypeVideo
+ position:AVCaptureDevicePositionUnspecified];
+ return session.devices;
+ } else {
+ return [AVCaptureDevice devicesWithMediaType:AVMediaTypeVideo];
+ }
}

+ (NSArray<AVCaptureDeviceFormat *> *)supportedFormatsForDevice:(AVCaptureDevice *)device {

0 comments on commit 2b9c480

Please sign in to comment.