RedApparat / Fotoapparat

Making Camera for Android more friendly. 📸
Apache License 2.0
3.82k stars 405 forks source link

Wait capabilities + parameters to be created before obtaining them. #172

Closed Diolor closed 6 years ago

Diolor commented 6 years ago

Fixes #170

jpribble commented 6 years ago

Thanks! I tested this and it's working for me now.

Diolor commented 6 years ago

Perfect @jpribble, then will merge it and release it in 2.1.

jpribble commented 6 years ago

I'm still seeing the "Couldn't deliver pending result" error message (and null returned) for getCurrentParameters() and getCapabilities() occasionally. It only happens about once in 20 launches but I've seen it occur about 4 times now. I'm testing with version 2.1.0. Do you know what could be causing that?

Logs:

01-10 23:00:25.270 27510-27741/[package_name] D/Fotoapparat: CameraDevice: getCapabilities$suspendImpl 01-10 23:00:25.289 27510-27741/[packagename] D/Fotoapparat: CameraDevice: updateParameters$suspendImpl > 01-10 23:00:25.291 27510-27743/[package_name] D/Fotoapparat: Couldn't deliver pending result._ 01-10 23:00:25.292 27510-27742/[package_name] D/Fotoapparat: CameraDevice: getCapabilities$suspendImpl 01-10 23:00:25.307 27510-27741/[package_name] D/Fotoapparat: New camera parameters are: CameraParameters

Diolor commented 6 years ago

Hmm potentially there is still some threading issue.

Note that null means also some error happened on the device. E.g. there are Chinese devices which cannot return some capabilities, in that case they throw exceptions which is visible on this null.

Will reopen the issue since I think we are in the threading case.

Diolor commented 6 years ago

let's move conversation to #181