summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeongmo Yang <jm80.yang@samsung.com>2016-10-25 15:20:56 +0900
committerJeongmo Yang <jm80.yang@samsung.com>2016-10-25 15:21:46 +0900
commit91e450f52b04b6181cc63befb8ddf715b9d0579a (patch)
tree689754f37c6964bdd985b971ee5116eb7deb6681
parentdf13ab537cd13196b0b3d52550d0c396192baf8a (diff)
downloadmmsvc-recorder-91e450f52b04b6181cc63befb8ddf715b9d0579a.tar.gz
mmsvc-recorder-91e450f52b04b6181cc63befb8ddf715b9d0579a.tar.bz2
mmsvc-recorder-91e450f52b04b6181cc63befb8ddf715b9d0579a.zip
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>
-rw-r--r--legacy/include/legacy_recorder_internal.h16
-rw-r--r--legacy/src/legacy_recorder_internal.c20
-rw-r--r--muse/src/muse_recorder_dispatcher.c7
-rw-r--r--packaging/mmsvc-recorder.spec2
4 files changed, 40 insertions, 5 deletions
diff --git a/legacy/include/legacy_recorder_internal.h b/legacy/include/legacy_recorder_internal.h
index 2fec16a..3b9d9ad 100644
--- a/legacy/include/legacy_recorder_internal.h
+++ b/legacy/include/legacy_recorder_internal.h
@@ -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
}
diff --git a/legacy/src/legacy_recorder_internal.c b/legacy/src/legacy_recorder_internal.c
index bb6b6bb..df11a5b 100644
--- a/legacy/src/legacy_recorder_internal.c
+++ b/legacy/src/legacy_recorder_internal.c
@@ -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);
+}
diff --git a/muse/src/muse_recorder_dispatcher.c b/muse/src/muse_recorder_dispatcher.c
index 87ab3e6..940f3f4 100644
--- a/muse/src/muse_recorder_dispatcher.c
+++ b/muse/src/muse_recorder_dispatcher.c
@@ -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)
diff --git a/packaging/mmsvc-recorder.spec b/packaging/mmsvc-recorder.spec
index 9ed3e24..0d0e63b 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.2.29
+Version: 0.2.30
Release: 0
Group: Multimedia/Libraries
License: Apache-2.0