android - Min undequeued buffer count exceeded -
i using surfacetexture preview frames in next way.
first, set preview texture:
camera.setpreviewtexture(new surfacetexture(0)); then, before starting preview , each time onpreviewframe called, set callback buffer this:
camera.addcallbackbuffer(buffer); camera.setpreviewcallbackwithbuffer(this); it works. sometimes, take image using camera.takepicture(null, null, callback), results in calling onpicturetaken successfully. image saved. since want restart preview after image has been taken, following:
try { camera.setpreviewtexture(new surfacetexture(0)); camera.startpreview(); } ... the preview restarts , seems fine. next error reported in logcat, seemingly after preview has restarted:
e/bufferqueue﹕ [unnamed-5682-5] dequeuebuffer: min undequeued buffer count (2) exceeded (dequeued=5 undequeudcount=1) am missing something? should release old texture @ point?
configuration: samsung galaxy s4, samsung galaxy s5, nexus 5, running on android kitkat.
edit: not sure wether linked or not, after while, app not take pictures anymore , next messages appear continuously in logcat:
e/locsvc_api_v02( 318): i/---> locclientsendreq line 2332 qmi_loc_inject_sensor_data_req_v02 e/gsiff_dmn( 318): i/loc_api_resp_ind_callback: received locapi resp ind = 77 e/locsvc_api_v02( 318): d/loc_sync_process_ind:172]: loc_sync_array not in utilize e/locsvc_utils_q( 318): d/msg_q_rcv: received message 0xb899d940 rv = 0 e/gsiff_dmn( 318): i/gsiff_data_task: handling message type = 4 e/gsiff_dmn( 318): i/gsiff_daemon_inject_sensor_data_handler: sending sensor info locapi. opaque_id = 1226 e/locsvc_api_v02( 318): i/---> locclientsendreq line 2332 qmi_loc_inject_sensor_data_req_v02 e/gsiff_dmn( 318): i/loc_api_resp_ind_callback: received locapi resp ind = 77 e/locsvc_api_v02( 318): d/loc_sync_process_ind:172]: loc_sync_array not in utilize e/mm-camera( 284): [cpp_hardware_process_frame:997] many cpp frames dropped!! e/mm-camera( 284): cpp_thread_handle_process_buf_event:224] buffer fail. drop frame id:1845 identity:0x20002 w/qcamera2hwi( 269): [check_buf_lock] many preview buffer locked surfaceflinger : 29 e/mm-camera( 284): [cpp_hardware_process_frame:997] many cpp frames dropped!! e/mm-camera( 284): cpp_thread_handle_process_buf_event:224] buffer fail. drop frame id:1846 identity:0x20002 edit 2: if, instead of new surfacetexture(0), utilize same surfacetexture (that maintain member), errors disappear , app continues work. min undequeued buffer count exceeded error , too many preview buffer locked surfaceflinger warning stay.
it seems photographic camera holding in buffer not dequeued activity. have find way clear photographic camera buffer when start new preview.
as can find in android documentation photographic camera class :
the buffer queue cleared if method [setpreviewcallbackwithbuffer] called null callback, setpreviewcallback(camera.previewcallback) called, or setoneshotpreviewcallback(camera.previewcallback) called.
so maybe plenty remove callback when take image , reinstatiate when restart preview.
android android-camera
No comments:
Post a Comment