From 8af5b0ad600b5129ebe81e1a2665280c4a129a87 Mon Sep 17 00:00:00 2001 From: enm10k Date: Wed, 1 Nov 2023 10:56:58 +0900 Subject: [PATCH] =?UTF-8?q?AVCaptureDeviceTypeExternal=20=E3=81=AE?= =?UTF-8?q?=E5=88=A9=E7=94=A8=E3=81=AB=E3=81=AF=20macOS=2014=20=E4=BB=A5?= =?UTF-8?q?=E4=B8=8A=E3=81=8C=E5=BF=85=E8=A6=81=E3=81=A0=E3=81=A3=E3=81=9F?= =?UTF-8?q?=E3=81=8C=E3=80=81=20GitHub=20Actions=20=E3=81=A7=E3=81=AF=20ma?= =?UTF-8?q?cOS=2014=20=E3=81=8C=E5=88=A9=E7=94=A8=E3=81=A7=E3=81=8D?= =?UTF-8?q?=E3=81=AA=E3=81=8B=E3=81=A3=E3=81=9F=E3=81=9F=E3=82=81=E5=8F=A4?= =?UTF-8?q?=E3=81=84=20API=20=E3=82=92=E4=BD=BF=E3=81=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build.yml | 2 +- src/mac/mac_capturer.mm | 12 +++++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4dd158ba..eed88475 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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 diff --git a/src/mac/mac_capturer.mm b/src/mac/mac_capturer.mm index 057936cf..475ff9c3 100644 --- a/src/mac/mac_capturer.mm +++ b/src/mac/mac_capturer.mm @@ -94,11 +94,13 @@ - (void)capturer:(RTCVideoCapturer*)capturer NSArray* 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