When should I re-lock the camera?

android.hardware.Camera tells me, lock() and unlock() , that I probably don't need this method if I don't record a video. Well, I'm recording a video.

unlock() supposed to be called "before calling android.media.MediaRecorder.setCamera (Camera)". It is simple enough; I can simply put the unlock() call just before the setCamera() call. But what time should I call lock() ? Immediately after setCamera() ? After MediaRecorder.stop() ? Or another time? How do I know when to lock the camera?

+7
source share
2 answers

You can use reconnection instead of locking after MediaRecorder.stop ().

0
source

You do not need to block the call () when you open the camera, camera objects are blocked by default if the unlock () function is not called. So basically the lock () method is called when you want no one to use the camera service until you release the camera.

0
source

All Articles