1

I've a custom class which extends TextureView. In this TextureView I've a surfaceTexture, mSurfaceTexture. This is a single-buffered surface.

As per android documentation, here:

In single buffered mode the application is responsible for serializing access to the image content buffer. Each time the image content is to be updated, the releaseTexImage() method must be called before the image content producer takes ownership of the buffer.

So I'm calling this whenever the image producer is taking ownership. It works fine on Android 10, however on android 9 I get the following error:

11-05 19:05:53.960 23442 24509 E AndroidRuntime: java.lang.IllegalStateException: Unable to release texture contents (see logcat for details)
11-05 19:05:53.960 23442 24509 E AndroidRuntime:    at android.graphics.SurfaceTexture.nativeReleaseTexImage(Native Method)
11-05 19:05:53.960 23442 24509 E AndroidRuntime:    at android.graphics.SurfaceTexture.releaseTexImage(SurfaceTexture.java:252)

I'm calling ANativeWindow_fromSurface. After using this should I do something else too like release nativewindow etc?

Any idea as to why this is happening and also anyone else had a similar issue ?

Prajval M
  • 2,298
  • 11
  • 32

0 Answers0