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

macOS では USB で接続されたカメラも取得する #44

Merged
merged 6 commits into from
Nov 9, 2023

Conversation

enm10k
Copy link
Contributor

@enm10k enm10k commented Nov 1, 2023

No description provided.

@enm10k enm10k requested a review from melpon November 1, 2023 02:30
@@ -91,9 +91,24 @@ - (void)capturer:(RTCVideoCapturer*)capturer
return rtc::make_ref_counted<MacCapturer>(c);
}

NSArray<AVCaptureDevice*>* captureDevices() {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@melpon
EnumVideoDevice のように MacCapturer のプライベート・メソッドとして定義しようとしたのですが、その場合ヘッダーファイルの修正が必要でした (NSArray を利用しているためです)。

ヘッダーファイルの修正を避けるために captureDevices をこのように定義していますが、問題があれば教えてください。

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

このままだとグローバルに定義されちゃうので、static 関数として定義して下さい

@@ -91,9 +91,24 @@ - (void)capturer:(RTCVideoCapturer*)capturer
return rtc::make_ref_counted<MacCapturer>(c);
}

NSArray<AVCaptureDevice*>* captureDevices() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

このままだとグローバルに定義されちゃうので、static 関数として定義して下さい

// return session.devices;
return [AVCaptureDevice devicesWithMediaType:AVMediaTypeVideo];
#else
return [RTCCameraVideoCapturer captureDevices];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

これ macOS 以外は RTCCameraVideoCapturer に渡してますけど、libwebrtc のデバイス列挙の処理が変わったらまた問題起きるかもなので、iOS の場合も自作した方が良さそうな気がします

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

レビューありがとうございます
修正しました

Copy link
Contributor

@melpon melpon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

よさそう

@miosakuma
Copy link
Contributor

確認ありがとうございました、マージします。

@miosakuma miosakuma merged commit 423b1a4 into develop Nov 9, 2023
8 checks passed
@miosakuma miosakuma deleted the feature/capture-macos-external-camera branch November 9, 2023 01:56
melpon pushed a commit that referenced this pull request Mar 26, 2024
ローカルの CPP SDK を参照してビルドするためのオプションを追加する
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants