RedApparat / Fotoapparat

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

Setting null FrameProcessor in updateConfiguration() still starts frames processing. Some devices receive null preview frames which causes IllegalStateException. #280

Closed xaeon closed 6 years ago

xaeon commented 6 years ago

When i call the Fotoapparat.updateConfiguration() function, i set frameProcessor = null (the default value). But inside the library, the PreviewStream.updateProcessorSafely() function is still called with an empty, but not null, FrameProcessor. So this function starts frame processing. There is no problems other than increased resources consumption.

But on the ZTE BLADE A520 device, PreviewCallback.onPreviewFrame() get called with null data parameter. When it get passed to PreviewStream.dispatchFrameOnBackgroundThread function, a "java.lang.IllegalStateException: data must not be null" is thrown

wilsonrc commented 6 years ago

@xaeon I think I have the same Issue with a Samsung Galaxy Grand Prime with Android 7.1, do you already have any solution for this?

wilsonrc commented 6 years ago

@Diolor @dmitry-zaitsev can you help us with this?

dmitry-zaitsev commented 6 years ago

The fix is available in version 2.3.3.