drm-client for tizen 2.0
authorMahendra Kumar Prajapat <mahendra.p@samsung.com>
Tue, 28 Aug 2012 09:18:35 +0000 (14:48 +0530)
committerMahendra Kumar Prajapat <mahendra.p@samsung.com>
Tue, 28 Aug 2012 09:18:35 +0000 (14:48 +0530)
include/drm_client_ipc.h
include/drm_client_types.h
packaging/drm-client.spec
service/drm_client_ipc.cpp

index e8303f76cc64820a1f63633fc3e349b5fce4fd57..46cc60d61e98bf390383563b570198bd53f5fdfc 100755 (executable)
@@ -72,7 +72,7 @@ extern "C" {
 /**\r
 * Maximum concurrent clients supported\r
 */\r
-#define DRM_MAX_CLIENT_SUPPORTED 5\r
+#define DRM_MAX_CLIENT_SUPPORTED 10\r
 \r
 /**\r
 * Maximum callback data size\r
@@ -136,8 +136,6 @@ typedef struct {
  * @remark     It can be used to track drm clients.\r
  */\r
 typedef struct {\r
-       /** Active state for structure */\r
-       int active;\r
 \r
        /** Client Id */\r
        int client_id;\r
index d069ea6cfbcafed1f78c714a36d47da4c71d1043..97c7235652c3538643431bf9911a53696e287866 100755 (executable)
@@ -154,7 +154,7 @@ extern "C" {
 /*\r
  * Max length of Order ID\r
  */\r
-#define DRM_MAX_LEN_ORDER_ID   (15)\r
+#define DRM_MAX_LEN_ORDER_ID   (23)\r
 \r
 /*\r
  * Max length of Service ID\r
index 6bbc24d52f23f65a5e9c2c0397dcf59e35949e40..e2b722e3f5027af4ba15a15570d54a520f25a52f 100755 (executable)
@@ -1,6 +1,6 @@
 Name:       drm-client
 Summary:    DRM client Package
-Version:    0.0.23
+Version:    0.0.26
 Release:    0
 Group:      TO_BE/FILLED_IN
 License:    Apache
index 478c71a16faa7a0bc653c9d80c40d396bb38c5a7..8781311617ce4697add56b2c84797c3fd685025a 100755 (executable)
@@ -120,33 +120,43 @@ void __search_client_info_cb(drm_client_cb_data_s* callinfo)
  * @see\r
  * @since       0.1\r
  */\r
-void *client_async_cb_handler(void *thread_arg)\r
-{\r
+void *client_async_cb_handler(void *thread_arg) {\r
        drm_client_cb_data_s callinfo;\r
        int retval = 0, result = 0;\r
-       memset(&callinfo, 0x00, sizeof(drm_client_cb_data_s));\r
 \r
        /* This Async thread will be running for the entire process alive time\r
         * to handle all the async related operations sent from the server\r
         */\r
-       while(1)\r
-       {\r
-               /* waiting for data on async socket */\r
-               if ((retval = read(async_sockfd, &callinfo, sizeof(drm_client_cb_data_s))) < 0) {\r
-                       DRM_CLIENT_EXCEPTION(" Async call_back read error!!, retval = %d, error = %s",\r
-                                       retval, strerror(errno));\r
-                       result = DRM_RETURN_COMMUNICATION_ERROR;\r
+       while (1) {\r
+               memset(&callinfo, 0x00, sizeof(drm_client_cb_data_s));\r
+               retval = read(async_sockfd, &callinfo, sizeof(drm_client_cb_data_s));\r
+               if (0 == retval) {\r
+                       DRM_CLIENT_LOG("Read returns 0!, retval = %d", retval);\r
+                       DRM_CLIENT_LOG("Server end closed!!!!");\r
+                       /* Since server end closes\r
+                        * async socket creation needs to be done again\r
+                        */\r
                        goto ErrorExit;\r
+               } else if (retval < 0 || retval < sizeof(drm_client_cb_data_s)) {\r
+                       DRM_CLIENT_EXCEPTION(\r
+                                       " Async call_back read error!!, retval = %d, error = %s",\r
+                                       retval, strerror(errno));\r
                }\r
-               DRM_CLIENT_LOG("Calling application  call back function from client");\r
-\r
-               /* Search the client cb info from the received client_id and call corresponding handler */\r
-               __search_client_info_cb(&callinfo);\r
-       }\r
-       ErrorExit:\r
-       if(-1 != async_sockfd)\r
-               close(async_sockfd);\r
-       return NULL;\r
+\r
+               DRM_CLIENT_LOG(\r
+                               "Calling application  call back function from client, retval = %d",\r
+                               retval);\r
+               /* Search the client cb info from the received client_id and call corresponding handler */\r
+               __search_client_info_cb(&callinfo);\r
+       }\r
+\r
+ErrorExit:\r
+       pthread_mutex_lock(&async_mutex);\r
+       if (-1 != async_sockfd)\r
+               close(async_sockfd);\r
+       async_sockfd = -1;\r
+       pthread_mutex_unlock(&async_mutex);\r
+       return NULL;\r
 }\r
 \r
 \r