Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to update texture contents #34

Closed
tuananhdtu opened this issue Dec 22, 2021 · 4 comments
Closed

Unable to update texture contents #34

tuananhdtu opened this issue Dec 22, 2021 · 4 comments

Comments

@tuananhdtu
Copy link

2021-12-22 08:31:08.474 5969-5969/ai.deepar.deepar_example E/AndroidRuntime: FATAL EXCEPTION: main
Process: ai.deepar.deepar_example, PID: 5969
java.lang.IllegalStateException: Unable to update texture contents (see logcat for details)
at android.graphics.SurfaceTexture.nativeUpdateTexImage(Native Method)
at android.graphics.SurfaceTexture.updateTexImage(SurfaceTexture.java:243)
at ai.deepar.deepar_example.ARSurfaceProvider.lambda$onSurfaceRequested$0$ARSurfaceProvider(ARSurfaceProvider.java:66)
at ai.deepar.deepar_example.-$$Lambda$ARSurfaceProvider$JAipkCmqGxwLcfXLPwXbYnzYXAQ.onFrameAvailable(Unknown Source:4)
at android.graphics.SurfaceTexture$1.handleMessage(SurfaceTexture.java:206)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6543)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:440)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:810)

@tuananhdtu
Copy link
Author

My device SM-J410f not use useExternalCameraTexture = true, when i set to false, camera will open but laggy

@tuananhdtu
Copy link
Author

java.nio.BufferOverflowException
at java.nio.DirectByteBuffer.put(DirectByteBuffer.java:291)
at java.nio.ByteBuffer.put(ByteBuffer.java:642)
at ai.deepar.deepar_example.MainActivity$12.analyze(MainActivity.java:468)
at androidx.camera.core.ImageAnalysis.lambda$setAnalyzer$1$ImageAnalysis(ImageAnalysis.java:367)

@TutorialsAndroid
Copy link

java.nio.BufferOverflowException at java.nio.DirectByteBuffer.put(DirectByteBuffer.java:291) at java.nio.ByteBuffer.put(ByteBuffer.java:642) at ai.deepar.deepar_example.MainActivity$12.analyze(MainActivity.java:468) at androidx.camera.core.ImageAnalysis.lambda$setAnalyzer$1$ImageAnalysis(ImageAnalysis.java:367)

My device SM-J410f not use useExternalCameraTexture = true, when i set to false, camera will open but laggy

Same issue here. any workaround for that

@JelenaKB
Copy link
Contributor

JelenaKB commented Aug 9, 2022

Sorry, using external textures is an optional optimization for newer devices that we demoed in our quickstart example, some older devices will, unfortunately, crash from this. If you are unsure if the device in question supports external textures you should be able to easily disable them


https://github.com/DeepARSDK/quickstart-android-java/blob/master/app/src/main/java/ai/deepar/deepar_example/MainActivity.java

If you are using the code from our quickstart you can just set

useExternalCameraTexture = false;

as you have.

The lag will change depending on the selected effect, some effects are more processor intensive than others.

@JelenaKB JelenaKB closed this as completed Aug 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants