Modify DCM message structure and so on 86/107386/4 accepted/tizen/3.0/common/20170220.125817 accepted/tizen/3.0/ivi/20170220.013444 accepted/tizen/3.0/mobile/20170220.013231 accepted/tizen/3.0/tv/20170220.013259 accepted/tizen/3.0/wearable/20170220.013401 submit/tizen_3.0/20170217.052416
authorJiyong Min <jiyong.min@samsung.com>
Thu, 9 Feb 2017 11:06:13 +0000 (20:06 +0900)
committerJiyong Min <jiyong.min@samsung.com>
Thu, 9 Feb 2017 11:11:17 +0000 (20:11 +0900)
 - Change DCM message and condition due to it is not running sometimes

  - Socket timeout was increased to 60 sec.
  The timeout error happen frequently.
  As the result which we tested, it took 30 sec or more at wrost case.
  So it was increased to 60 sec.

Change-Id: Ib65050359c6b097229a55475eec98f138582f42a
Signed-off-by: jiyong.min <jiyong.min@samsung.com>
lib/include/media-server-ipc.h
lib/include/media-util-dcm.h
lib/media-util-dcm.c [changed mode: 0644->0755]
packaging/media-server.spec
src/server/media-server-dcm.c [changed mode: 0644->0755]

index 3ffccf0..7cf3a35 100755 (executable)
@@ -25,6 +25,7 @@
 #define MS_TIMEOUT_SEC_3                                       3               /**< Response from Server time out */
 #define MS_TIMEOUT_SEC_10                                      10              /**< Response from Server time out */
 #define MS_TIMEOUT_SEC_20                      20              /**< Response from Media server time out */
+#define MS_TIMEOUT_SEC_60                      60              /**< Response from DCM Service time out */
 
 typedef enum{
        MS_DB_BATCH_UPDATE_PORT = 0,    /**< Media DB batch update */
@@ -139,9 +140,9 @@ typedef struct {
        int msg_type;
        int pid;
        uid_t uid;
+       int result;
        size_t msg_size;
        char msg[MAX_FILEPATH_LEN];
-       int result;
 } dcmMsg;
 
 #endif /*_MEDIA_SERVER_IPC_H_*/
index 7eda884..0686c5f 100755 (executable)
 extern "C" {
 #endif
 
+enum {
+       DCM_REQUEST_MEDIA,
+       DCM_REQUEST_ALL_MEDIA,
+       DCM_REQUEST_START_FACE_DETECTION,
+       DCM_REQUEST_CANCEL_FACE,
+};
+
 typedef int (*FaceFunc) (int error_code, int count, void* data);
 
 int dcm_request_extract_all(uid_t uid);
old mode 100644 (file)
new mode 100755 (executable)
index 1c0c835..ccd4953
@@ -54,13 +54,6 @@ typedef struct {
        faceUserData *userData;
 } dcmReq;
 
-enum {
-       DCM_REQUEST_MEDIA,
-       DCM_REQUEST_ALL_MEDIA,
-       DCM_REQUEST_START_FACE_DETECTION,
-       DCM_REQUEST_CANCEL_FACE,
-};
-
 typedef enum
 {
        DCM_PHONE,                      /**< Stored only in phone */
@@ -302,7 +295,7 @@ int _media_dcm_send_request()
 
        MSAPI_DBG("_media_dcm_send_request start");
 
-       err = ms_ipc_create_client_socket(MS_PROTOCOL_TCP, MS_TIMEOUT_SEC_10, &sock_info);
+       err = ms_ipc_create_client_socket(MS_PROTOCOL_TCP, MS_TIMEOUT_SEC_60, &sock_info);
        if (err != MS_MEDIA_ERR_NONE) {
                MSAPI_DBG_ERR("ms_ipc_create_client_socket failed");
                return err;
@@ -396,7 +389,7 @@ int _media_dcm_request(int msg_type, const char *path, uid_t uid)
        int pid;
        sock_info.port = MS_DCM_CREATOR_PORT;
 
-       err = ms_ipc_create_client_socket(MS_PROTOCOL_TCP, MS_TIMEOUT_SEC_10, &sock_info);
+       err = ms_ipc_create_client_socket(MS_PROTOCOL_TCP, MS_TIMEOUT_SEC_60, &sock_info);
        if (err != MS_MEDIA_ERR_NONE) {
                MSAPI_DBG_ERR("ms_ipc_create_client_socket failed");
                return err;
index c155936..731fd38 100755 (executable)
@@ -1,6 +1,6 @@
 Name:       media-server
 Summary:    A server for media content management
-Version:    0.3.31
+Version:    0.3.32
 Release:    0
 Group:      Multimedia/Service
 License:    Apache-2.0
old mode 100644 (file)
new mode 100755 (executable)
index f50e504..a81b8a6
@@ -98,7 +98,7 @@ void _ms_dcm_create_timer(int id)
        if (id > 0)
                g_source_destroy(g_main_context_find_source_by_id(g_main_context_get_thread_default(), id));
 
-       GSource *timer_src = g_timeout_source_new_seconds(MS_TIMEOUT_SEC_20);
+       GSource *timer_src = g_timeout_source_new_seconds(MS_TIMEOUT_SEC_60);
        g_source_set_callback(timer_src, _ms_dcm_agent_timer, NULL, NULL);
        g_dcm_timer_id = g_source_attach(timer_src, g_main_context_get_thread_default());
 
@@ -283,7 +283,7 @@ gboolean _ms_dcm_agent_send_msg_to_dcm_server(dcmMsg *recv_msg, dcmMsg *res_msg)
                return FALSE;
        }
 
-       if (ms_ipc_create_client_socket(MS_PROTOCOL_TCP, MS_TIMEOUT_SEC_10, &sock_info) < 0) {
+       if (ms_ipc_create_client_socket(MS_PROTOCOL_TCP, MS_TIMEOUT_SEC_60, &sock_info) < 0) {
                MS_DBG_ERR("ms_ipc_create_client_socket failed");
                return FALSE;
        }
@@ -318,7 +318,7 @@ gboolean _ms_dcm_agent_send_msg_to_dcm_server(dcmMsg *recv_msg, dcmMsg *res_msg)
        MS_DBG_SLOG("recv %s(%d, %d) from DCM daemon is successful", res_msg->msg, res_msg->msg_type, res_msg->result);
        ms_ipc_delete_client_socket(&sock_info);
 
-       if (res_msg->msg_type == 1 && g_dcm_comm_sock > 0) { /* DCM_REQUEST_ALL_MEDIA */
+       if (res_msg->msg_type == DCM_REQUEST_MEDIA && g_dcm_comm_sock > 0) { /* DCM_REQUEST_ALL_MEDIA */
                GSource *source = NULL;
                if (g_dcm_tcp_channel == NULL)
                        g_dcm_tcp_channel = g_io_channel_unix_new(g_dcm_comm_sock);