Cameraview: Exception: Filters are only supported by the GL_SURFACE preview. Current:SURFACE

Created on 5 Sep 2019  路  3Comments  路  Source: natario1/CameraView

How to reproduce:

  1. configure CameraView in a layout
<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" />
  1. Run Activity with the xml layout

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"

bug

All 3 comments

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!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ateymoori picture ateymoori  路  8Comments

YumcoderCom picture YumcoderCom  路  5Comments

leandro1995 picture leandro1995  路  6Comments

vedmedenko picture vedmedenko  路  9Comments

VGJohn picture VGJohn  路  3Comments