diff options
author | Minje Ahn <minje.ahn@samsung.com> | 2015-06-10 20:47:13 +0900 |
---|---|---|
committer | Minje Ahn <minje.ahn@samsung.com> | 2015-06-10 20:47:13 +0900 |
commit | cbb11bf8d28059cdf57cea64a04150a740cbcf91 (patch) | |
tree | 123d6e47b7682e8497e104f383feccc93218c16f /src | |
parent | 9d333c7852195d9d4cb75e681b6e4d0be686dbe5 (diff) | |
download | libmedia-thumbnail-cbb11bf8d28059cdf57cea64a04150a740cbcf91.tar.gz libmedia-thumbnail-cbb11bf8d28059cdf57cea64a04150a740cbcf91.tar.bz2 libmedia-thumbnail-cbb11bf8d28059cdf57cea64a04150a740cbcf91.zip |
Remove drm source code.submit/tizen/20150611.100714submit/tizen/20150611.073620submit/tizen/20150611.002358
Change-Id: I404d21bdeb3f23786c9b30303ede8edac4b24149
Signed-off-by: Minje Ahn <minje.ahn@samsung.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/codec/img-codec-osal.c | 16 | ||||
-rwxr-xr-x | src/media-thumb-internal.c | 34 | ||||
-rwxr-xr-x | src/util/media-thumb-util.c | 89 |
3 files changed, 29 insertions, 110 deletions
diff --git a/src/codec/img-codec-osal.c b/src/codec/img-codec-osal.c index 88123bb..cefe59f 100644 --- a/src/codec/img-codec-osal.c +++ b/src/codec/img-codec-osal.c @@ -25,7 +25,6 @@ #include <stdlib.h> #include <string.h> #include <errno.h> -#include <drm_client.h> void *IfegMemAlloc(unsigned int size) { @@ -64,20 +63,7 @@ static BOOL _is_real_drm = FALSE; HFile DrmOpenFile(const char *szPathName) { - 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; - } + _is_real_drm = FALSE; if (!_is_real_drm) { FILE *fp = fopen(szPathName, "rb"); diff --git a/src/media-thumb-internal.c b/src/media-thumb-internal.c index 12e36f2..f7b764f 100755 --- a/src/media-thumb-internal.c +++ b/src/media-thumb-internal.c @@ -36,7 +36,6 @@ #include <fcntl.h> #include <unistd.h> -#include <drm_client.h> #include <mm_file.h> #include <mm_error.h> #include <mm_util_imgp.h> @@ -59,28 +58,6 @@ int _media_thumb_get_proper_thumb_size(media_thumb_type thumb_type, portrait = TRUE; } -#if 0 - /* Set Lager length to default size */ - if (portrait) { - if (orig_h < _media_thumb_get_width(thumb_type)) { - *thumb_h = orig_h; - } else { - *thumb_h = _media_thumb_get_width(thumb_type); - } - - ratio = (double)orig_w / (double)orig_h; - *thumb_w = *thumb_h * ratio; - } else { - if (orig_w < _media_thumb_get_width(thumb_type)) { - *thumb_w = orig_w; - } else { - *thumb_w = _media_thumb_get_width(thumb_type); - } - - ratio = (double)orig_h / (double)orig_w; - *thumb_h = *thumb_w * ratio; - } -#else /* Set smaller length to default size */ if (portrait) { if (orig_w < _media_thumb_get_width(thumb_type)) { @@ -103,7 +80,6 @@ int _media_thumb_get_proper_thumb_size(media_thumb_type thumb_type, ratio = (double)orig_w / (double)orig_h; *thumb_w = *thumb_h * ratio; } -#endif /* The width of RGB888 raw data has to be rounded by 4 */ *thumb_w = MEDA_THUMB_ROUND_UP_4(*thumb_w); @@ -130,7 +106,7 @@ int _media_thumb_get_exif_info(ExifData *ed, char *buf, int max_size, int *value entry = exif_content_get_entry(ed->ifd[ifd], tag); if (entry) { if (tag == EXIF_TAG_ORIENTATION || - tag == EXIF_TAG_PIXEL_X_DIMENSION || + tag == EXIF_TAG_PIXEL_X_DIMENSION || tag == EXIF_TAG_PIXEL_Y_DIMENSION) { if (value == NULL) { @@ -1003,13 +979,7 @@ int _media_thumb_video(const char *origin_path, int height = 0; int ret = 0; GdkPixbuf *pixbuf; - drm_bool_type_e drm_type; - - ret = (drm_is_drm_file(origin_path, &drm_type) == 1); - if (ret != MS_MEDIA_ERR_NONE) { - thumb_err("drm_is_drm_file falied : %d", ret); - drm_type = DRM_FALSE; - } + bool drm_type = FALSE; is_drm = drm_type; err = mm_file_create_content_attrs(&content, origin_path); diff --git a/src/util/media-thumb-util.c b/src/util/media-thumb-util.c index a6c4fb4..5d98222 100755 --- a/src/util/media-thumb-util.c +++ b/src/util/media-thumb-util.c @@ -26,7 +26,6 @@ #include <glib.h> #include <aul.h> #include <string.h> -#include <drm_client.h> #include <sys/stat.h> #include <grp.h> #include <pwd.h> @@ -79,79 +78,43 @@ int _media_thumb_get_file_type(const char *file_full_path) { int ret = 0; - drm_bool_type_e drm_type; - drm_file_type_e drm_file_type; - char mimetype[255]; + char mimetype[255] = {0,}; if (file_full_path == NULL) return MS_MEDIA_ERR_INVALID_PARAMETER; - ret = drm_is_drm_file(file_full_path, &drm_type); + /* get content type and mime type from file. */ + ret = aul_get_mime_from_file(file_full_path, mimetype, sizeof(mimetype)); if (ret < 0) { - thumb_err("drm_is_drm_file falied : %d", ret); - drm_type = DRM_FALSE; - } - - if (drm_type == DRM_TRUE) { - thumb_dbg("DRM file : %s", file_full_path); + thumb_warn + ("aul_get_mime_from_file fail.. Now trying to get type by extension"); - ret = drm_get_file_type(file_full_path, &drm_file_type); + char ext[255] = { 0 }; + int ret = _media_thumb_get_file_ext(file_full_path, ext, sizeof(ext)); if (ret < 0) { - thumb_err("drm_get_file_type falied : %d", ret); + thumb_err("_media_thumb_get_file_ext failed"); return THUMB_NONE_TYPE; } - if (drm_file_type == DRM_TYPE_UNDEFINED) { - return THUMB_NONE_TYPE; + if (strcasecmp(ext, "JPG") == 0 || + strcasecmp(ext, "JPEG") == 0 || + strcasecmp(ext, "PNG") == 0 || + strcasecmp(ext, "GIF") == 0 || + strcasecmp(ext, "AGIF") == 0 || + strcasecmp(ext, "XWD") == 0 || + strcasecmp(ext, "BMP") == 0 || + strcasecmp(ext, "WBMP") == 0) { + return THUMB_IMAGE_TYPE; + } else if (strcasecmp(ext, "AVI") == 0 || + strcasecmp(ext, "MPEG") == 0 || + strcasecmp(ext, "MP4") == 0 || + strcasecmp(ext, "DCF") == 0 || + strcasecmp(ext, "WMV") == 0 || + strcasecmp(ext, "3GPP") == 0 || + strcasecmp(ext, "3GP") == 0) { + return THUMB_VIDEO_TYPE; } else { - drm_content_info_s contentInfo; - memset(&contentInfo, 0x00, sizeof(drm_content_info_s)); - - ret = drm_get_content_info(file_full_path, &contentInfo); - if (ret != DRM_RETURN_SUCCESS) { - thumb_err("drm_get_content_info() fails. : %d", ret); - return THUMB_NONE_TYPE; - } - thumb_dbg("DRM mime type: %s", contentInfo.mime_type); - - strncpy(mimetype, contentInfo.mime_type, sizeof(mimetype) - 1); - mimetype[sizeof(mimetype) - 1] = '\0'; - } - } else { - /* get content type and mime type from file. */ - ret = - aul_get_mime_from_file(file_full_path, mimetype, sizeof(mimetype)); - if (ret < 0) { - thumb_warn - ("aul_get_mime_from_file fail.. Now trying to get type by extension"); - - char ext[255] = { 0 }; - int ret = _media_thumb_get_file_ext(file_full_path, ext, sizeof(ext)); - if (ret < 0) { - thumb_err("_media_thumb_get_file_ext failed"); - return THUMB_NONE_TYPE; - } - - if (strcasecmp(ext, "JPG") == 0 || - strcasecmp(ext, "JPEG") == 0 || - strcasecmp(ext, "PNG") == 0 || - strcasecmp(ext, "GIF") == 0 || - strcasecmp(ext, "AGIF") == 0 || - strcasecmp(ext, "XWD") == 0 || - strcasecmp(ext, "BMP") == 0 || - strcasecmp(ext, "WBMP") == 0) { - return THUMB_IMAGE_TYPE; - } else if (strcasecmp(ext, "AVI") == 0 || - strcasecmp(ext, "MPEG") == 0 || - strcasecmp(ext, "MP4") == 0 || - strcasecmp(ext, "DCF") == 0 || - strcasecmp(ext, "WMV") == 0 || - strcasecmp(ext, "3GPP") == 0 || - strcasecmp(ext, "3GP") == 0) { - return THUMB_VIDEO_TYPE; - } else { - return THUMB_NONE_TYPE; - } + return THUMB_NONE_TYPE; } } |