diff options
author | Jeongmo Yang <jm80.yang@samsung.com> | 2017-02-09 16:24:06 +0900 |
---|---|---|
committer | Jeongmo Yang <jm80.yang@samsung.com> | 2017-02-09 17:06:59 +0900 |
commit | cf4b09dfde1be666ccb18382ba993920f91298e3 (patch) | |
tree | ced3fa1a67f0fd03c21337acb5ae86db720745b5 | |
parent | 120bad9491c6d52d24f063248fb746b71d296f05 (diff) | |
download | recorder-cf4b09dfde1be666ccb18382ba993920f91298e3.tar.gz recorder-cf4b09dfde1be666ccb18382ba993920f91298e3.tar.bz2 recorder-cf4b09dfde1be666ccb18382ba993920f91298e3.zip |
Remove timeout for handle creation APIsubmit/tizen_3.0/20170209.083529accepted/tizen/3.0/wearable/20170210.082107accepted/tizen/3.0/tv/20170210.082019accepted/tizen/3.0/mobile/20170210.081947accepted/tizen/3.0/ivi/20170210.082147accepted/tizen/3.0/common/20170210.171027
In handle creation API, muse recorder module checks privilege for microphone use,
but it can be stuck for a long time if app does not have microphone privilege and there is no feedback for privilege popup.
[Version] 0.2.50
[Profile] Common
[Issue Type] Update
[Dependency module] N/A
[Test] [M(T) - Boot=(OK), sdb=(OK), Home=(OK), Touch=(OK), Version=tizen-3.0-mobile_20170207.1]
Change-Id: I319741ada0f39f2c6e8fbc6865d3255519f6775b
Signed-off-by: Jeongmo Yang <jm80.yang@samsung.com>
-rw-r--r-- | include/recorder_private.h | 1 | ||||
-rw-r--r-- | packaging/capi-media-recorder.spec | 4 | ||||
-rw-r--r-- | src/recorder.c | 22 |
3 files changed, 17 insertions, 10 deletions
diff --git a/include/recorder_private.h b/include/recorder_private.h index daefa2c..504ba7f 100644 --- a/include/recorder_private.h +++ b/include/recorder_private.h @@ -27,6 +27,7 @@ extern "C" { #endif #define RECORDER_CB_TIMEOUT 5 +#define RECORDER_CB_NO_TIMEOUT 0 #define RECORDER_FILENAME_MAX 256 #define RECORDER_MSG_PARAM_SET(param, msg_type, set_value) { \ diff --git a/packaging/capi-media-recorder.spec b/packaging/capi-media-recorder.spec index f4a9c8c..fab3b93 100644 --- a/packaging/capi-media-recorder.spec +++ b/packaging/capi-media-recorder.spec @@ -1,7 +1,7 @@ Name: capi-media-recorder Summary: A Recorder API -Version: 0.2.49 -Release: 1 +Version: 0.2.50 +Release: 0 Group: Multimedia/API License: Apache-2.0 Source0: %{name}-%{version}.tar.gz diff --git a/src/recorder.c b/src/recorder.c index b799ef1..174c2c3 100644 --- a/src/recorder.c +++ b/src/recorder.c @@ -1190,16 +1190,22 @@ static int _recorder_client_wait_for_cb_return(muse_recorder_api_e api, recorder g_mutex_lock(&(cb_info->api_mutex[api])); if (cb_info->api_activating[api] == 0) { - end_time = g_get_monotonic_time() + time_out * G_TIME_SPAN_SECOND; - if (g_cond_wait_until(&(cb_info->api_cond[api]), &(cb_info->api_mutex[api]), end_time)) { + if (time_out == RECORDER_CB_NO_TIMEOUT) { + LOGW("wait for api %d", api); + g_cond_wait(&(cb_info->api_cond[api]), &(cb_info->api_mutex[api])); ret = cb_info->api_ret[api]; cb_info->api_activating[api] = 0; - - /*LOGD("return value : 0x%x", ret);*/ + LOGW("api %d returned 0x%x", api, ret); } else { - ret = RECORDER_ERROR_INVALID_OPERATION; - - LOGE("api %d was TIMED OUT!", api); + end_time = g_get_monotonic_time() + time_out * G_TIME_SPAN_SECOND; + if (g_cond_wait_until(&(cb_info->api_cond[api]), &(cb_info->api_mutex[api]), end_time)) { + ret = cb_info->api_ret[api]; + cb_info->api_activating[api] = 0; + /*LOGD("return value : 0x%x", ret);*/ + } else { + ret = RECORDER_ERROR_INVALID_OPERATION; + LOGE("api %d was TIMED OUT!", api); + } } } else { ret = cb_info->api_ret[api]; @@ -1501,7 +1507,7 @@ static int _recorder_create_common(recorder_h *recorder, muse_recorder_type_e ty sock_fd = -1; - ret = _recorder_client_wait_for_cb_return(MUSE_RECORDER_API_CREATE, pc->cb_info, RECORDER_CB_TIMEOUT); + ret = _recorder_client_wait_for_cb_return(MUSE_RECORDER_API_CREATE, pc->cb_info, RECORDER_CB_NO_TIMEOUT); pc->cb_info->api_waiting[MUSE_RECORDER_API_CREATE] = 0; |