我使用MediaRecorder
通过Camera1 API
录制了视频,并且libc中可能没有内存存在问题(请参阅日志中的行11-23 09:15:19.488 294-4528/? A/libc: Invalid address 0xb08ff0b0 passed to free: value not allocated
)。
最终视频是可播放的,但是在09:15:18被截断时,相机开始出现问题。
我想知道:我有机会抓住这个错误:11-23 09:15:23.621 4130-4130/? E/Camera: Error 1
重启录音吗?谢谢。
--------- beginning of main
11-23 09:15:13.014 294-4546/? E/mm-camera: aec_process_apply_antibanding: 50 Hz but ET less than 10ms: 0.000453
11-23 09:15:13.048 294-4546/? E/mm-camera: aec_process_apply_antibanding: 50 Hz but ET less than 10ms: 0.000453
11-23 09:15:13.081 294-4546/? E/mm-camera: aec_process_apply_antibanding: 50 Hz but ET less than 10ms: 0.000453
... The log has been truncated, because these lines are repeated 140 times
11-23 09:15:17.738 294-4546/? E/mm-camera: aec_process_apply_antibanding: 50 Hz but ET less than 10ms: 0.000386
11-23 09:15:18.489 859-1100/system_process I/chatty: uid=1000(system) FLP Service Cal expire 149 lines
11-23 09:15:18.490 294-4546/? E/mm-camera: aec_process_apply_antibanding: 50 Hz but ET less than 10ms: 0.000386
11-23 09:15:18.494 294-4546/? E/mm-camera: aec_process_apply_antibanding: 50 Hz but ET less than 10ms: 0.000386
11-23 09:15:18.505 294-4546/? E/mm-camera: aec_process_apply_antibanding: 50 Hz but ET less than 10ms: 0.000386
11-23 09:15:18.537 294-4546/? E/mm-camera: aec_process_apply_antibanding: 50 Hz but ET less than 10ms: 0.000386
11-23 09:15:18.572 294-4546/? E/mm-camera: aec_process_apply_antibanding: 50 Hz but ET less than 10ms: 0.000386
11-23 09:15:18.606 294-4546/? E/mm-camera: aec_process_apply_antibanding: 50 Hz but ET less than 10ms: 0.000373
11-23 09:15:18.638 294-4546/? E/mm-camera: aec_process_apply_antibanding: 50 Hz but ET less than 10ms: 0.000373
11-23 09:15:19.488 294-4528/? E/mm-camera-sensor: imx179_apply_exposure_during_sof:664 failed
--------- beginning of crash
11-23 09:15:19.488 294-4528/? A/libc: Invalid address 0xb08ff0b0 passed to free: value not allocated
11-23 09:15:19.490 294-4528/? A/libc: Fatal signal 6 (SIGABRT), code -6 in tid 4528 (mm-qcamera-daem)
[ 11-23 09:15:19.491 157: 157 W/ ]
debuggerd: handling request: pid=294 uid=1006 gid=1006 tid=4528
11-23 09:15:19.501 294-4528/? A/libc: failed to resend signal during crash: Operation not permitted
11-23 09:15:19.502 5648-5648/? E/DEBUG: unexpected waitpid response: n=4528, status=00000000
[ 11-23 09:15:19.502 5648: 5648 E/ ]
debuggerd: timed out waiting for signal
11-23 09:15:19.502 859-980/system_process W/NativeCrashListener: Couldn't find ProcessRecord for pid 294
[ 11-23 09:15:19.502 5648: 5648 E/ ]
AM eod write failed: Broken pipe
[ 11-23 09:15:19.502 5648: 5648 E/ ]
debuggerd: ptrace detach from 4528 failed: No such process
[ 11-23 09:15:19.502 5648: 5648 E/ ]
debuggerd: failed to kill process 294: No such process
11-23 09:15:19.503 859-882/system_process I/BootReceiver: Copying /data/tombstones/tombstone_01 to DropBox (SYSTEM_TOMBSTONE)
[ 11-23 09:15:19.504 157: 157 W/ ]
debuggerd: resuming target 294
11-23 09:15:19.580 5653-5653/? I/mm-camera: server_process_module_init:59, int mods
11-23 09:15:19.580 5653-5653/? I/mm-camera-sensor: module_sensor_init:3072 Enter
11-23 09:15:19.591 5653-5653/? I/mm-camera: gyro_module_init: Enter
11-23 09:15:19.591 5653-5653/? I/mm-camera: gyro_module_init: Exit successful
11-23 09:15:19.591 5653-5653/? I/mm-camera: cpp_module_init:75 name=cpp
11-23 09:15:19.612 5653-5653/? I/mm-camera: cpp_hardware_load_firmware:435, cpphw->hwinfo.version = 0x10010000
11-23 09:15:19.615 5653-5653/? I/mm-camera: cpp_module_init:117: info: CPP module_init successful
11-23 09:15:19.615 5653-5653/? I/mm-camera: c2d_module_init:45 name=c2d
11-23 09:15:19.615 5653-5653/? I/mm-camera: c2d_module_init:86: info: C2D module_init successful
11-23 09:15:19.615 5653-5653/? D/mm-camera-img: img_core_get_comp:37] role 3 name qcom.cac
11-23 09:15:19.615 5653-5653/? D/mm-camera-img: img_core_get_comp:42] comp_index[0] role 0 name qcom.wavelet
11-23 09:15:19.615 5653-5653/? D/mm-camera-img: img_core_get_comp:42] comp_index[1] role 1 name qcom.hdr
11-23 09:15:19.615 5653-5653/? D/mm-camera-img: img_core_get_comp:42] comp_index[2] role 2 name qcom.faceproc
11-23 09:15:19.615 5653-5653/? D/mm-camera-img: img_core_get_comp:42] comp_index[3] role 3 name qcom.cac
11-23 09:15:19.615 5653-5653/? D/mm-camera-img: img_core_get_comp:47] find component role 3 name qcom.cac
11-23 09:15:19.615 5653-5653/? E/mm-camera-img: cac_comp_load:679] Error opening CAC library
11-23 09:15:19.615 5653-5653/? E/mm-camera: module_cac_init:1027] Error rc -6
11-23 09:15:19.615 5653-5653/? E/mm-camera: pproc_module_init:2019] cac module create failed
11-23 09:15:19.615 5653-5653/? D/mm-camera-img: img_core_get_comp:37] role 2 name qcom.faceproc
11-23 09:15:19.615 5653-5653/? D/mm-camera-img: img_core_get_comp:42] comp_index[0] role 0 name qcom.wavelet
11-23 09:15:19.615 5653-5653/? D/mm-camera-img: img_core_get_comp:42] comp_index[1] role 1 name qcom.hdr
11-23 09:15:19.615 5653-5653/? D/mm-camera-img: img_core_get_comp:42] comp_index[2] role 2 name qcom.faceproc
11-23 09:15:19.615 5653-5653/? D/mm-camera-img: img_core_get_comp:47] find component role 2 name qcom.faceproc
11-23 09:15:21.740 1416-5657/com.google.android.gms.persistent I/chatty: uid=10064 com.google.android.gms.persistent expire 1 line
11-23 09:15:22.546 291-4508/? I/chatty: uid=1013(media) /system/bin/mediaserver expire 24 lines
11-23 09:15:23.612 291-4469/? I/chatty: uid=1013(media) /system/bin/mediaserver expire 7 lines
11-23 09:15:23.621 4130-4130/? E/Camera: Error 1
11-23 09:15:23.847 291-4505/? I/chatty: uid=1013(media) /system/bin/mediaserver expire 1 line
11-23 09:16:08.044 859-869/system_process I/chatty: uid=1000(system) HeapTaskDaemon expire 1 line
11-23 09:16:21.816 1416-6009/com.google.android.gms.persistent I/chatty: uid=10064 com.google.android.gms.persistent expire 1 line
11-23 09:16:49.489 261-261/? I/rmt_storage: rmt_storage_connect_cb: clnt_h=0x8 conn_h=0xaf89a0f0
11-23 09:16:49.489 261-261/? I/rmt_storage: rmt_storage_rw_iovec_cb: /boot/modem_fs2: clnt_h=0x2: req_h=0xc msg_id=3: R/W request received
11-23 09:16:49.489 261-261/? I/rmt_storage: wakelock acquired: 1, error no: 2
11-23 09:16:49.489 859-1100/system_process I/chatty: uid=1000(system) FLP Service Cal expire 108 lines
11-23 09:16:49.490 261-567/? I/rmt_storage: rmt_storage_client_thread: /boot/modem_fs2: clnt_h=0x2 Unblock worker thread (th_id: -1351087840)
11-23 09:16:49.568 261-567/? I/rmt_storage: rmt_storage_client_thread: /boot/modem_fs2: clnt_h=0x2: req_h=0xc msg_id=3: Bytes written = 1572864
11-23 09:16:49.568 261-567/? I/rmt_storage: rmt_storage_client_thread: /boot/modem_fs2: clnt_h=0x2: req_h=0xc msg_id=3: Send response: res=0 err=0
11-23 09:16:49.568 261-567/? I/rmt_storage: rmt_storage_client_thread: /boot/modem_fs2: clnt_h=0x2 About to block rmt_storage client thread (th_id: -1351087840) wakelock released: 1, error no: 0
11-23 09:16:49.569 261-261/? I/rmt_storage: rmt_storage_disconnect_cb: clnt_h=0x0x8 conn_h=0x0xaf89a0f0
11-23 09:17:13.134 291-4508/? I/chatty: uid=1013(media) /system/bin/mediaserver expire 4 lines
11-23 09:17:33.784 291-4508/? W/CameraSource: Timed out waiting for incoming camera video frames: 345806365 us
11-23 09:17:37.118 291-4508/? W/CameraSource: Timed out waiting for incoming camera video frames: 345806365 us
11-23 09:17:42.511 291-4508/? W/CameraSource: Timed out waiting for incoming camera video frames: 345806365 us
MediaRecorder伪代码的设置:
MediaRecorder mr = new MediaRecorder()
setCamera(c)
setVideoSource(MediaRecorder.VideoSource.CAMERA)
CamcorderProfile profile = CamcorderProfile.get(QUALITY_TIME_LAPSE_720P)
setCaptureRate(..)
setOutputFormat(MediaRecorder.OutputFormat.MPEG_4)
setVideoEncoder(profile.videoCodec)
setVideoSize(profile.videoFrameWidth, profile.videoFrameHeight)
setVideoFrameRate(profile.videoFrameRate)
setVideoEncodingBitRate(profile.videoBitRate)
setOrientationHint(..)
setOutputFile(..)
setPreviewDisplay(..)
setOnInfoListener(this)
setOnErrorListener(this)
prepare()
start()