How to use an external camera when using the CameraX API

47 Views Asked by At

I am using CameraX api in Android and need the analyse function to analyse he image from the camera. But I need to use an external camera connected via wifi/bluetooth.

How do i build the

CameraSelector cameraSelector = new CameraSelector.Builder()
1

There are 1 best solutions below

0
Xi 张熹 On

You can use the CameraFilter API. Example:

CameraSelector.Builder().addCameraFilter { cameraInfos ->
  cameraInfos.filter {
    cameraId.value == externalCameraId
  }
}.build()