menu

CameraKit

One of the hardest Android APIs made into a high level and easy to use library that solves all of your problems.

Channels
Team

How to restart when a Camera2 connection has failed?

March 20, 2019 at 11:36pm

How to restart when a Camera2 connection has failed?

March 20, 2019 at 11:36pm

Something I am seeing fairly often is that my camera preview simply locks up. There are several reasons for this but generally it is that the CameraDevice gets detached from the preview or is already closed when the preview tries to start. My experience of Camera2 has been thus far that it is quite unreliable and once it gets disconnected it is hard to persuade CameraKit to reset the connection. Happy to implement these tweaks in the library, but would appreciate advice on how best to make them work in terms of the established structure.


March 26, 2019 at 5:15pm

While working on this I tried using a CameraAvailabilityHandler in Camera2.kt and noticed it is triggering CameraAvailable and then shortly afterwards CameraUnavailable - no idea if this is normal but it seemed odd. I have asked about it on SO but it could be CameraKit specific.

  • reply
  • like