package android.graphics class Matrix { fun setScale(x: Float,y: Float,px: Float,py: Float) {} } class SurfaceTexture(textureName: Int=0) { var timestamp = 0L private var listener: ((SurfaceTexture)->Unit)?=null private var handler: android.os.Handler?=null init { lastCreated=this } fun setDefaultBufferSize(w: Int,h: Int) {} fun setOnFrameAvailableListener(listener: (SurfaceTexture)->Unit,handler: android.os.Handler) { this.listener=listener;this.handler=handler } fun emit(ptsNs: Long) { timestamp=ptsNs;handler?.post { listener?.invoke(this) } } fun updateTexImage() {} fun getTransformMatrix(matrix: FloatArray) { matrix.fill(0f);listOf(0,5,10,15).forEach { matrix[it]=1f } } fun release() { released++ } companion object { var lastCreated: SurfaceTexture?=null;var released=0 } } class Bitmap(val width: Int=40,val height: Int=22) { fun getPixels(pixels: IntArray,offset: Int,stride: Int,x: Int,y: Int,w: Int,h: Int) { pixels.fill(0x80aa6644.toInt()) } fun recycle() { BitmapFactory.recycled++ } } object BitmapFactory { var recycled=0;var wrongSize=false fun decodeStream(input: java.io.InputStream): Bitmap = Bitmap(if(wrongSize) 41 else 40,22) }