-
Notifications
You must be signed in to change notification settings - Fork 101
Refactor and enable switching between cameras using physical id. #676
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
base: main
Are you sure you want to change the base?
Conversation
🦋 Changeset detectedLatest commit: c3a2981 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
) : Camera2Enumerator(context) { | ||
|
||
override fun createCapturer( | ||
deviceName: String?, | ||
eventsHandler: CameraVideoCapturer.CameraEventsHandler?, | ||
): CameraVideoCapturer { | ||
return CameraXCapturer(context, lifecycleOwner, deviceName, eventsHandler, useCases, physicalCameraId) | ||
val deviceInfo = findCamera(cameraManager!!, deviceName, fallback = true)!! | ||
return CameraXCapturer(this, lifecycleOwner, cameraManager!!, deviceInfo, eventsHandler, useCases) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Passing this
instead of creating it again inside CameraXCapturer
. From my testing I didn't see any problems with this change. Let me know if i'm missing anything.
livekit-android-sdk/src/main/java/io/livekit/android/room/track/video/CameraCapturerUtils.kt
Outdated
Show resolved
Hide resolved
@davidliu I'm not sure why the check is failing. Any ideas how to fix it? |
livekit-android-camerax/src/main/java/livekit/org/webrtc/CameraXCapturer.kt
Outdated
Show resolved
Hide resolved
livekit-android-camerax/src/main/java/livekit/org/webrtc/CameraXCapturer.kt
Outdated
Show resolved
Hide resolved
livekit-android-camerax/src/main/java/livekit/org/webrtc/CameraXEnumerator.kt
Outdated
Show resolved
Hide resolved
Looks like the test is failing due to this:
This is thrown when the capturer couldn't be created, likely due to no camera being found. We have a You can run tests locally, through ./gradlew livekit-android-test:testRelease or simply right clicking the livekit-android-test test folder and running the tests through Android Studio. |
This PR is mainly to make
switchCamera
api supportdeviceId
that is physical. The previous PR #668 supports it only during initialization.