4

I have Samsung Galaxy S9 and I see two rear physical cameras on the device. Still, cameraManager.cameraIdList gives only two camera ID-s, one for facing camera and one for rear. How to resolve the third camera? Is it even possible?

nyarian
  • 4,085
  • 1
  • 19
  • 51
  • 1
    It is possible that while from a hardware standpoint you see a third lens, Samsung combines the results of the two rear lenses into a single image. – CommonsWare Mar 11 '19 at 12:30
  • @CommonsWare mb we can use `setPhysicalCameraId(cameraId)` to change between physical cameras of logical camera https://stackoverflow.com/a/66569731/7767664 – user924 Mar 10 '21 at 17:28

1 Answers1

0

You can use CameraManager#getPhysicalCameraIds() to get physical camera ids and use it with setPhysicalCameraId(). For more, visit this official documentation: https://source.android.com/devices/camera/multi-camera#examples_and_sources

Simon Pham
  • 1,603
  • 1
  • 10
  • 15
  • 1
    Ye, already found this solution almost a year ago. Still, for a target device (don't remember which exactly, it was quite a while since then) which had 3 physical rear cameras `CameraCharacteristics#getPhysicalCameraIds` (not `CameraManager`) returned only two cameras from a single logical rear camera. I supposed that it was implementation specifics given by Android OS shell provider. Still, this answer is the closest to the solution, so Ill mark it as accepted – nyarian Mar 10 '20 at 13:52
  • @AndreyIlyunin it depends on the OS as I know. Some devices like Google Pixel 3 has 2 front cameras & you can access both of them. – Simon Pham Mar 11 '20 at 08:22
  • Samsung S20 api 30. Device has 3 back facing cameras, reports two back facing logical cameras and no physical Ids for both of them. Looks like this multi camera thing is well supported. – SerialSensor Jan 18 '21 at 16:34
  • 1
    @SerialSensor Samsung exposed all camera as logical cameras, it's not multi camera api thing. Though it's great that Samsung made it easier for developers. For Pixel 4, 5 it's harder because it returns only two logical cameras and you have to configurate physical using new multi camera api https://stackoverflow.com/a/66569731/7767664 – user924 Mar 10 '21 at 17:27
  • @user924 like written, 3 back facing cameras, only two logical cameras. So exposed all is defenetly not true. This is why I checked the physical Ids. – SerialSensor Mar 13 '21 at 15:10