shiyinghan / UVCAndroid

Apache License 2.0
184 stars 50 forks source link

Always call callback when taking picture #36

Closed milosfec closed 1 year ago

milosfec commented 1 year ago

Issue description

When calling CameraHelper.takePicture(...), there are several cases when error is not reported to the provided callback.

Use case

Applications shows a dialog while taking picture is in progress. This dialog is dismissed when picture is taken, or replaced with a closable error dialog when error occurs. When camera get disconnected right before we call takePicture(), callback is not called at all and the dialog will never be dismissed.

Solution

Handle every cases when taking picture and call callback.onError() when getting image is not possible or failed.

Notes

The fix touches just one internal interface ICameraRendererHolder.java, so it brings no braking changes to any user of the library.


Thank you @shiyinghan for maintaining the library!

shiyinghan commented 1 year ago

Hello, Thank you for all your contribution. I will merge it.

milosfec commented 1 year ago

Thank you @shiyinghan ! Is there a chance that you will release new version with that fix? :)

shiyinghan commented 1 year ago

Hello, The new version has been released

milosfec commented 1 year ago

Awesome! Thank you @shiyinghan