开发者

When must I re-lock the Camera?

开发者 https://www.devze.com 2023-03-26 20:23 出处:网络
android.开发者_Python百科hardware.Camera tells me, of lock() and unlock(), that I \"probably do not need this method\" if I \"am not recording video.\"Well, I am recording video.

android.开发者_Python百科hardware.Camera tells me, of lock() and unlock(), that I "probably do not need this method" if I "am not recording video." Well, I am recording video.

unlock() is supposed to be called "before calling android.media.MediaRecorder.setCamera(Camera)." That's simple enough; I can just put the unlock() call immediately before the setCamera() call. But what is the right time to call lock()? Immediately after setCamera()? After MediaRecorder.stop()? Or at some other time? How do I know when it's time to lock the Camera?


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


You don't need call lock(), when you open a camera, Camera objects are locked by default unless unlock() is called. So basically lock() method is called when you want to prevent that no one can use camera service until you release the camera.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号