'How to use USB camera in Android CameraX

I am using Android cameraX with ImageAnalysis for face detection using ML-kit, But now I want to use USB camera instead of a front or back camera but cameraX provides only 2 options.

CameraSelector.LENS_FACING_BACK
CameraSelector.LENS_FACING_FRONT


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source