Skip to content

Commit

Permalink
AVCaptureDeviceTypeExternal の利用には macOS 14 以上が必要だったが、 GitHub Actions …
Browse files Browse the repository at this point in the history
…では macOS 14 が利用できなかったため古い API を使う
  • Loading branch information
enm10k committed Nov 1, 2023
1 parent 49d2827 commit 8af5b0a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ jobs:
- macos_arm64
- ios
name: Build sora-cpp-sdk for ${{ matrix.name }}
runs-on: macos-14
runs-on: macos-12
steps:
- uses: actions/checkout@v4
- name: Env to output
Expand Down
12 changes: 7 additions & 5 deletions src/mac/mac_capturer.mm
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,13 @@ - (void)capturer:(RTCVideoCapturer*)capturer
NSArray<AVCaptureDevice*>* captureDevices() {
// macOS では USB で接続されたカメラも取得する
#if defined(SORA_CPP_SDK_MACOS)
AVCaptureDeviceDiscoverySession *session = [AVCaptureDeviceDiscoverySession
discoverySessionWithDeviceTypes:@[ AVCaptureDeviceTypeBuiltInWideAngleCamera, AVCaptureDeviceTypeExternal ]
mediaType:AVMediaTypeVideo
position:AVCaptureDevicePositionUnspecified];
return session.devices;
// AVCaptureDeviceTypeExternal の利用には macOS 14 以上が必要だが、 GitHub Actions では macOS 14 が利用出来ないため一時的に古い API を使う
// AVCaptureDeviceDiscoverySession *session = [AVCaptureDeviceDiscoverySession
// discoverySessionWithDeviceTypes:@[ AVCaptureDeviceTypeBuiltInWideAngleCamera, AVCaptureDeviceTypeExternal ]
// mediaType:AVMediaTypeVideo
// position:AVCaptureDevicePositionUnspecified];
// return session.devices;
return [AVCaptureDevice devicesWithMediaType:AVMediaTypeVideo];
#else
return [RTCCameraVideoCapturer captureDevices];
# endif
Expand Down

0 comments on commit 8af5b0a

Please sign in to comment.