这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@KasemJaffer
Copy link
Contributor

@KasemJaffer KasemJaffer commented May 20, 2025

This PR is mainly to make switchCamera api support deviceId that is physical. The previous PR #668 supports it only during initialization.

@changeset-bot
Copy link

changeset-bot bot commented May 20, 2025

🦋 Changeset detected

Latest commit: c3a2981

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
client-sdk-android Patch

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

): CameraVideoCapturer {
return CameraXCapturer(context, lifecycleOwner, deviceName, eventsHandler, useCases, physicalCameraId)
val deviceInfo = findCamera(cameraManager!!, deviceName, fallback = true)!!
return CameraXCapturer(this, lifecycleOwner, cameraManager!!, deviceInfo, eventsHandler, useCases)
Copy link
Contributor Author

@KasemJaffer KasemJaffer May 20, 2025

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.

@KasemJaffer KasemJaffer changed the title Refactor and enable switching between cameras using physical id. switchCamera: Refactor and enable switching between cameras using physical id. May 20, 2025
@KasemJaffer KasemJaffer changed the title switchCamera: Refactor and enable switching between cameras using physical id. Refactor and enable switching between cameras using physical id. May 20, 2025
@KasemJaffer KasemJaffer marked this pull request as ready for review May 20, 2025 16:47
@KasemJaffer
Copy link
Contributor Author

@davidliu I'm not sure why the check is failing. Any ideas how to fix it?

@davidliu
Copy link
Contributor

@davidliu I'm not sure why the check is failing. Any ideas how to fix it?

Looks like the test is failing due to this:

	Suppressed: kotlin.NotImplementedError: An operation is not implemented.
		at io.livekit.android.room.track.LocalVideoTrack$Companion.createCameraTrack$livekit_android_sdk_debug(LocalVideoTrack.kt:465)

This is thrown when the capturer couldn't be created, likely due to no camera being found. We have a MockCameraProvider for use in unit tests here:

https://github.com/livekit/client-sdk-android/blob/main/livekit-android-test/src/main/java/io/livekit/android/test/mock/camera/MockCameraProvider.kt

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.

@KasemJaffer KasemJaffer requested a review from davidliu May 23, 2025 16:42
@davidliu davidliu merged commit 5291759 into livekit:main Jun 1, 2025
2 checks passed
@davidliu davidliu mentioned this pull request Jun 1, 2025
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