代码之家  ›  专栏  ›  技术社区  ›  pr0p

Android 9中的ReleaseTextImage崩溃

  •  0
  • pr0p  · 技术社区  · 5 年前

    我有一个自定义类,它扩展了 TextureView .在这个 纹理视图 我有一个 surfaceTexture , mSurfaceTexture .这是一个单缓冲表面。

    根据android文档, here :

    在单缓冲模式下,应用程序负责序列化对图像内容缓冲区的访问。每次更新图像内容时,必须在图像内容制作者获得缓冲区所有权之前调用releaseTexImage()方法。

    所以,每当图像制作人获得所有权时,我都会这么说。它在安卓10上运行良好,但在安卓9上,我得到以下错误:

    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)
    

    我打电话来 ANativeWindow_fromSurface .使用此功能后,我是否也应该执行其他操作,如释放nativewindow等?

    你知道为什么会发生这种情况,还有其他人有类似的问题吗?

    0 回复  |  直到 5 年前