From: Jeongmo Yang Date: Tue, 22 Sep 2020 11:45:23 +0000 (+0900) Subject: Revise log related code X-Git-Tag: submit/tizen/20200928.104152 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Ftags%2Fsubmit%2Ftizen%2F20200928.104152;p=platform%2Fcore%2Fmultimedia%2Fmmsvc-recorder.git Revise log related code - Use mmcam_log_level as extern variable which is declared and set in libmm-camcorder. [Version] 0.3.25 [Issue Type] Log Change-Id: I96db16df3941c7892bc6d0031de4a227bfa15500 Signed-off-by: Jeongmo Yang --- diff --git a/legacy/src/legacy_recorder.c b/legacy/src/legacy_recorder.c index 9578624..cfa4cb8 100644 --- a/legacy/src/legacy_recorder.c +++ b/legacy/src/legacy_recorder.c @@ -180,7 +180,7 @@ int __convert_recorder_error_code(const char *func, int code) //LCOV_EXCL_STOP } - LOGE("[%s] %s(0x%08x) : core frameworks error code(0x%08x)", func, errorstr, ret, code); + CAM_LOG_ERROR("[%s] %s(0x%08x) : core frameworks error code(0x%08x)", func, errorstr, ret, code); return ret; } @@ -199,10 +199,10 @@ static recorder_state_e __recorder_state_convert(MMCamcorderStateType mm_state, case MM_CAMCORDER_STATE_READY: if (mm_old_state == MM_CAMCORDER_STATE_PREPARE) { state = RECORDER_STATE_READY; - LOGW("destroying pipeline now"); + CAM_LOG_WARNING("destroying pipeline now"); } else { state = RECORDER_STATE_CREATED; - LOGW("preparing pipeline now"); + CAM_LOG_WARNING("preparing pipeline now"); } break; case MM_CAMCORDER_STATE_PREPARE: @@ -236,7 +236,7 @@ static int __mm_recorder_msg_cb(int message, void *param, void *user_data) switch (message) { case MM_MESSAGE_READY_TO_RESUME: - LOGW("not supported message"); + CAM_LOG_WARNING("not supported message"); break; case MM_MESSAGE_CAMCORDER_STATE_CHANGED: case MM_MESSAGE_CAMCORDER_STATE_CHANGED_BY_SECURITY: @@ -250,16 +250,16 @@ static int __mm_recorder_msg_cb(int message, void *param, void *user_data) //LCOV_EXCL_START if (message == MM_MESSAGE_CAMCORDER_STATE_CHANGED_BY_SECURITY) { policy = RECORDER_POLICY_SECURITY; - LOGE("RECORDER_POLICY_SECURITY"); + CAM_LOG_ERROR("RECORDER_POLICY_SECURITY"); } else if (message == MM_MESSAGE_CAMCORDER_STATE_CHANGED_BY_RM) { policy = RECORDER_POLICY_RESOURCE_CONFLICT; - LOGW("RECORDER_POLICY_RESOURCE_CONFLICT"); + CAM_LOG_WARNING("RECORDER_POLICY_RESOURCE_CONFLICT"); } if (message != MM_MESSAGE_CAMCORDER_STATE_CHANGED && interrupt_state == -1) { interrupt_state = previous_state; - LOGD("interrupt state %d", interrupt_state); + CAM_LOG_INFO("interrupt state %d", interrupt_state); } //LCOV_EXCL_STOP @@ -271,12 +271,12 @@ static int __mm_recorder_msg_cb(int message, void *param, void *user_data) if (policy == RECORDER_POLICY_SECURITY || m->state.current == MM_CAMCORDER_STATE_PAUSED || m->state.current == MM_CAMCORDER_STATE_NULL) { - LOGD("call interrupted callback"); + CAM_LOG_INFO("call interrupted callback"); if (handle->user_cb[_RECORDER_EVENT_TYPE_INTERRUPTED]) ((recorder_interrupted_cb)handle->user_cb[_RECORDER_EVENT_TYPE_INTERRUPTED])(policy, interrupt_state, handle->state, handle->user_data[_RECORDER_EVENT_TYPE_INTERRUPTED]); else - LOGW("_RECORDER_EVENT_TYPE_INTERRUPTED cb is NULL"); + CAM_LOG_WARNING("_RECORDER_EVENT_TYPE_INTERRUPTED cb is NULL"); /* initialize interrupt state */ interrupt_state = -1; @@ -292,7 +292,7 @@ static int __mm_recorder_msg_cb(int message, void *param, void *user_data) else if (message == MM_MESSAGE_CAMCORDER_STATE_CHANGE_STARTED_BY_RM) policy = RECORDER_POLICY_RESOURCE_CONFLICT; - LOGW("message 0x%x -> policy %d", message, policy); + CAM_LOG_WARNING("message 0x%x -> policy %d", message, policy); if (policy != RECORDER_POLICY_NONE) { ((recorder_interrupt_started_cb)handle->user_cb[_RECORDER_EVENT_TYPE_INTERRUPT_STARTED])(policy, @@ -327,7 +327,7 @@ static int __mm_recorder_msg_cb(int message, void *param, void *user_data) case MM_ERROR_CAMCORDER_DEVICE_TIMEOUT: case MM_ERROR_CAMCORDER_DEVICE_WRONG_JPEG: recorder_error = RECORDER_ERROR_DEVICE; - LOGE("ERROR_DEVICE : 0x%x", m->code); + CAM_LOG_ERROR("ERROR_DEVICE : 0x%x", m->code); break; case MM_ERROR_CAMCORDER_GST_CORE: case MM_ERROR_CAMCORDER_GST_LIBRARY: @@ -344,31 +344,31 @@ static int __mm_recorder_msg_cb(int message, void *param, void *user_data) case MM_ERROR_FILE_NOT_FOUND: case MM_ERROR_FILE_READ: recorder_error = RECORDER_ERROR_INVALID_OPERATION; - LOGE("INVALID_OPERATION : 0x%x", m->code); + CAM_LOG_ERROR("INVALID_OPERATION : 0x%x", m->code); break; case MM_ERROR_CAMCORDER_LOW_MEMORY: case MM_ERROR_CAMCORDER_MNOTE_MALLOC: recorder_error = RECORDER_ERROR_OUT_OF_MEMORY; - LOGE("OUT_OF_MEMORY : 0x%x", m->code); + CAM_LOG_ERROR("OUT_OF_MEMORY : 0x%x", m->code); break; case MM_ERROR_CAMCORDER_DEVICE_REG_TROUBLE: recorder_error = RECORDER_ERROR_ESD; - LOGE("ESD : 0x%x", m->code); + CAM_LOG_ERROR("ESD : 0x%x", m->code); break; case MM_ERROR_OUT_OF_STORAGE: recorder_error = RECORDER_ERROR_OUT_OF_STORAGE; - LOGE("OUT_OF_STORAGE : 0x%x", m->code); + CAM_LOG_ERROR("OUT_OF_STORAGE : 0x%x", m->code); break; default: recorder_error = RECORDER_ERROR_INVALID_OPERATION; - LOGE("INVALID_OPERATION : 0x%x", m->code); + CAM_LOG_ERROR("INVALID_OPERATION : 0x%x", m->code); break; } if (handle->user_cb[_RECORDER_EVENT_TYPE_ERROR]) ((recorder_error_cb)handle->user_cb[_RECORDER_EVENT_TYPE_ERROR])(recorder_error, handle->state, handle->user_data[_RECORDER_EVENT_TYPE_ERROR]); else - LOGW("ERROR cb was not set"); + CAM_LOG_WARNING("ERROR cb was not set"); break; //LCOV_EXCL_STOP case MM_MESSAGE_CAMCORDER_CURRENT_VOLUME: @@ -394,11 +394,14 @@ static int __mm_audio_stream_cb(MMCamcorderAudioStreamDataType *stream, void *us if (stream->format == MM_CAMCORDER_AUDIO_FORMAT_PCM_S16_LE) format = RECORDER_SAMPLE_TYPE_S16_LE; + CAM_LOG_DEBUG("fmt[%d], ch[%d], timestamp[%u], size[%d]", + format, stream->channel, stream->timestamp, stream->length); + if (handle->user_cb[type]) { ((recorder_audio_stream_cb)(handle->user_cb[type]))(stream->data, stream->length, format, stream->channel, stream->timestamp, handle->user_data[type]); } else { - LOGW("audio_stream_cb is NULL"); + CAM_LOG_WARNING("audio_stream_cb is NULL"); } return 1; @@ -412,11 +415,13 @@ static int __mm_muxed_stream_cb(MMCamcorderMuxedStreamDataType *stream, void *us recorder_return_val_if_fail(handle && stream, 0); + CAM_LOG_DEBUG("size[%d], offset[%llu]", stream->length, stream->offset); + if (handle->user_cb[type]) { ((recorder_muxed_stream_cb)(handle->user_cb[type]))(stream->data, stream->length, stream->offset, handle->user_data[type]); } else { - LOGW("muxed_stream_cb is NULL"); + CAM_LOG_WARNING("muxed_stream_cb is NULL"); } return 1; @@ -432,13 +437,13 @@ static int __mm_video_encode_decision_cb(MMCamcorderVideoStreamDataType *stream, recorder_return_val_if_fail(handle && stream, 0); if (!handle->user_cb[type]) { - LOGW("video_encode_decision_cb is NULL"); + CAM_LOG_WARNING("video_encode_decision_cb is NULL"); return true; } do_encode = ((recorder_video_encode_decision_cb)(handle->user_cb[type]))(stream, handle->user_data[type]); - /*LOGD("%d", do_encode);*/ + CAM_LOG_DEBUG("do_encode[%d]", do_encode); return (int)do_encode; } @@ -469,17 +474,17 @@ static int _recorder_check_and_set_attribute(recorder_h recorder, const char *at NULL); if (current_value != set_value) { - LOGD("try to reset pipeline"); + CAM_LOG_INFO("try to reset pipeline"); ret = mm_camcorder_stop(handle->mm_handle); if (ret != MM_ERROR_NONE) { - LOGE("mm_camcorder_stop failed 0x%x", ret); + CAM_LOG_ERROR("mm_camcorder_stop failed 0x%x", ret); return __convert_recorder_error_code(attribute_name, ret); } ret = mm_camcorder_unrealize(handle->mm_handle); if (ret != MM_ERROR_NONE) { - LOGE("mm_camcorder_unrealize failed 0x%x", ret); + CAM_LOG_ERROR("mm_camcorder_unrealize failed 0x%x", ret); mm_camcorder_start(handle->mm_handle); return __convert_recorder_error_code(attribute_name, ret); } @@ -506,20 +511,20 @@ static int _recorder_check_and_set_attribute(recorder_h recorder, const char *at } if (ret != MM_ERROR_NONE) - LOGE("set [%s] failed 0x%x", attribute_name, ret); + CAM_LOG_ERROR("set [%s] failed 0x%x", attribute_name, ret); if (reset_pipeline) { ret2 = mm_camcorder_realize(handle->mm_handle); if (ret2 == MM_ERROR_NONE) { ret2 = mm_camcorder_start(handle->mm_handle); if (ret2 == MM_ERROR_NONE) { - LOGW("restart pipeline done."); + CAM_LOG_WARNING("restart pipeline done."); } else { - LOGE("mm_camcorder_start failed 0x%x", ret2); + CAM_LOG_ERROR("mm_camcorder_start failed 0x%x", ret2); mm_camcorder_unrealize(handle->mm_handle); } } else { - LOGE("mm_camcorder_realize failed 0x%x", ret2); + CAM_LOG_ERROR("mm_camcorder_realize failed 0x%x", ret2); } if (ret2 != MM_ERROR_NONE) { @@ -536,16 +541,16 @@ static int _recorder_check_and_set_attribute(recorder_h recorder, const char *at MMCAM_AUDIO_DISABLE, current_audio_disable, attribute_name, current_value, NULL); - LOGW("restore attribute set : 0x%x", ret2); + CAM_LOG_WARNING("restore attribute set : 0x%x", ret2); ret2 = mm_camcorder_realize(handle->mm_handle); - LOGW("restore mm_camcorder_realize : 0x%x", ret2); + CAM_LOG_WARNING("restore mm_camcorder_realize : 0x%x", ret2); ret2 = mm_camcorder_start(handle->mm_handle); - LOGW("restore mm_camcorder_realize : 0x%x", ret2); + CAM_LOG_WARNING("restore mm_camcorder_realize : 0x%x", ret2); if (ret2 != MM_ERROR_NONE) { ret2 = mm_camcorder_unrealize(handle->mm_handle); - LOGW("restore mm_camcorder_unrealize : 0x%x", ret2); + CAM_LOG_WARNING("restore mm_camcorder_unrealize : 0x%x", ret2); } } @@ -564,7 +569,7 @@ int legacy_recorder_create_videorecorder(camera_h camera, recorder_h *recorder) /* Check already used in another recorder */ if (legacy_camera_is_used(camera)) { - LOGE("[%s] camera is using in another recorder.", __func__); + CAM_LOG_ERROR("[%s] camera is using in another recorder.", __func__); return RECORDER_ERROR_INVALID_PARAMETER; } @@ -593,13 +598,13 @@ int legacy_recorder_create_videorecorder(camera_h camera, recorder_h *recorder) NULL); if (ret != MM_ERROR_NONE) { g_free(handle); - LOGE("get device count error"); + CAM_LOG_ERROR("get device count error"); return __convert_recorder_error_code(__func__, ret); } if (camera_device_count == 0) { g_free(handle); - LOGE("RECORDER_ERROR_NOT_SUPPORTED"); + CAM_LOG_ERROR("RECORDER_ERROR_NOT_SUPPORTED"); return RECORDER_ERROR_NOT_SUPPORTED; } else { handle->camera_device_count = camera_device_count; @@ -643,7 +648,7 @@ int legacy_recorder_create_audiorecorder(recorder_h *recorder) ret = mm_camcorder_create(&handle->mm_handle, &info); if (ret != MM_ERROR_NONE) { g_free(handle); - LOGE("mm_camcorder_create fail"); + CAM_LOG_ERROR("mm_camcorder_create fail"); return __convert_recorder_error_code(__func__, ret); } @@ -653,7 +658,7 @@ int legacy_recorder_create_audiorecorder(recorder_h *recorder) if (ret != MM_ERROR_NONE) { mm_camcorder_destroy(handle->mm_handle); g_free(handle); - LOGE("AUDIO mode setting fail"); + CAM_LOG_ERROR("AUDIO mode setting fail"); return __convert_recorder_error_code(__func__, ret); } @@ -663,7 +668,7 @@ int legacy_recorder_create_audiorecorder(recorder_h *recorder) if (ret != MM_ERROR_NONE) { mm_camcorder_destroy(handle->mm_handle); g_free(handle); - LOGE("get device count error"); + CAM_LOG_ERROR("get device count error"); return __convert_recorder_error_code(__func__, ret); } else { handle->camera_device_count = camera_device_count; @@ -713,12 +718,12 @@ int legacy_recorder_destroy(recorder_h recorder) /* check state */ ret = mm_camcorder_get_state(handle->mm_handle, &mm_state); if (ret != MM_ERROR_NONE) { - LOGE("get state failed 0x%x", ret); + CAM_LOG_ERROR("get state failed 0x%x", ret); return __convert_recorder_error_code(__func__, ret); } if (mm_state >= MM_CAMCORDER_STATE_RECORDING) { - LOGE("NOW RECORDING[%d], should not destroy", mm_state); + CAM_LOG_ERROR("NOW RECORDING[%d], should not destroy", mm_state); return RECORDER_ERROR_INVALID_STATE; } @@ -773,14 +778,14 @@ int legacy_recorder_prepare(recorder_h recorder) if (ret == MM_ERROR_NONE && mmstate < MM_CAMCORDER_STATE_READY) { ret = mm_camcorder_realize(handle->mm_handle); if (ret != MM_ERROR_NONE) { - LOGE("mm_camcorder_realize fail"); + CAM_LOG_ERROR("mm_camcorder_realize fail"); return __convert_recorder_error_code(__func__, ret); } } ret = mm_camcorder_start(handle->mm_handle); if (ret != MM_ERROR_NONE) { - LOGE("mm_camcorder_start fail"); + CAM_LOG_ERROR("mm_camcorder_start fail"); mm_camcorder_unrealize(handle->mm_handle); return __convert_recorder_error_code(__func__, ret); } @@ -801,13 +806,13 @@ int legacy_recorder_unprepare(recorder_h recorder) if (ret == MM_ERROR_NONE && mmstate == MM_CAMCORDER_STATE_PREPARE) { ret = mm_camcorder_stop(handle->mm_handle); if (ret != MM_ERROR_NONE) - LOGE("mm_camcorder_stop fail"); + CAM_LOG_ERROR("mm_camcorder_stop fail"); } if (ret == MM_ERROR_NONE) { ret = mm_camcorder_unrealize(handle->mm_handle); if (ret != MM_ERROR_NONE) { - LOGE("mm_camcorder_unrealize fail"); + CAM_LOG_ERROR("mm_camcorder_unrealize fail"); mm_camcorder_start(handle->mm_handle); } } @@ -976,7 +981,7 @@ int legacy_recorder_get_filename(recorder_h recorder, char **filename) if (ret == MM_ERROR_NONE && record_filename) { *filename = strdup(record_filename); } else { - LOGE("internal return (0x%08x), get filename p:%p", ret, record_filename); + CAM_LOG_ERROR("internal return (0x%08x), get filename p:%p", ret, record_filename); *filename = NULL; } @@ -1336,7 +1341,7 @@ int legacy_recorder_foreach_supported_file_format(recorder_h recorder, ret = mm_camcorder_get_attribute_info(handle->mm_handle, MMCAM_FILE_FORMAT, &info); if (ret != MM_ERROR_NONE) { - LOGE("mm_camcorder_get_attribute_info failed 0x%x", ret); + CAM_LOG_ERROR("mm_camcorder_get_attribute_info failed 0x%x", ret); return __convert_recorder_error_code(__func__, ret);; } @@ -1936,7 +1941,7 @@ int legacy_recorder_manage_external_storage_state(recorder_h recorder, int stora recorder_return_val_if_fail(handle, RECORDER_ERROR_INVALID_PARAMETER); - LOGW("storage state %d", storage_state); + CAM_LOG_WARNING("storage state %d", storage_state); ret = mm_camcorder_manage_external_storage_state(handle->mm_handle, storage_state); diff --git a/legacy/src/legacy_recorder_internal.c b/legacy/src/legacy_recorder_internal.c index 308976a..ae1d6b9 100644 --- a/legacy/src/legacy_recorder_internal.c +++ b/legacy/src/legacy_recorder_internal.c @@ -34,7 +34,7 @@ int legacy_recorder_set_client_pid(recorder_h recorder, int pid) recorder_return_val_if_fail(handle, RECORDER_ERROR_INVALID_PARAMETER); - LOGD("pid %d", pid); + CAM_LOG_INFO("pid %d", pid); ret = mm_camcorder_set_attributes(handle->mm_handle, NULL, MMCAM_CLIENT_PID, pid, @@ -51,6 +51,8 @@ void legacy_recorder_emit_signal(recorder_h recorder, const char *object_name, recorder_return_if_fail(handle); + CAM_LOG_INFO("signal name[%s] - value[0x%x]", signal_name, value); + mm_camcorder_emit_signal(handle->mm_handle, object_name, interface_name, signal_name, value); @@ -65,7 +67,7 @@ int legacy_recorder_set_gdbus_connection(recorder_h recorder, void *gdbus_connec recorder_return_val_if_fail(handle, RECORDER_ERROR_INVALID_PARAMETER); - LOGD("gdbus_connection %p", gdbus_connection); + CAM_LOG_INFO("gdbus_connection %p", gdbus_connection); ret = mm_camcorder_set_attributes(handle->mm_handle, NULL, MMCAM_GDBUS_CONNECTION, gdbus_connection, sizeof(*gdbus_connection), diff --git a/muse/src/muse_recorder_dispatcher.c b/muse/src/muse_recorder_dispatcher.c index d84a53e..9247ae3 100644 --- a/muse/src/muse_recorder_dispatcher.c +++ b/muse/src/muse_recorder_dispatcher.c @@ -47,7 +47,7 @@ #define recorder_return_if_fail(expr) \ do { \ if (!(expr)) { \ - LOGE("failed [%s]", #expr); \ + CAM_LOG_ERROR("failed [%s]", #expr); \ return; \ } \ } while (0) @@ -55,7 +55,7 @@ #define recorder_return_val_if_fail(expr, val) \ do { \ if (!(expr)) { \ - LOGE("failed [%s]", #expr); \ + CAM_LOG_ERROR("failed [%s]", #expr); \ return (val); \ } \ } while (0) @@ -64,7 +64,7 @@ do { \ if (!(expr)) { \ int _ret = ret; \ - LOGE("failed [%s]", #expr); \ + CAM_LOG_ERROR("failed [%s]", #expr); \ muse_recorder_msg_return(api, class, _ret, module); \ return err; \ } \ @@ -125,6 +125,8 @@ void _recorder_disp_recording_status_cb(unsigned long long elapsed_time, unsigne recorder_return_if_fail(module); + CAM_LOG_DEBUG("elapsed time[%llu], size[%llu]", elapsed_time, file_size); + muse_recorder_msg_event2(MUSE_RECORDER_CB_EVENT, MUSE_RECORDER_EVENT_TYPE_RECORDING_STATUS, MUSE_RECORDER_EVENT_CLASS_THREAD_MAIN, @@ -179,9 +181,9 @@ void _recorder_disp_state_changed_cb(recorder_state_e previous, recorder_state_e device_recording = device_status >> 16; device_paused = 0x0000ffff & device_status; - LOGD("get [%s] 0x%8x", value_key, device_status); + CAM_LOG_INFO("get [%s] 0x%8x", value_key, device_status); - LOGD("previous RECORDING %d, PAUSED %d", device_recording, device_paused); + CAM_LOG_INFO("previous RECORDING %d, PAUSED %d", device_recording, device_paused); /* adjust status */ if (current == RECORDER_STATE_RECORDING) @@ -194,12 +196,12 @@ void _recorder_disp_state_changed_cb(recorder_state_e previous, recorder_state_e else if (previous == RECORDER_STATE_PAUSED) device_paused--; - LOGD("current RECORDING %d, PAUSED %d", device_recording, device_paused); + CAM_LOG_INFO("current RECORDING %d, PAUSED %d", device_recording, device_paused); /* make new status */ device_status = device_recording << 16 | device_paused; - LOGD("set [%s] 0x%8x", value_key, device_status); + CAM_LOG_INFO("set [%s] 0x%8x", value_key, device_status); muse_server_module_set_value(module, value_key, device_status); @@ -215,14 +217,14 @@ void _recorder_disp_state_changed_cb(recorder_state_e previous, recorder_state_e } if (current_state != device_state[muse_recorder->type]) { - LOGD("old %d -> new %d", device_state[muse_recorder->type], current_state); + CAM_LOG_INFO("old %d -> new %d", device_state[muse_recorder->type], current_state); emit_value = muse_recorder->type << 16 | current_state; device_state[muse_recorder->type] = current_state; } if (emit_value != -1) { - LOGD("recorder devce state change signal [0x%08x], vconf state : %d", + CAM_LOG_INFO("recorder devce state change signal [0x%08x], vconf state : %d", emit_value, vconf_state_recorder); legacy_recorder_emit_signal(muse_recorder->recorder_handle, @@ -234,7 +236,7 @@ void _recorder_disp_state_changed_cb(recorder_state_e previous, recorder_state_e vconf_set_int(VCONFKEY_RECORDER_STATE, vconf_state_recorder); if (muse_recorder->type == MUSE_RECORDER_TYPE_VIDEO) { - LOGD("Update vconf camera device state also : %d", vconf_state_camera); + CAM_LOG_INFO("Update vconf camera device state also : %d", vconf_state_camera); vconf_set_int(VCONFKEY_CAMERA_STATE, vconf_state_camera); } } @@ -313,18 +315,16 @@ void _recorder_disp_audio_stream_cb(void* stream, int size, recorder_sample_type export_data = g_new0(muse_recorder_export_data, 1); - /*LOGD("Enter");*/ - /* make tbm bo */ bo = tbm_bo_alloc(muse_recorder->bufmgr, size, TBM_BO_DEFAULT); if (bo == NULL) { - LOGE("bo alloc failed : bufmgr %p, size %d", muse_recorder->bufmgr, size); + CAM_LOG_ERROR("bo alloc failed : bufmgr %p, size %d", muse_recorder->bufmgr, size); goto _BUFFER_FAILED; } bo_handle = tbm_bo_map(bo, TBM_DEVICE_CPU, TBM_OPTION_READ | TBM_OPTION_WRITE); if (bo_handle.ptr == NULL) { - LOGE("bo map Error!"); + CAM_LOG_ERROR("bo map Error!"); goto _BUFFER_FAILED; } @@ -334,7 +334,7 @@ void _recorder_disp_audio_stream_cb(void* stream, int size, recorder_sample_type audio_fd = tbm_bo_export_fd(bo); if (audio_fd < 0) { - LOGE("export bo ERROR"); + CAM_LOG_ERROR("export bo ERROR"); goto _BUFFER_FAILED; } @@ -343,6 +343,8 @@ void _recorder_disp_audio_stream_cb(void* stream, int size, recorder_sample_type export_data->fd = audio_fd; export_data->bo = bo; + CAM_LOG_VERBOSE("export data[%p], fd[%d]", export_data, export_data->fd); + /* add bo info to list */ g_mutex_lock(&muse_recorder->recorder_data.lock); muse_recorder->recorder_data.list = g_list_append(muse_recorder->recorder_data.list, (gpointer)export_data); @@ -386,18 +388,16 @@ void _recorder_disp_muxed_stream_cb(void* stream, int size, unsigned long long o export_data = g_new0(muse_recorder_export_data, 1); - /*LOGD("Enter");*/ - /* make tbm bo */ bo = tbm_bo_alloc(muse_recorder->bufmgr, size, TBM_BO_DEFAULT); if (!bo) { - LOGE("bo alloc failed : bufmgr %p, size %d", muse_recorder->bufmgr, size); + CAM_LOG_ERROR("bo alloc failed : bufmgr %p, size %d", muse_recorder->bufmgr, size); goto _MUXED_STREAM_CB_ERROR; } bo_handle = tbm_bo_map(bo, TBM_DEVICE_CPU, TBM_OPTION_READ | TBM_OPTION_WRITE); if (!bo_handle.ptr) { - LOGE("bo map Error!"); + CAM_LOG_ERROR("bo map Error!"); goto _MUXED_STREAM_CB_ERROR; } @@ -407,7 +407,7 @@ void _recorder_disp_muxed_stream_cb(void* stream, int size, unsigned long long o muxed_fd = tbm_bo_export_fd(bo); if (muxed_fd < 0) { - LOGE("export bo ERROR"); + CAM_LOG_ERROR("export bo ERROR"); goto _MUXED_STREAM_CB_ERROR; } @@ -416,6 +416,8 @@ void _recorder_disp_muxed_stream_cb(void* stream, int size, unsigned long long o export_data->fd = muxed_fd; export_data->bo = bo; + CAM_LOG_VERBOSE("export data[%p], fd[%d]", export_data, export_data->fd); + /* add bo info to list */ g_mutex_lock(&muse_recorder->recorder_data.lock); muse_recorder->recorder_data.list = g_list_append(muse_recorder->recorder_data.list, (gpointer)export_data); @@ -457,7 +459,7 @@ bool _recorder_disp_video_encode_decision_cb(void *stream, void *user_data) tbm_fd tfd[MUSE_NUM_FD] = {-1, -1, -1, -1}; gint64 end_time = 0; - /*LOGD("Enter");*/ + /*CAM_LOG_INFO("Enter");*/ muse_recorder = (muse_recorder_handle_s *)muse_server_ipc_get_handle(module); @@ -465,7 +467,7 @@ bool _recorder_disp_video_encode_decision_cb(void *stream, void *user_data) export_data = camera_export_data_new_from_stream(stream, muse_recorder->bufmgr, tfd); if (!export_data) { - LOGE("export_data failed"); + CAM_LOG_ERROR("export_data failed"); return true; } @@ -491,11 +493,11 @@ bool _recorder_disp_video_encode_decision_cb(void *stream, void *user_data) end_time = g_get_monotonic_time() + G_TIME_SPAN_SECOND; if (!g_cond_wait_until(&muse_recorder->camera_data.cond, &muse_recorder->camera_data.lock, end_time)) - LOGW("video encode decision callback return message timeout"); + CAM_LOG_WARNING("video encode decision callback return message timeout"); g_mutex_unlock(&muse_recorder->camera_data.lock); - /*LOGD("returned video_encode_decision %d", muse_recorder->video_encode_decision);*/ + /*CAM_LOG_INFO("returned video_encode_decision %d", muse_recorder->video_encode_decision);*/ return muse_recorder->video_encode_decision; } @@ -569,19 +571,19 @@ static void _recorder_export_data_free(gpointer data) if (!export_data) return; - /*LOGD("fd[%d], bo[%p]", export_data->fd, export_data->bo);*/ + CAM_LOG_VERBOSE("export data[%p], fd[%d], bo[%p]", + export_data, export_data->fd, export_data->bo); /* unref bo */ if (export_data->bo) { tbm_bo_unref(export_data->bo); export_data->bo = NULL; } else { - LOGW("bo for fd[%d] is NULL", export_data->fd); + CAM_LOG_WARNING("bo for fd[%d] is NULL", export_data->fd); } /* close exported fd */ if (export_data->fd > -1) { - /*LOGD("close export_data->fd %d", export_data->fd);*/ close(export_data->fd); export_data->fd = -1; } @@ -592,7 +594,7 @@ static void _recorder_export_data_free(gpointer data) static int _recorder_export_data_compare(gconstpointer data, gconstpointer fd_to_find) { - /*LOGD("%d : %d", ((muse_recorder_export_data *)data)->fd, GPOINTER_TO_INT(fd_to_find));*/ + CAM_LOG_VERBOSE("%d : %d", ((muse_recorder_export_data *)data)->fd, GPOINTER_TO_INT(fd_to_find)); return (((muse_recorder_export_data *)data)->fd != GPOINTER_TO_INT(fd_to_find)); } @@ -613,7 +615,7 @@ static gboolean _recorder_remove_export_data(muse_recorder_data_list *recorder_d found_item = g_list_find_custom(recorder_data->list, GINT_TO_POINTER(fd), _recorder_export_data_compare); if (!found_item) { - LOGE("could not find data for fd[%d]", fd); + CAM_LOG_ERROR("could not find data for fd[%d]", fd); g_mutex_unlock(&recorder_data->lock); return FALSE; } @@ -641,9 +643,9 @@ bool _recorder_check_supported_feature(int type) feature_name = VIDEO_RECORDING_FEATURE_NAME; if (muse_server_get_platform_info(feature_name, &feature_supported) != MM_ERROR_NONE) - LOGE("failed to get platform info for [%s]", feature_name); + CAM_LOG_ERROR("failed to get platform info for [%s]", feature_name); - LOGD("[%s] -> %d", feature_name, feature_supported); + CAM_LOG_INFO("[%s] -> %d", feature_name, feature_supported); return feature_supported; } @@ -663,7 +665,7 @@ int recorder_dispatcher_create(muse_module_h module) muse_recorder_msg_get(recorder_type, muse_server_module_get_msg(module)); - LOGD("Enter - type %d", recorder_type); + CAM_LOG_INFO("Enter - type %d", recorder_type); /* init handle */ muse_recorder = g_new0(muse_recorder_handle_s, 1); @@ -676,7 +678,7 @@ int recorder_dispatcher_create(muse_module_h module) if (muse_server_ipc_get_bufmgr(&muse_recorder->bufmgr) != MM_ERROR_NONE || muse_server_ipc_get_gdbus_connection((GDBusConnection **)&gdbus_connection) != MM_ERROR_NONE) { - LOGE("tbm bufmgr or gdbus connection failed %p %p", muse_recorder->bufmgr, gdbus_connection); + CAM_LOG_ERROR("tbm bufmgr or gdbus connection failed %p %p", muse_recorder->bufmgr, gdbus_connection); ret = RECORDER_ERROR_INVALID_OPERATION; goto _CREATE_ERROR; } @@ -684,7 +686,7 @@ int recorder_dispatcher_create(muse_module_h module) if (recorder_type == MUSE_RECORDER_TYPE_VIDEO) { muse_recorder_msg_get_pointer(camera_handle, muse_server_module_get_msg(module)); if (camera_handle == 0) { - LOGE("NULL handle"); + CAM_LOG_ERROR("NULL handle"); ret = RECORDER_ERROR_INVALID_PARAMETER; goto _CREATE_ERROR; } @@ -694,22 +696,22 @@ int recorder_dispatcher_create(muse_module_h module) ret = legacy_recorder_create_videorecorder(muse_recorder->muse_camera->camera_handle, &muse_recorder->recorder_handle); - LOGD("video type, camera handle : %p", muse_recorder->muse_camera->camera_handle); + CAM_LOG_INFO("video type, camera handle : %p", muse_recorder->muse_camera->camera_handle); } else if (recorder_type == MUSE_RECORDER_TYPE_AUDIO) { muse_recorder_msg_get(pid, muse_server_module_get_msg(module)); - LOGD("audio type - pid %d", pid); + CAM_LOG_INFO("audio type - pid %d", pid); ret = legacy_recorder_create_audiorecorder(&muse_recorder->recorder_handle); if (ret != RECORDER_ERROR_NONE) { - LOGE("create audio recorder failed"); + CAM_LOG_ERROR("create audio recorder failed"); goto _CREATE_ERROR; } ret = legacy_recorder_set_client_pid(muse_recorder->recorder_handle, pid); ret |= legacy_recorder_set_gdbus_connection(muse_recorder->recorder_handle, gdbus_connection); } else { - LOGE("unknown type %d", recorder_type); + CAM_LOG_ERROR("unknown type %d", recorder_type); ret = RECORDER_ERROR_INVALID_OPERATION; } @@ -718,7 +720,7 @@ int recorder_dispatcher_create(muse_module_h module) /* recording feature check */ if (!_recorder_check_supported_feature(recorder_type)) { - LOGE("feature NOT SUPPORTED, BUT INI FILE FOR RECORDER IS EXISTED. RECOMMEND TO REMOVE IT."); + CAM_LOG_ERROR("feature NOT SUPPORTED, BUT INI FILE FOR RECORDER IS EXISTED. RECOMMEND TO REMOVE IT."); ret = RECORDER_ERROR_NOT_SUPPORTED; goto _CREATE_ERROR; } @@ -729,7 +731,7 @@ int recorder_dispatcher_create(muse_module_h module) if (ret != RECORDER_ERROR_NONE) goto _CREATE_ERROR; - LOGD("recorder handle : %p, module : %p", muse_recorder, module); + CAM_LOG_INFO("recorder handle : %p, module : %p", muse_recorder, module); handle = (intptr_t)muse_recorder->recorder_handle; muse_server_ipc_set_handle(module, (intptr_t)muse_recorder); @@ -750,7 +752,7 @@ _CREATE_ERROR: g_free(muse_recorder); - LOGE("error 0x%x", ret); + CAM_LOG_ERROR("error 0x%x", ret); muse_recorder_msg_return(api, class, ret, module); @@ -790,7 +792,7 @@ int recorder_dispatcher_destroy(muse_module_h module) g_free(muse_recorder); } else { - LOGE("recorder destroy failed 0x%x", ret); + CAM_LOG_ERROR("recorder destroy failed 0x%x", ret); } muse_recorder_msg_return(api, class, ret, module); @@ -836,7 +838,7 @@ int recorder_dispatcher_prepare(muse_module_h module) client_fd = muse_server_module_get_msg_fd(module); if (client_fd < 0) { ret = RECORDER_ERROR_INVALID_OPERATION; - LOGE("failed to get fd %d", client_fd); + CAM_LOG_ERROR("failed to get fd %d", client_fd); muse_recorder_msg_return(api, class, ret, module); return MUSE_RECORDER_ERROR_INVALID; } @@ -844,7 +846,7 @@ int recorder_dispatcher_prepare(muse_module_h module) /* public privilege for camera */ if (!muse_server_security_check_cynara(client_fd, CAMERA_PRIVILEGE_NAME)) { ret = RECORDER_ERROR_PERMISSION_DENIED; - LOGE("privilege[%s] failed 0x%x", CAMERA_PRIVILEGE_NAME, ret); + CAM_LOG_ERROR("privilege[%s] failed 0x%x", CAMERA_PRIVILEGE_NAME, ret); muse_recorder_msg_return(api, class, ret, module); return MUSE_RECORDER_ERROR_INVALID; } @@ -853,7 +855,7 @@ int recorder_dispatcher_prepare(muse_module_h module) if (muse_recorder->muse_camera && muse_recorder->muse_camera->platform_privilege && !muse_server_security_check_cynara(client_fd, muse_recorder->muse_camera->platform_privilege)) { ret = RECORDER_ERROR_PERMISSION_DENIED; - LOGE("privilege[%s] failed 0x%x", muse_recorder->muse_camera->platform_privilege, ret); + CAM_LOG_ERROR("privilege[%s] failed 0x%x", muse_recorder->muse_camera->platform_privilege, ret); muse_recorder_msg_return(api, class, ret, module); return MUSE_RECORDER_ERROR_INVALID; } @@ -901,7 +903,7 @@ int recorder_dispatcher_start(muse_module_h module) if (client_fd < 0) { //LCOV_EXCL_START ret = RECORDER_ERROR_INVALID_OPERATION; - LOGE("failed to get fd %d", client_fd); + CAM_LOG_ERROR("failed to get fd %d", client_fd); muse_recorder_msg_return(api, class, ret, module); return MUSE_RECORDER_ERROR_INVALID; //LCOV_EXCL_STOP @@ -909,7 +911,7 @@ int recorder_dispatcher_start(muse_module_h module) if (!muse_server_security_check_cynara(client_fd, RECORDER_PRIVILEGE_NAME)) { //LCOV_EXCL_START - LOGE("security(recorder) check failed"); + CAM_LOG_ERROR("security(recorder) check failed"); ret = RECORDER_ERROR_PERMISSION_DENIED; muse_recorder_msg_return(api, class, ret, module); return MUSE_RECORDER_ERROR_INVALID; @@ -1154,7 +1156,7 @@ int recorder_dispatcher_set_state_changed_cb(muse_module_h module) muse_recorder_api_e api = MUSE_RECORDER_API_SET_STATE_CHANGED_CB; muse_recorder_api_class_e class = MUSE_RECORDER_API_CLASS_IMMEDIATE; - LOGD("Enter"); + CAM_LOG_INFO("Enter"); muse_recorder_msg_return(api, class, ret, module); @@ -1167,7 +1169,7 @@ int recorder_dispatcher_unset_state_changed_cb(muse_module_h module) muse_recorder_api_e api = MUSE_RECORDER_API_UNSET_STATE_CHANGED_CB; muse_recorder_api_class_e class = MUSE_RECORDER_API_CLASS_IMMEDIATE; - LOGD("Enter"); + CAM_LOG_INFO("Enter"); muse_recorder_msg_return(api, class, ret, module); @@ -1967,7 +1969,7 @@ int recorder_dispatcher_attr_get_recording_motion_rate(muse_module_h module) ret = legacy_recorder_attr_get_recording_motion_rate(muse_recorder->recorder_handle, &get_rate); - LOGD("get rate %lf", get_rate); + CAM_LOG_INFO("get rate %lf", get_rate); muse_recorder_msg_return1(api, class, ret, module, DOUBLE, get_rate); @@ -2089,7 +2091,7 @@ int recorder_dispatcher_return_buffer(muse_module_h module) muse_recorder_msg_get(ret_fd, muse_server_module_get_msg(module)); muse_recorder_msg_get(buffer_type, muse_server_module_get_msg(module)); - /*LOGD("handle[%p] buffer type[%d] ret_fd[%d]", muse_recorder, buffer_type, ret_fd);*/ + /*CAM_LOG_INFO("handle[%p] buffer type[%d] ret_fd[%d]", muse_recorder, buffer_type, ret_fd);*/ if (buffer_type == MUSE_RECORDER_BUFFER_TYPE_VIDEO_ENCODE_DECISION) { /* get decision and send signal */ @@ -2097,15 +2099,15 @@ int recorder_dispatcher_return_buffer(muse_module_h module) g_mutex_lock(&muse_recorder->camera_data.lock); muse_recorder->video_encode_decision = (bool)video_encode_decision; - /*LOGD("video_encode_decision[%d]", video_encode_decision);*/ + /*CAM_LOG_INFO("video_encode_decision[%d]", video_encode_decision);*/ g_cond_signal(&muse_recorder->camera_data.cond); g_mutex_unlock(&muse_recorder->camera_data.lock); if (!camera_remove_export_data(&muse_recorder->camera_data, (tbm_fd)ret_fd)) - LOGE("remove export data for video encode decision failed. fd[%d]", ret_fd); + CAM_LOG_ERROR("remove export data for video encode decision failed. fd[%d]", ret_fd); } else { if (!_recorder_remove_export_data(&muse_recorder->recorder_data, (tbm_fd)ret_fd)) - LOGE("remove export data failed. buffer type[%d] fd[%d]", buffer_type, ret_fd); + CAM_LOG_ERROR("remove export data failed. buffer type[%d] fd[%d]", buffer_type, ret_fd); } return MUSE_RECORDER_ERROR_NONE; @@ -2150,7 +2152,7 @@ int recorder_dispatcher_get_device_state(muse_module_h module) muse_recorder_msg_get(recorder_type, muse_server_module_get_msg(module)); if (recorder_type > RECORDER_TYPE_VIDEO) { - LOGE("invalid type %d", recorder_type); + CAM_LOG_ERROR("invalid type %d", recorder_type); ret = RECORDER_ERROR_INVALID_PARAMETER; muse_recorder_msg_return(api, class, ret, module); return MUSE_RECORDER_ERROR_NONE; @@ -2159,7 +2161,7 @@ int recorder_dispatcher_get_device_state(muse_module_h module) /* recording feature check */ if (!_recorder_check_supported_feature(recorder_type)) { //LCOV_EXCL_START - LOGE("feature not supported"); + CAM_LOG_ERROR("feature not supported"); ret = RECORDER_ERROR_NOT_SUPPORTED; muse_recorder_msg_return(api, class, ret, module); return MUSE_RECORDER_ERROR_NONE; @@ -2174,14 +2176,14 @@ int recorder_dispatcher_get_device_state(muse_module_h module) device_recording = device_state >> 16; device_paused = 0x0000ffff & device_state; - LOGD("device recording %d, paused %d", device_recording, device_paused); + CAM_LOG_INFO("device recording %d, paused %d", device_recording, device_paused); if (device_recording > 0) get_device_state = RECORDER_DEVICE_STATE_RECORDING; else if (device_paused > 0) get_device_state = RECORDER_DEVICE_STATE_PAUSED; - LOGD("device[%d] state : %d", recorder_type, get_device_state); + CAM_LOG_INFO("device[%d] state : %d", recorder_type, get_device_state); muse_recorder_msg_return1(api, class, ret, module, INT, get_device_state); @@ -2357,20 +2359,20 @@ static int recorder_cmd_dispatcher_initialize(muse_module_h module) item_count = sizeof(load_list) / sizeof(load_list[0]); - LOGD("item count %d", item_count); + CAM_LOG_INFO("item count %d", item_count); for (i = 0 ; i < item_count ; i++) { plugin = gst_plugin_load_file(load_list[i], NULL); if (plugin) { - LOGD("%s loaded", load_list[i]); + CAM_LOG_INFO("%s loaded", load_list[i]); gst_object_unref(plugin); plugin = NULL; } else { - LOGW("failed to load %s", load_list[i]); + CAM_LOG_WARNING("failed to load %s", load_list[i]); } } - LOGD("done"); + CAM_LOG_INFO("done"); return MUSE_RECORDER_ERROR_NONE; } @@ -2388,14 +2390,14 @@ static int recorder_cmd_dispatcher_shutdown(muse_module_h module) legacy_recorder_get_state(muse_recorder->recorder_handle, &state); - LOGW("shutdown handle %p [state:%d]", muse_recorder->recorder_handle, state); + CAM_LOG_WARNING("shutdown handle %p [state:%d]", muse_recorder->recorder_handle, state); switch (state) { case RECORDER_STATE_PAUSED: case RECORDER_STATE_RECORDING: ret = legacy_recorder_commit(muse_recorder->recorder_handle); if (ret != RECORDER_ERROR_NONE) { - LOGE("commit failed. cancel..."); + CAM_LOG_ERROR("commit failed. cancel..."); legacy_recorder_cancel(muse_recorder->recorder_handle); } /* fall through */ @@ -2420,14 +2422,14 @@ static int recorder_cmd_dispatcher_shutdown(muse_module_h module) free(muse_recorder); muse_recorder = NULL; } else { - LOGE("shutdown failed"); + CAM_LOG_ERROR("shutdown failed"); } break; default: break; } - LOGW("done"); + CAM_LOG_WARNING("done"); return MUSE_RECORDER_ERROR_NONE; } @@ -2445,11 +2447,11 @@ static int recorder_cmd_external_storage_state_changed(muse_module_h module) storage_state = (int)(long)muse_server_get_user_data(module); - LOGW("storage state %d", storage_state); + CAM_LOG_WARNING("storage state %d", storage_state); ret = legacy_recorder_manage_external_storage_state(muse_recorder->recorder_handle, storage_state); - LOGW("done : 0x%x", ret); + CAM_LOG_WARNING("done : 0x%x", ret); return MUSE_RECORDER_ERROR_NONE; } diff --git a/packaging/mmsvc-recorder.spec b/packaging/mmsvc-recorder.spec index b484861..86c6661 100644 --- a/packaging/mmsvc-recorder.spec +++ b/packaging/mmsvc-recorder.spec @@ -1,6 +1,6 @@ Name: mmsvc-recorder Summary: A Recorder module for muse server -Version: 0.3.24 +Version: 0.3.25 Release: 0 Group: Multimedia/Libraries License: Apache-2.0