uestccokey / EZFilter

A lightweight (<180KB), easy-to-extend Android filter and dynamic sticker framework for adding filters and stickers for camera, video, bitmap and view.(一个轻量级(<180KB)、易扩展的Android滤镜和动态贴纸框架,支持摄像头、视频、图片和视图添加滤镜和贴纸。)
MIT License
208 stars 57 forks source link

MediaCodec.createInputSurface() IllegalStateException #73

Closed hocesjc closed 2 years ago

hocesjc commented 2 years ago

I can't record the views val renderPipeline = EZFilter.input(viewToRecord).addFilter(null) .enableRecord(path, true, false) .into(renderView) renderPipeline.setRenderSize(renderView.width, renderView.height) val recordSupported = renderPipeline.endPointRenders.find { glRender -> glRender is ISupportRecord } as? ISupportRecord return recordSupported

when i call startRecording() it return false, i debug the funcion and MediaCodec.createInputSurface() throw IllegalStateException I try with version 2.0.7 and 2.0.6 with the same result but the app crashes directly for the same

hocesjc commented 2 years ago

i fix it changing renderPipeline.endPointRenders.find { glRender -> glRender is ISupportRecord } as? ISupportRecord by var recordSupported:ISupportRecord? =null for (render in renderPipeline.endPointRenders) { if (render is ISupportRecord) { recordSupported= render } }

hocesjc commented 2 years ago

i fix it changing renderPipeline.endPointRenders.find { glRender -> glRender is ISupportRecord } as? ISupportRecord by var recordSupported:ISupportRecord? =null for (render in renderPipeline.endPointRenders) { if (render is ISupportRecord) { recordSupported= render } }