Add new function to set gdbus connection, 2. Bug fix for EXIF info 37/93637/2 accepted/tizen/3.0/common/20161114.105828 accepted/tizen/3.0/ivi/20161028.134044 accepted/tizen/3.0/mobile/20161028.133157 accepted/tizen/3.0/tv/20161028.133509 accepted/tizen/3.0/wearable/20161028.133800 accepted/tizen/common/20161025.155121 accepted/tizen/common/20161027.073658 accepted/tizen/ivi/20161027.055029 accepted/tizen/mobile/20161027.054932 accepted/tizen/tv/20161027.055003 accepted/tizen/wearable/20161027.055019 submit/tizen/20161025.104308 submit/tizen/20161027.030209 submit/tizen_3.0/20161028.062323 submit/tizen_3.0/20161028.082423 submit/tizen_3.0_common/20161104.104000
authorJeongmo Yang <jm80.yang@samsung.com>
Tue, 25 Oct 2016 06:20:56 +0000 (15:20 +0900)
committerJeongmo Yang <jm80.yang@samsung.com>
Tue, 25 Oct 2016 06:21:46 +0000 (15:21 +0900)
Sometimes, got crashed when get gdbus connection,
so, do not get gdbus connection in camera module and get from outside(muse server)

[Version] 0.2.30
[Profile] Common
[Issue Type] Update
[Dependency module] libmm-camcorder, mmsvc-core
[Test] [M(T) - Boot=(OK), sdb=(OK), Home=(OK), Touch=(OK), Version=tizen-mobile_20161024.2]

Change-Id: I53a6e1aad6a692c47c037517bc8534acc3de89dd
Signed-off-by: Jeongmo Yang <jm80.yang@samsung.com>
legacy/include/legacy_recorder_internal.h
legacy/src/legacy_recorder_internal.c
muse/src/muse_recorder_dispatcher.c
packaging/mmsvc-recorder.spec

index 2fec16a..3b9d9ad 100644 (file)
@@ -32,13 +32,12 @@ extern "C" {
  * @ingroup CAPI_MEDIA_RECORDER_MUSED_MODULE
  * @param[in] recorder The handle to the recorder
  * @param[in] pid The pid of client
- *
  * @return @c 0 on success, otherwise a negative error value
  * @retval #RECORDER_ERROR_NONE Successful
  * @retval #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
  * @retval #RECORDER_ERROR_INVALID_OPERATION Invalid operation
  * @retval #RECORDER_ERROR_INVALID_STATE Invalid state
- * @pre        The recorder state must be #RECORDER_STATE_CREATED.
+ * @pre The recorder state must be #RECORDER_STATE_CREATED.
  */
 int legacy_recorder_set_client_pid(recorder_h recorder, int pid);
 
@@ -54,6 +53,19 @@ int legacy_recorder_set_client_pid(recorder_h recorder, int pid);
 void legacy_recorder_emit_signal(recorder_h recorder, const char *object_name,
        const char *interface_name, const char *signal_name, int value);
 
+/**
+ * @brief Set gdbus connection created from outside.
+ * @ingroup CAPI_MEDIA_RECORDER_MUSED_MODULE
+ * @param[in] recorder The handle to the recorder
+ * @param[in] gdbus_connection The connection of gdbus
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #RECORDER_ERROR_NONE Successful
+ * @retval #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #RECORDER_ERROR_INVALID_OPERATION Invalid operation
+ * @retval #RECORDER_ERROR_INVALID_STATE Invalid state
+ * @pre The recorder state must be #RECORDER_STATE_CREATED.
+ */
+int legacy_recorder_set_gdbus_connection(recorder_h recorder, void *gdbus_connection);
 
 #ifdef __cplusplus
 }
index bb6b6bb..df11a5b 100644 (file)
@@ -62,3 +62,23 @@ void legacy_recorder_emit_signal(recorder_h recorder, const char *object_name,
 
        return;
 }
+
+
+int legacy_recorder_set_gdbus_connection(recorder_h recorder, void *gdbus_connection)
+{
+       int ret;
+       recorder_s *handle = (recorder_s *)recorder;
+
+       if (handle == NULL) {
+               LOGE("NULL handle");
+               return RECORDER_ERROR_INVALID_PARAMETER;
+       }
+
+       LOGD("gdbus_connection %p", gdbus_connection);
+
+       ret = mm_camcorder_set_attributes(handle->mm_handle, NULL,
+               MMCAM_GDBUS_CONNECTION, gdbus_connection, sizeof(gdbus_connection),
+               NULL);
+
+       return __convert_recorder_error_code(__func__, ret);
+}
index 87ab3e6..940f3f4 100644 (file)
@@ -468,6 +468,7 @@ int recorder_dispatcher_create(muse_module_h module)
        int recorder_type = MUSE_RECORDER_TYPE_AUDIO;
        int client_fd = -1;
        int pid = 0;
+       void *gdbus_connection = NULL;
        muse_recorder_api_e api = MUSE_RECORDER_API_CREATE;
        muse_recorder_api_class_e class = MUSE_RECORDER_API_CLASS_IMMEDIATE;
        intptr_t camera_handle = 0;
@@ -502,8 +503,9 @@ int recorder_dispatcher_create(muse_module_h module)
        muse_recorder->type = recorder_type;
        g_mutex_init(&muse_recorder->list_lock);
 
-       if (muse_core_ipc_get_bufmgr(&muse_recorder->bufmgr) != MM_ERROR_NONE) {
-               LOGE("muse_core_ipc_get_bufmgr failed");
+       if (muse_core_ipc_get_bufmgr(&muse_recorder->bufmgr) != MM_ERROR_NONE ||
+               muse_core_ipc_get_gdbus_connection((GDBusConnection **)&gdbus_connection) != MM_ERROR_NONE) {
+               LOGE("tbm bufmgr or gdbus conntection failed %p %p", muse_recorder->bufmgr, gdbus_connection);
                ret = RECORDER_ERROR_INVALID_OPERATION;
                goto _CREATE_ERROR;
        }
@@ -533,6 +535,7 @@ int recorder_dispatcher_create(muse_module_h module)
                }
 
                ret = legacy_recorder_set_client_pid(muse_recorder->recorder_handle, pid);
+               ret |= legacy_recorder_set_gdbus_connection(muse_recorder->recorder_handle, gdbus_connection);
        }
 
        if (ret != RECORDER_ERROR_NONE)
index 9ed3e24..0d0e63b 100644 (file)
@@ -1,6 +1,6 @@
 Name:       mmsvc-recorder
 Summary:    A Recorder module for muse server
-Version:    0.2.29
+Version:    0.2.30
 Release:    0
 Group:      Multimedia/Libraries
 License:    Apache-2.0