Add one-button bounded front-camera diagnostics and automatic report

This commit is contained in:
zenord
2026-10-13 19:28:04 +08:00
parent 688bb7d6b3
commit 8cf7d7316c
30 changed files with 937 additions and 56 deletions
+3 -2
View File
@@ -2,16 +2,17 @@ package android.graphics
class SurfaceTexture(val texture: Int) {
fun interface OnFrameAvailableListener {fun onFrameAvailable(surface: SurfaceTexture)}
var released=false;var updates=0;var throwUpdate=false
var onUpdate: (()->Unit)?=null
var width=0;var height=0
private var listener: OnFrameAvailableListener?=null;private var handler: android.os.Handler?=null
init {check(texture in android.opengl.GLES20.liveTextures)}
fun setDefaultBufferSize(w: Int,h: Int) {width=w;height=h}
fun setOnFrameAvailableListener(l: OnFrameAvailableListener?,h: android.os.Handler?=null) {listener=l;handler=h}
fun frame() {val cb=listener ?: return;handler!!.post {cb.onFrameAvailable(this)}}
fun updateTexImage() {check(!released);if(throwUpdate) error("synthetic_update_failure");updates++}
fun updateTexImage() {onUpdate?.invoke();check(!released);if(throwUpdate) error("synthetic_update_failure");updates++}
fun release() {check(!released);released=true}
}
object ImageFormat {const val YUV_420_888=35}
object ImageFormat {const val YUV_420_888=35;const val NV21=17}
class Matrix {fun postRotate(f: Float) {}}
class Rect(val left: Int,val top: Int,val right: Int,val bottom: Int) {fun width()=right-left;fun height()=bottom-top}
class Bitmap(val width: Int,val height: Int) {