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

Crash when start recording after switched camera #38

Closed jackaru closed 6 years ago

jackaru commented 6 years ago

First of all, I really liked these new features, but I'm having a crash issue when use function "startRecord()" after switching the camera using "switchCamera()" function. It doesn't matter where the camera is facing at, it doesn't allow to use "startRecording()" after switching camera. But without using the function, it's working well. The app is using landscape mode setted under manifest (Maybe this is the problem?)

private void switchCamera() { try { mCurrentCameraId = (mCurrentCameraId + 1) % Camera.getNumberOfCameras(); } catch (Exception e){ Toast.makeText(this, "Can't switch camera", Toast.LENGTH_LONG).show(); } releaseCamera(); openCamera(mCurrentCameraId); }

https://pastebin.com/YE8jAqzx

uestccokey commented 6 years ago

do you mean?

...
switchCamera();
startRecording();
...

I test it in CameraFilterActivity, there was no crash. can you try new version 2.0.8?