Add mm_handle field to use it in gdbus sound eos callback
[platform/core/multimedia/libmm-camcorder.git] / src / mm_camcorder_internal.c
index e7215a1..b117f6e 100644 (file)
@@ -163,8 +163,11 @@ int _mmcamcorder_create(MMHandleType *handle, MMCamPreset *info)
 
        if (info->videodev_type != MM_VIDEO_DEVICE_NONE) {
                /* init for gdbus */
+               hcamcorder->gdbus_info_sound.mm_handle = hcamcorder;
                g_mutex_init(&hcamcorder->gdbus_info_sound.sync_mutex);
                g_cond_init(&hcamcorder->gdbus_info_sound.sync_cond);
+
+               hcamcorder->gdbus_info_solo_sound.mm_handle = hcamcorder;
                g_mutex_init(&hcamcorder->gdbus_info_solo_sound.sync_mutex);
                g_cond_init(&hcamcorder->gdbus_info_solo_sound.sync_cond);
        }
@@ -3313,6 +3316,9 @@ void _mmcamcorder_sound_signal_callback(mm_sound_signal_name_t signal, int value
                }
        }
 
+       /* reset flag not to run sound focus related code since now */
+       hcamcorder->sound_focus_register = FALSE;
+
        _MMCAMCORDER_UNLOCK_ASM(hcamcorder);
 
        _mmcam_dbg_warn("done");
@@ -3364,14 +3370,14 @@ void _mmcamcorder_sound_focus_watch_cb(int id, mm_sound_focus_type_e focus_type,
        if (focus_state == FOCUS_IS_RELEASED) {
                _MMCamcorderMsgItem msg;
 
-               _mmcam_dbg_log("other process's FOCUS is acquired");
+               _mmcam_dbg_log("other process's FOCUS is released");
 
                msg.id = MM_MESSAGE_READY_TO_RESUME;
                _mmcamcorder_send_message((MMHandleType)hcamcorder, &msg);
 
                _mmcam_dbg_log("Finish opeartion");
        } else if (focus_state == FOCUS_IS_ACQUIRED) {
-               _mmcam_dbg_log("other process's FOCUS is released : Stop pipeline[state:%d]", current_state);
+               _mmcam_dbg_log("other process's FOCUS is acquired : Stop pipeline[state:%d]", current_state);
 
                __mmcamcorder_force_stop(hcamcorder);