How to reproduce:
<com.otaliastudios.cameraview.CameraView
android:id="@+id/camera"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:keepScreenOn="true"
app:cameraAudio="off"
app:cameraMode="picture"
app:cameraPlaySounds="false"
app:cameraPreview="surface" />
Stacktrace:
at com.otaliastudios.cameraview.CameraView.setFilter(CameraView.java:2217)
at com.otaliastudios.cameraview.CameraView.doInstantiatePreview(CameraView.java:278)
at com.otaliastudios.cameraview.CameraView.onAttachedToWindow(CameraView.java:334)
at android.view.View.dispatchAttachedToWindow(View.java:12075)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:2426)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:2433)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:2433)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:2433)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:2433)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:2433)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:2433)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1425)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1190)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:4860)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:766)
at android.view.Choreographer.doCallbacks(Choreographer.java:575)
at android.view.Choreographer.doFrame(Choreographer.java:542)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:751)
at android.os.Handler.handleCallback(Handler.java:725)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:158)
p.s. Be attentive, i set app:cameraPreview="surface"
Same thing happens with texture.
It appears that setFilter in CameraView is asking that NoFilter be sent to clear, though it doesn't excuse NoFilter when it checks for surface or texture compatibility.
Since initialize() always calls setFilter(), even when the FilterParser returns NoFilter as part of the default case, surface and texture previews can't even be initialized and are entirely broken as far as I can tell.
Thanks for investigating @dylanrjames !
same here;
Have some solution ? thanks!