2 * Copyright 2012 Samsung Electronics Co., Ltd
4 * Licensed under the Flora License, Version 1.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.tizenopensource.org/license
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
19 #include "gallery-efl.h"
20 #include "ge-ui-util.h"
24 int ge_drm_get_permtype(int gitem_type)
27 case MEDIA_CONTENT_TYPE_IMAGE:
28 return DRM_PERMISSION_TYPE_DISPLAY;
29 case MEDIA_CONTENT_TYPE_VIDEO:
30 return DRM_PERMISSION_TYPE_PLAY;
36 Eina_Bool ge_drm_check_valid_ro(const char *file_path,
37 drm_permission_type_e permType)
39 GE_CHECK_FALSE(file_path);
40 ge_dbg("file_path: %s", file_path);
43 drm_license_status_e license_status = DRM_LICENSE_STATUS_UNDEFINED;
44 ret = drm_get_license_status(file_path, permType, &license_status);
45 if (DRM_RETURN_SUCCESS == ret &&
46 DRM_LICENSE_STATUS_VALID == license_status) {
49 ge_dbg("No valid ro, return %d", license_status);
54 Eina_Bool ge_drm_is_drm_file(const char* file_path)
56 GE_CHECK_FALSE(file_path);
57 ge_dbg("file_path: %s.", file_path);
59 drm_bool_type_e is_drm_file = DRM_UNKNOWN;
60 if(drm_is_drm_file(file_path, &is_drm_file) != DRM_RETURN_SUCCESS) {
61 ge_dbgE("drm_is_drm_file error");
65 if (DRM_TRUE == is_drm_file)
70 char* ge_drm_get_file_path(void *item)
72 ge_item* gitem = (ge_item *)item;
74 if(!gitem || !gitem->item || !gitem->item->file_url)
76 ge_dbg("filepath: %s", gitem->item->file_url);
78 if(ge_drm_is_drm_file(gitem->item->file_url))
79 return strdup(GE_DEFAULT_THUMB_ICON);
81 return strdup(gitem->item->file_url);