/* send message */
muse_camera_msg_event3(MUSE_CAMERA_CB_EVENT,
MUSE_CAMERA_EVENT_TYPE_CAPTURE,
- MUSE_CAMERA_EVENT_CLASS_THREAD_SUB,
+ MUSE_CAMERA_EVENT_CLASS_THREAD_MAIN,
module,
INT, tbm_key_main,
INT, tbm_key_post,
INT, by_policy);
muse_camera = (muse_camera_handle_s *)muse_core_ipc_get_handle(module);
- if (muse_camera) {
- ret = legacy_camera_get_device_type(muse_camera->camera_handle, &device_type);
- if (ret != CAMERA_ERROR_NONE) {
- LOGE("get device type failed 0x%x", ret);
- return;
- }
+ if (!muse_camera) {
+ LOGW("NULL muse camera handle");
+ return;
+ }
- snprintf(value_key, KEY_LENGTH, "device_state_camera%d", device_type);
- if (previous == CAMERA_STATE_CREATED && current == CAMERA_STATE_PREVIEW)
- set_value = CAMERA_DEVICE_STATE_WORKING;
- else if (previous == CAMERA_STATE_PREVIEW && current == CAMERA_STATE_CREATED)
- set_value = CAMERA_DEVICE_STATE_NULL;
+ ret = legacy_camera_get_device_type(muse_camera->camera_handle, &device_type);
+ if (ret != CAMERA_ERROR_NONE) {
+ LOGE("get device type failed 0x%x", ret);
+ return;
+ }
- if (set_value != -1) {
- LOGD("device state set : %d", set_value);
- muse_core_client_set_value(module, value_key, set_value);
- }
- } else {
- LOGW("NULL muse camera handle");
+ snprintf(value_key, KEY_LENGTH, "device_state_camera%d", device_type);
+ if (previous == CAMERA_STATE_CREATED && current == CAMERA_STATE_PREVIEW)
+ set_value = CAMERA_DEVICE_STATE_WORKING;
+ else if (previous == CAMERA_STATE_PREVIEW && current == CAMERA_STATE_CREATED)
+ set_value = CAMERA_DEVICE_STATE_NULL;
+
+ if (set_value != -1) {
+ LOGD("device[%s] state set : %d", value_key, set_value);
+ muse_core_client_set_value(module, value_key, set_value);
}
return;