Issues when capturing Multiple Photos: app stops responding, camera preview turns to green and no picture is saved

后端 未结 3 1695
谎友^
谎友^ 2020-12-10 08:39

I have successfully captured the single photo using camera in Android. But when I tried to capture 5 photos at once, app stops responding, camera preview turns to green and

3条回答
  •  抹茶落季
    2020-12-10 09:12

    I'm not sure the android api even supports a burst mode. One thing's for sure, you can't just call takePicture() in a loop like that. That is just abusing those poor api's.

    How about taking the next picture in onPictureTaken() ? (Obviously you have to keep a track of the number of pictures taken etc ..)

    Also like the documentation says, don't assume it will work on every device.

    I wrote the above answer in 2011, since then Camera has evolved

    EDIT : Burst mode is now supported in Camera2 : https://developer.android.com/reference/android/hardware/camera2/package-summary.html

    See https://developer.android.com/reference/android/hardware/camera2/CameraCaptureSession.html

提交回复
热议问题