summaryrefslogtreecommitdiff
path: root/src/codec/img-codec-osal.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/codec/img-codec-osal.c')
-rw-r--r--src/codec/img-codec-osal.c36
1 files changed, 19 insertions, 17 deletions
diff --git a/src/codec/img-codec-osal.c b/src/codec/img-codec-osal.c
index c39d57c..8f10910 100644
--- a/src/codec/img-codec-osal.c
+++ b/src/codec/img-codec-osal.c
@@ -19,12 +19,14 @@
*
*/
+#include "media-thumb-debug.h"
#include "img-codec-osal.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <drm-service.h>
+//#include <drm-service.h>
+#include <drm_client.h>
void *IfegMemAlloc(unsigned int size)
{
@@ -59,12 +61,20 @@ int IfegMemcmp(const void *pMem1, const void *pMem2, size_t length)
return memcmp(pMem1, pMem2, length);
}
-DRM_FILE_HANDLE hDrmFile = NULL;
static BOOL _is_real_drm = FALSE;
HFile DrmOpenFile(const char *szPathName)
{
- if (drm_svc_is_drm_file(szPathName) == DRM_TRUE) {
+ int ret = 0;
+ drm_bool_type_e drm_type;
+
+ ret = drm_is_drm_file(szPathName, &drm_type);
+ if (ret < 0) {
+ thumb_err("drm_is_drm_file falied : %d", ret);
+ drm_type = DRM_FALSE;
+ }
+
+ if (drm_type == DRM_TRUE) {
_is_real_drm = TRUE;
} else {
_is_real_drm = FALSE;
@@ -75,19 +85,13 @@ HFile DrmOpenFile(const char *szPathName)
if (fp == NULL) {
return (HFile) INVALID_HOBJ;
+ thumb_err("file open error: %s", szPathName);
}
return fp;
} else {
- int ret =
- drm_svc_open_file(szPathName, DRM_PERMISSION_DISPLAY,
- &hDrmFile);
-
- if (ret != DRM_RESULT_SUCCESS) {
- return (HFile) INVALID_HOBJ;
- }
- return hDrmFile;
+ return (HFile) INVALID_HOBJ;
}
}
@@ -99,9 +103,7 @@ BOOL DrmReadFile(HFile hFile, void *pBuffer, ULONG bufLen, ULONG * pReadLen)
readCnt = fread(pBuffer, sizeof(char), bufLen, hFile);
*pReadLen = (ULONG) readCnt;
} else {
- drm_svc_read_file((DRM_FILE_HANDLE) hFile, pBuffer, bufLen,
- &readCnt);
- *pReadLen = (ULONG) readCnt;
+ return FALSE;
}
return TRUE;
}
@@ -111,7 +113,7 @@ long DrmTellFile(HFile hFile)
if (!_is_real_drm) {
return ftell(hFile);
} else {
- return drm_svc_tell_file((DRM_FILE_HANDLE) hFile);
+ return -1;
}
}
@@ -124,7 +126,7 @@ BOOL DrmSeekFile(HFile hFile, long position, long offset)
if (!_is_real_drm) {
fseek(hFile, offset, position);
} else {
- drm_svc_seek_file((DRM_FILE_HANDLE) hFile, offset, position);
+ return FALSE;
}
return TRUE;
@@ -152,7 +154,7 @@ BOOL DrmCloseFile(HFile hFile)
if (!_is_real_drm) {
fclose(hFile);
} else {
- drm_svc_close_file((DRM_FILE_HANDLE) hFile);
+ return FALSE;
}
return TRUE;