android - ReleaseTexImage 在 Android 9 中崩溃
问题描述
我有一个扩展的自定义类TextureView
。在这TextureView
我有一个surfaceTexture
,mSurfaceTexture
。这是一个单缓冲表面。
根据android文档,这里:
在单缓冲模式下,应用程序负责序列化对图像内容缓冲区的访问。每次要更新图像内容时,必须在图像内容生产者获得缓冲区所有权之前调用 releaseTexImage() 方法。
因此,每当图像制作者获得所有权时,我都会调用它。它在 Android 10 上运行良好,但在 android 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 等吗?
关于为什么会发生这种情况以及其他任何人有类似问题的任何想法?
解决方案
推荐阅读
- powerbi - 无法在我的模型中建立多对多关系
- css - How can I nest a selector with ::after psudo class using SCSS?
- html - 在源代码中换行时 {% url ... %} 中的 URL 错误
- java - 如何生成列表地图的地图(地图
>>) 在java中使用流 - aframe - 双击监听器需要在 iOS 13 上点击三下
- sql - SQL - 仅显示日期最新的行
- python - 是否可以在 python 中“流式传输”一个变量?
- python - 如何分析芹菜任务的内存使用情况?
- javascript - 将相关元素嵌套在一起父/子
- highcharts - 是否可以根据实时交易在图表上更新或绘制最后一根蜡烛?