Removing drm-trusted feature in MMS viewer
authorSoonmin Jung <sm0415.jung@samsung.com>
Thu, 23 Aug 2012 08:23:51 +0000 (17:23 +0900)
committerSoonmin Jung <sm0415.jung@samsung.com>
Thu, 23 Aug 2012 08:23:51 +0000 (17:23 +0900)
common/CMakeLists.txt
debian/control
packaging/org.tizen.message.spec
viewer/include/msg-ui-viewer-drm-utility.h
viewer/smil-player/include/msg-smil-render.h
viewer/smil-player/src/msg-smil-media-render.c
viewer/smil-player/src/msg-smil-render.c
viewer/src/msg-ui-viewer-drm-utility.c

index 3ddad7d..3d0c8dd 100755 (executable)
@@ -19,7 +19,7 @@ pkg_check_modules(pkgs REQUIRED
        appsvc
        bundle
        capi-appfw-application contacts-service
-       dlog drm-client drm-trusted devman_haptic
+       dlog drm-client devman_haptic
        elementary ecore ecore-x ecore-input ecore-imf ecore-file eina
        glib-2.0
        heynoti
index 0fae198..20b2c4a 100755 (executable)
@@ -2,7 +2,7 @@ Source: message
 Section: devel
 Priority: optional
 Maintainer: Jaeyun Jeong <jyjeong@samsung.com>, Sangkoo Kim <sangkoo.kim@samsung.com>, Seunghwan Lee <sh.cat.lee@samsung.com>, SoonMin Jung <sm0415.jung@samsung.com>, Jae-Young Lee <jy4710.lee@samsung.com>
-Build-Depends: debhelper (>= 5), libglib2.0-dev, libelm-dev, libecore-dev, libeina-dev, libappcore-common-dev, libappcore-efl-dev,  libslp-msg-service-dev, libslp-setting-dev, libslp-utilx-dev, dlog-dev, libui-gadget-dev, libcontacts-service-dev, libaul-1-dev, libug-contacts-dev, drm-client-dev, drm-trusted-dev, libicu-dev, libmm-common-dev,  libmm-player-dev, libmm-utility-dev,  libmm-session-dev, libmm-fileinfo-dev, libmm-player-internal-dev, libappsvc-dev,  libdevman-haptic-dev, libheynoti-dev, capi-appfw-application-dev, syspopup-caller-dev
+Build-Depends: debhelper (>= 5), libglib2.0-dev, libelm-dev, libecore-dev, libeina-dev, libappcore-common-dev, libappcore-efl-dev,  libslp-msg-service-dev, libslp-setting-dev, libslp-utilx-dev, dlog-dev, libui-gadget-dev, libcontacts-service-dev, libaul-1-dev, libug-contacts-dev, drm-client-dev, libicu-dev, libmm-common-dev,  libmm-player-dev, libmm-utility-dev,  libmm-session-dev, libmm-fileinfo-dev, libmm-player-internal-dev, libappsvc-dev,  libdevman-haptic-dev, libheynoti-dev, capi-appfw-application-dev, syspopup-caller-dev
 Standards-Version: 3.7.2
 Homepage:
 
index 3acb335..4a04376 100755 (executable)
@@ -13,7 +13,6 @@ BuildRequires:  pkgconfig(capi-appfw-application)
 BuildRequires:  pkgconfig(contacts-service)
 BuildRequires:  pkgconfig(dlog)
 BuildRequires:  pkgconfig(drm-client)
-BuildRequires:  pkgconfig(drm-trusted)
 BuildRequires:  pkgconfig(devman_haptic)
 BuildRequires:  pkgconfig(elementary)
 BuildRequires:  pkgconfig(ecore)
index eed71be..1b53e38 100755 (executable)
@@ -21,7 +21,6 @@
  *                                                                     INCLUDE HEADERS
  *==================================================================================================*/
 #include "msg-ui-viewer-types.h"
-#include <drm_trusted_client.h>
 #include <drm_client.h>
 
 /*==================================================================================================
@@ -40,13 +39,6 @@ typedef enum {
 } MSG_UI_DRM_RIGHT_TYPE_E;
 
 /*==================================================================================================
- *                                                                             STRUCTURES
- *==================================================================================================*/
-typedef struct {
-       DRM_DECRYPT_HANDLE consume_handle;
-} MSG_UI_DRM_CONSUME_S;
-
-/*==================================================================================================
  *                                                                     FUNCTION DECLARATIONS
  *==================================================================================================*/
 MSG_BOOL msg_ui_viewer_is_drm_file(const char *filepath);
@@ -77,51 +69,4 @@ MSG_BOOL msg_ui_viewer_check_drm_ro_valid(const char *filepath, MSG_UI_DRM_RIGHT
  * @return     return TRUE if caller get url address well, else FALSE
  */
 MSG_BOOL msg_ui_viewer_get_drm_url(const char *filepath, char *szurl, int szurl_len);
-
-/*
- *@fn          msg_ui_viewer_consume_ro_start(const char *filepath, MSG_UI_DRM_RIGHT_TYPE_E permission_type, MSG_UI_DRM_CONSUME_S *consume_t);
- *@brief               This function is used to start to consume ro
- * @param[in] filepath filepath
- * @param[in] permission_type permission type to be shown/played
- * @param[out] consume_t consume handle will be set
- * @return     return TRUE if consume routine is started well, else FALSE
- */
-MSG_BOOL msg_ui_viewer_consume_ro_start(const char *filepath, MSG_UI_DRM_RIGHT_TYPE_E permission_type, MSG_UI_DRM_CONSUME_S *consume_t);
-
-/*
- *@fn          msg_ui_viewer_consume_ro_pause(MSG_UI_DRM_CONSUME_S *consume_t);
- *@brief               This function is used to pause consume ro, this is used for DRM 2.0(accumulated type)
- * @param[in] consume_t consume handle
- * @return     return TRUE if consume routine is puased well, else FALSE
- */
-MSG_BOOL msg_ui_viewer_consume_ro_pause(MSG_UI_DRM_CONSUME_S *consume_t);
-
-/*
- *@fn          msg_ui_viewer_consume_ro_resume(MSG_UI_DRM_CONSUME_S *consume_t);
- *@brief               This function is used to resume consume ro, this is used for DRM 2.0(accumulated type)
- * @param[in] consume_t consume handle
- * @return     return TRUE if consume routine is resumed well, else FALSE
- */
-MSG_BOOL msg_ui_viewer_consume_ro_resume(MSG_UI_DRM_CONSUME_S *consume_t);
-
-/*
- *@fn          msg_ui_viewer_consume_ro_stop(MSG_UI_DRM_CONSUME_S *consume_t);
- *@brief               This function is used to stop and close consume ro
- * @param[in] consume_t consume handle
- * @return     return TRUE if consume routine is stopped and closed well, else FALSE
- */
-MSG_BOOL msg_ui_viewer_consume_ro_stop(MSG_UI_DRM_CONSUME_S *consume_t);
-
-/*
- *@fn          msg_ui_viewer_get_buffer_from_drm_file(const char *filepath, MSG_UI_DRM_RIGHT_TYPE_E permission_type, unsigned int *buffer_size)
- *@brief               This function is used to get raw data from drm file
- *@param[in] filepath filepath of drm file
- *@param[in] permission_type permission type to be shown/played
- *@param[out] buffer_size buffer size of raw data
- *@return      return allocated raw data pointer of drm file, else NULL.
- *@Caution     Caller should free return pointer after using data.
- */
-unsigned char *msg_ui_viewer_get_buffer_from_drm_file(const char *filepath, MSG_UI_DRM_RIGHT_TYPE_E permission_type, unsigned int *buffer_size);
-
 #endif
-
index 4dd88c9..2581e83 100755 (executable)
@@ -129,9 +129,6 @@ typedef struct _SMIL_RENDERER_DATA_S {
        VIEWER_COLORREF bgcolor;
        MSG_BOOL        ismute; /*sound, video mute mode when silent mode*/
 
-       MSG_UI_DRM_CONSUME_S    display_drm_consume;    /*drm consume handle for image*/
-       MSG_UI_DRM_CONSUME_S    play_drm_consume;       /*drm consume handle for sound, video*/
-
        char *working_path;
 } SMIL_RENDERER_DATA_S;
 
index 2855d96..79d66ee 100755 (executable)
@@ -397,12 +397,6 @@ MSG_BOOL _msg_smil_render_pause(void *data, int mediaType)
        MSG_UI_RETV_IF(MSG_UI_LEVEL_ERR, data == NULL, FALSE);
        SMIL_RENDERER_DATA_S *viewerRenderData = (SMIL_RENDERER_DATA_S *)data;
 
-       if (viewerRenderData->display_drm_consume.consume_handle)
-               msg_ui_viewer_consume_ro_pause(&viewerRenderData->display_drm_consume);
-
-       if (viewerRenderData->play_drm_consume.consume_handle)
-               msg_ui_viewer_consume_ro_pause(&viewerRenderData->play_drm_consume);
-
        if (viewerRenderData->video_update_timer)
                ecore_timer_freeze(viewerRenderData->video_update_timer);
 
@@ -429,12 +423,6 @@ MSG_BOOL _msg_smil_render_resume(void *data, int mediaType)
        MSG_UI_RETV_IF(MSG_UI_LEVEL_ERR, data == NULL, FALSE);
        SMIL_RENDERER_DATA_S *viewerRenderData = (SMIL_RENDERER_DATA_S *)data;
 
-       if (viewerRenderData->display_drm_consume.consume_handle)
-               msg_ui_viewer_consume_ro_resume(&viewerRenderData->display_drm_consume);
-
-       if (viewerRenderData->play_drm_consume.consume_handle)
-               msg_ui_viewer_consume_ro_resume(&viewerRenderData->play_drm_consume);
-
        if (viewerRenderData->video_update_timer)
                ecore_timer_thaw(viewerRenderData->video_update_timer);
 
@@ -462,16 +450,6 @@ MSG_BOOL _msg_smil_render_stop_playing_file(void *data)
        MSG_UI_RETV_IF(MSG_UI_LEVEL_ERR, data == NULL, FALSE);
        SMIL_RENDERER_DATA_S *viewerRenderData = (SMIL_RENDERER_DATA_S *)data;
 
-       if (viewerRenderData->display_drm_consume.consume_handle) {
-               msg_ui_viewer_consume_ro_stop(&viewerRenderData->display_drm_consume);
-               viewerRenderData->display_drm_consume.consume_handle = NULL;
-       }
-
-       if (viewerRenderData->play_drm_consume.consume_handle) {
-               msg_ui_viewer_consume_ro_stop(&viewerRenderData->play_drm_consume);
-               viewerRenderData->play_drm_consume.consume_handle = NULL;
-       }
-
        if (viewerRenderData->video_update_timer) {
                ecore_timer_del(viewerRenderData->video_update_timer);
                viewerRenderData->video_update_timer = NULL;
@@ -819,12 +797,6 @@ MSG_BOOL _msg_smil_render_show_inserted_audio(SMIL_RENDERER_DATA_S *viewerRender
 
        if (msg_ui_viewer_is_drm_file(path)) {
                if (msg_ui_viewer_check_drm_ro_valid(path, MSG_UI_DRM_RIGHT_PLAY)) {
-                       /*consume ro and play content*/
-                       if (viewerRenderData->play_drm_consume.consume_handle) {
-                               msg_ui_viewer_consume_ro_stop(&viewerRenderData->play_drm_consume);
-                               viewerRenderData->play_drm_consume.consume_handle = NULL;
-                       }
-
                        //copy drm file temporarily, because drm file is created by MF with read right and drm_svc try to open file with append mode.
                        char dst_path[MSG_VIEWER_FILEPATH_MAX_LEN + 1]= {0,};
                        const char *filename = (const char *)ecore_file_file_get(path);
@@ -849,8 +821,6 @@ MSG_BOOL _msg_smil_render_show_inserted_audio(SMIL_RENDERER_DATA_S *viewerRender
                                return FALSE;
                        }
 
-                       msg_ui_viewer_consume_ro_start(path, MSG_UI_DRM_RIGHT_PLAY, &viewerRenderData->play_drm_consume);
-
                        if (app_drm_path) {
                                g_free(app_drm_path);
                                app_drm_path = NULL;
@@ -1150,12 +1120,6 @@ MSG_BOOL _msg_smil_render_show_inserted_video(SMIL_RENDERER_DATA_S *viewerRender
 
        if (msg_ui_viewer_is_drm_file(path)) {
                if (msg_ui_viewer_check_drm_ro_valid(path, MSG_UI_DRM_RIGHT_PLAY)) {
-                       /*consume ro and play content*/
-                       if (viewerRenderData->play_drm_consume.consume_handle) {
-                               msg_ui_viewer_consume_ro_stop(&viewerRenderData->play_drm_consume);
-                               viewerRenderData->play_drm_consume.consume_handle = NULL;
-                       }
-
                        //copy drm file temporarily, because drm file is created by MF with read right and drm_svc try to open file with append property.
                        char dst_path[MSG_VIEWER_FILEPATH_MAX_LEN + 1]= {0,};
                        const char *filename = (const char *)ecore_file_file_get(path);
@@ -1180,8 +1144,6 @@ MSG_BOOL _msg_smil_render_show_inserted_video(SMIL_RENDERER_DATA_S *viewerRender
                                return FALSE;
                        }
 
-                       msg_ui_viewer_consume_ro_start(path, MSG_UI_DRM_RIGHT_PLAY, &viewerRenderData->play_drm_consume);
-
                        if (app_drm_path) {
                                g_free(app_drm_path);
                                app_drm_path = NULL;
@@ -1243,26 +1205,10 @@ static void __msg_smil_render_show_image_file(SMIL_RENDERER_DATA_S *viewerRender
        /*create icon above image_layout*/
        ic = elm_icon_add(image_layout);
 
-       if (imageType == VIEWER_IMAGE_TYPE_DRM_IMAGE_RAW_DATA) {        // rendering drm image by raw data
-               unsigned char *drm_raw_data = NULL;
-               unsigned int buf_size = 0;
-
-               drm_raw_data = msg_ui_viewer_get_buffer_from_drm_file(path, MSG_UI_DRM_RIGHT_DISPLAY, &buf_size);
-               if (drm_raw_data) {
-                       MSG_UI_DEBUG(MSG_UI_LEVEL_DEBUG, "buf_size = %d", buf_size);
-                       MSG_UI_DEBUG(MSG_UI_LEVEL_DEBUG, "image buf size = %d", (contnet_w * contnet_h * 4));
-
-                       Eina_Bool result = elm_icon_memfile_set(ic, drm_raw_data, buf_size, NULL, NULL);
-                       MSG_UI_DEBUG(MSG_UI_LEVEL_DEBUG, "result = %d", result);
-
-                       free(drm_raw_data);
-               } else {
-                       MSG_UI_DEBUG(MSG_UI_LEVEL_ERR, "drm_raw_data is NULL");
-                       elm_icon_file_set(ic, MSG_VIEWER_IMAGE_DRM_ICON, NULL);
-               }
-       } else {
+       if (imageType == VIEWER_IMAGE_TYPE_DRM_IMAGE_RAW_DATA)  // rendering drm image by raw data
+               elm_icon_file_set(ic, MSG_VIEWER_IMAGE_DRM_ICON, NULL);
+       else
                elm_icon_file_set(ic, path, NULL);
-       }
 
        MSG_UI_RETM_IF(MSG_UI_LEVEL_DEBUG, ic == NULL, "attached image add failed");
 
@@ -1361,12 +1307,6 @@ MSG_BOOL _msg_smil_render_show_inserted_image(SMIL_RENDERER_DATA_S *viewerRender
        if (access(path, R_OK) == 0) {
                if (msg_ui_viewer_is_drm_file(path)) {
                        if (msg_ui_viewer_check_drm_ro_valid(path, MSG_UI_DRM_RIGHT_DISPLAY)) {
-                               /*consume ro and display content*/
-                               if (viewerRenderData->display_drm_consume.consume_handle) {
-                                       msg_ui_viewer_consume_ro_stop(&viewerRenderData->display_drm_consume);
-                                       viewerRenderData->display_drm_consume.consume_handle = NULL;
-                               }
-
                                //copy drm file temporarily, because drm file is created by MF with read right and drm_svc try to open file with append property.
                                char dst_path[MSG_VIEWER_FILEPATH_MAX_LEN + 1]= {0,};
                                const char *filename = (const char *)ecore_file_file_get(path);
@@ -1379,14 +1319,12 @@ MSG_BOOL _msg_smil_render_show_inserted_image(SMIL_RENDERER_DATA_S *viewerRender
                                //copy drm content to app path end
 
                                /*display original image*/
-                               __msg_smil_render_show_image_file(viewerRenderData, app_drm_path, VIEWER_IMAGE_TYPE_DRM_IMAGE_RAW_DATA);
-
-                               msg_ui_viewer_consume_ro_start(path, MSG_UI_DRM_RIGHT_DISPLAY, &viewerRenderData->display_drm_consume);
+                               __msg_smil_render_show_image_file(viewerRenderData, app_drm_path, VIEWER_IMAGE_TYPE_DRM_IMAGE_RAW_DATA);
 
-                               if (app_drm_path) {
-                                       free(app_drm_path);
-                                       app_drm_path = NULL;
-                               }
+                               if (app_drm_path) {
+                                       free(app_drm_path);
+                                       app_drm_path = NULL;
+                               }
                        } else {
                                /*there is no valid ro case*/
                                /*display drm icon*/
index d0e558f..1a2db3a 100755 (executable)
@@ -140,8 +140,6 @@ MSG_BOOL _msg_smil_init_render(SMIL_RENDERER_DATA_S *viewerRenderData)
        viewerRenderData->video_eos_idle = NULL;
        viewerRenderData->bgcolor = 0;
        viewerRenderData->ismute = FALSE;
-       viewerRenderData->display_drm_consume.consume_handle = NULL;
-       viewerRenderData->play_drm_consume.consume_handle = NULL;
        viewerRenderData->insert_sound_icon = NULL;
        viewerRenderData->insert_unsupported_icon = NULL;
        viewerRenderData->main_window = ug_get_window();
index 0f79a11..32989ed 100755 (executable)
@@ -160,233 +160,3 @@ static drm_permission_type_e __get_permission_type(MSG_UI_DRM_RIGHT_TYPE_E permi
 
        return drm_permission_type;
 }
-
-MSG_BOOL msg_ui_viewer_consume_ro_start(const char *filepath, MSG_UI_DRM_RIGHT_TYPE_E permission_type, MSG_UI_DRM_CONSUME_S *consume_t)
-{
-       MSG_UI_ENTER(MSG_UI_LEVEL_DEBUG);
-       MSG_UI_RETV_IF(MSG_UI_LEVEL_ERR, filepath == NULL, FALSE);
-       MSG_UI_RETV_IF(MSG_UI_LEVEL_ERR, consume_t == NULL, FALSE);
-
-       MSG_UI_DEBUG(MSG_UI_LEVEL_DEBUG, "permission_type is %d", permission_type);
-
-       drm_permission_type_e permission = DRM_PERMISSION_TYPE_ANY;
-       DRM_DECRYPT_HANDLE pHandle = NULL;
-       int ret = DRM_TRUSTED_RETURN_SUCCESS;
-
-       permission = __get_permission_type(permission_type);
-
-       /* Open Decrypt Session*/
-       drm_trusted_open_decrypt_info_s open_input_data;
-       drm_trusted_open_decrypt_resp_data_s open_output_data;
-
-       strncpy(open_input_data.filePath, filepath, sizeof(open_input_data.filePath)-1);
-       open_input_data.file_type = DRM_TRUSTED_TYPE_OMA_V1;
-       open_input_data.permission = permission;
-
-       ret = drm_trusted_open_decrypt_session(&open_input_data, &open_output_data, &pHandle);
-       if (ret != DRM_TRUSTED_RETURN_SUCCESS) {
-               MSG_UI_DEBUG(MSG_UI_LEVEL_ERR, "drm_trusted_open_decrypt_session is failed ret = %d", ret);
-               return FALSE;
-       }
-       consume_t->consume_handle = pHandle;
-
-       /*Start the consumption*/
-       drm_trusted_set_consumption_state_info_s state_input_data;
-       state_input_data.state = DRM_CONSUMPTION_STARTED;
-
-       ret = drm_trusted_set_decrypt_state(consume_t->consume_handle, &state_input_data);
-       if (ret != DRM_TRUSTED_RETURN_SUCCESS) {
-               MSG_UI_DEBUG(MSG_UI_LEVEL_ERR, "DRM_CONSUMPTION_STARTED is failed ret = %d", ret);
-               return FALSE;
-       }
-
-       return TRUE;
-}
-
-MSG_BOOL msg_ui_viewer_consume_ro_pause(MSG_UI_DRM_CONSUME_S *consume_t)
-{
-       MSG_UI_ENTER(MSG_UI_LEVEL_DEBUG);
-       MSG_UI_RETV_IF(MSG_UI_LEVEL_ERR, consume_t == NULL, FALSE);
-       MSG_UI_RETV_IF(MSG_UI_LEVEL_ERR, consume_t->consume_handle == NULL, FALSE);
-
-       int ret = DRM_TRUSTED_RETURN_SUCCESS;
-
-       /* Pause the consumption*/
-       drm_trusted_set_consumption_state_info_s state_input_data;
-       state_input_data.state = DRM_CONSUMPTION_PAUSED;
-
-       ret = drm_trusted_set_decrypt_state(consume_t->consume_handle, &state_input_data);
-       if (ret != DRM_TRUSTED_RETURN_SUCCESS) {
-               MSG_UI_DEBUG(MSG_UI_LEVEL_ERR, "DRM_CONSUMPTION_PAUSED is failed ret = %d", ret);
-               return FALSE;
-       }
-
-       return TRUE;
-}
-
-MSG_BOOL msg_ui_viewer_consume_ro_resume(MSG_UI_DRM_CONSUME_S *consume_t)
-{
-       MSG_UI_ENTER(MSG_UI_LEVEL_DEBUG);
-       MSG_UI_RETV_IF(MSG_UI_LEVEL_ERR, consume_t == NULL, FALSE);
-       MSG_UI_RETV_IF(MSG_UI_LEVEL_ERR, consume_t->consume_handle == NULL, FALSE);
-
-       int ret = DRM_TRUSTED_RETURN_SUCCESS;
-
-       /*Resume the consumption*/
-       drm_trusted_set_consumption_state_info_s state_input_data;
-       state_input_data.state = DRM_CONSUMPTION_RESUMED;
-
-       ret = drm_trusted_set_decrypt_state(consume_t->consume_handle, &state_input_data);
-       if (ret != DRM_TRUSTED_RETURN_SUCCESS) {
-               MSG_UI_DEBUG(MSG_UI_LEVEL_ERR, "DRM_CONSUMPTION_RESUMED is failed ret = %d", ret);
-               return FALSE;
-       }
-
-       return TRUE;
-}
-
-MSG_BOOL msg_ui_viewer_consume_ro_stop(MSG_UI_DRM_CONSUME_S *consume_t)
-{
-       MSG_UI_ENTER(MSG_UI_LEVEL_DEBUG);
-       MSG_UI_RETV_IF(MSG_UI_LEVEL_ERR, consume_t == NULL, FALSE);
-       MSG_UI_RETV_IF(MSG_UI_LEVEL_ERR, consume_t->consume_handle == NULL, FALSE);
-
-       int ret = DRM_TRUSTED_RETURN_SUCCESS;
-
-       /*stop the consumption*/
-       drm_trusted_set_consumption_state_info_s state_input_data;
-       state_input_data.state = DRM_CONSUMPTION_STOPPED;
-
-       ret = drm_trusted_set_decrypt_state(consume_t->consume_handle, &state_input_data);
-       if (ret != DRM_TRUSTED_RETURN_SUCCESS) {
-               MSG_UI_DEBUG(MSG_UI_LEVEL_ERR, "DRM_CONSUMPTION_STOPPED is failed ret = %d", ret);
-               return FALSE;
-       }
-
-       /*close the consumption*/
-       ret = drm_trusted_close_decrypt_session(&(consume_t->consume_handle));
-       if (ret != DRM_TRUSTED_RETURN_SUCCESS) {
-               MSG_UI_DEBUG(MSG_UI_LEVEL_ERR, "drm_trusted_close_decrypt_session is failed ret = %d", ret);
-               return FALSE;
-       }
-
-       return TRUE;
-}
-
-unsigned char *msg_ui_viewer_get_buffer_from_drm_file(const char *filepath, MSG_UI_DRM_RIGHT_TYPE_E permission_type, unsigned int *buffer_size)
-{
-       MSG_UI_ENTER(MSG_UI_LEVEL_DEBUG);
-       MSG_UI_RETV_IF(MSG_UI_LEVEL_ERR, filepath == NULL, NULL);
-       MSG_UI_RETV_IF(MSG_UI_LEVEL_ERR, buffer_size == NULL, NULL);
-
-       *buffer_size = 0;
-
-       if (!__get_drm_license_status(filepath, permission_type)) {
-               MSG_UI_DEBUG(MSG_UI_LEVEL_ERR, "__get_drm_license_status is failed");
-               return NULL;
-       }
-
-       unsigned int size = 0;
-       drm_permission_type_e permission = __get_permission_type(permission_type);
-
-       /* Open Decrypt Session*/
-       drm_trusted_open_decrypt_info_s open_input_data;
-       drm_trusted_open_decrypt_resp_data_s open_output_data;
-       DRM_DECRYPT_HANDLE pHandle = NULL;
-       int ret = DRM_TRUSTED_RETURN_SUCCESS;
-       unsigned char *buffer = NULL;
-
-       memset(&open_input_data, 0x0, sizeof(drm_trusted_open_decrypt_info_s));
-       strncpy(open_input_data.filePath, filepath, sizeof(open_input_data.filePath)-1);
-       open_input_data.file_type = DRM_TRUSTED_TYPE_OMA_V1;
-       open_input_data.permission = permission;
-
-       ret = drm_trusted_open_decrypt_session(&open_input_data, &open_output_data, &pHandle);
-       if (ret != DRM_TRUSTED_RETURN_SUCCESS) {
-               MSG_UI_DEBUG(MSG_UI_LEVEL_ERR, "drm_trusted_open_decrypt_session is failed ret = %d", ret);
-               return NULL;
-       }
-
-       /* Seek Decrypt Session*/
-       drm_trusted_seek_decrypt_info_s seek_input_data;
-       seek_input_data.offset = 0;
-       seek_input_data.seek_mode = DRM_SEEK_END;
-
-       ret = drm_trusted_seek_decrypt_session(pHandle, &seek_input_data);
-       if (ret != DRM_TRUSTED_RETURN_SUCCESS) {
-               MSG_UI_DEBUG(MSG_UI_LEVEL_ERR, "drm_trusted_seek_decrypt_session is failed ret = %d", ret);
-               goto drm_error;
-       }
-
-       /* Tell Decrypt Session*/
-       drm_trusted_tell_decrypt_resp_data_s tell_output_data;
-
-       ret = drm_trusted_tell_decrypt_session(pHandle, &tell_output_data);
-       if (ret != DRM_TRUSTED_RETURN_SUCCESS) {
-               MSG_UI_DEBUG(MSG_UI_LEVEL_ERR, "drm_trusted_tell_decrypt_session is failed ret = %d", ret);
-               goto drm_error;
-       }
-
-       if (tell_output_data.offset == 0) {
-               MSG_UI_DEBUG(MSG_UI_LEVEL_ERR, "drm file size is 0");
-               goto drm_error;
-       }
-
-       size = tell_output_data.offset;
-
-       /* Seek Decrypt Session*/
-       seek_input_data.offset = 0;
-       seek_input_data.seek_mode = DRM_SEEK_SET;
-
-       ret = drm_trusted_seek_decrypt_session(pHandle, &seek_input_data);
-       if (ret != DRM_TRUSTED_RETURN_SUCCESS) {
-               MSG_UI_DEBUG(MSG_UI_LEVEL_ERR, "drm_trusted_seek_decrypt_session is failed ret = %d", ret);
-               goto drm_error;
-       }
-
-       buffer = (unsigned char *)malloc(size);
-       if (buffer == NULL) {
-               MSG_UI_DEBUG(MSG_UI_LEVEL_ERR, "malloc is failed");
-               goto drm_error;
-       }
-
-       /* Read Decrypt Session */
-       drm_trusted_payload_info_s read_input_data = {0,};
-       drm_trusted_read_decrypt_resp_data_s read_output_data = {0, };
-
-       read_input_data.media_offset = 0;
-       read_input_data.payload_data = buffer;
-       read_input_data.payload_data_len = size;
-
-       ret = drm_trusted_read_decrypt_session(pHandle, &read_input_data, &read_output_data);
-       if (ret != DRM_TRUSTED_RETURN_SUCCESS) {
-               MSG_UI_DEBUG(MSG_UI_LEVEL_ERR, "drm_trusted_read_decrypt_session is failed ret = %d", ret);
-               goto drm_error;
-       }
-
-       if (size != read_output_data.read_size)
-               MSG_UI_DEBUG(MSG_UI_LEVEL_ERR, "read is not perfect size = %d", size);
-
-       MSG_UI_DEBUG(MSG_UI_LEVEL_DEBUG, "read_size = %d", read_output_data.read_size);
-
-       *buffer_size = (unsigned int)size;
-
-       /* Close Decrypt Session */
-       ret = drm_trusted_close_decrypt_session(&pHandle);
-       if (ret != DRM_TRUSTED_RETURN_SUCCESS)
-               MSG_UI_DEBUG(MSG_UI_LEVEL_ERR, "drm_trusted_close_decrypt_session is failed ret = %d", ret);
-
-       return buffer;
-
-drm_error:
-       /* Close Decrypt Session */
-       ret = drm_trusted_close_decrypt_session(&pHandle);
-       if (ret != DRM_TRUSTED_RETURN_SUCCESS)
-               MSG_UI_DEBUG(MSG_UI_LEVEL_ERR, "drm_trusted_close_decrypt_session is failed ret = %d", ret);
-
-       if (buffer)
-               free(buffer);
-
-       return NULL;
-}
-