Moved the checker to libmedia-service.
Change-Id: I2a5fff6a9d8d7eaaa22c436907df3717f933c39c
Signed-off-by: Minje Ahn <minje.ahn@samsung.com>
ENDIF(TIZEN_PRODUCT_TV)
INCLUDE_DIRECTORIES(${INC_DIR})
-SET(dependents "dlog glib-2.0 libmedia-service libmedia-utils capi-base-common capi-system-info sqlite3")
+SET(dependents "dlog glib-2.0 libmedia-service libmedia-utils capi-base-common sqlite3")
SET(pc_dependents "capi-base-common")
INCLUDE(FindPkgConfig)
/**
*@internal
*/
-bool _media_util_check_support_media_type(const char *path);
int _media_util_check_file_exist(const char *path);
int _media_util_get_file_time(const char *path);
bool _media_util_is_ignorable_file(const char *path);
/**
*@internal
*/
-bool _media_util_check_support_media_type(const char *path);
int _media_util_check_file_exist(const char *path);
int _media_util_get_file_time(const char *path);
bool _media_util_is_ignorable_file(const char *path);
Name: capi-content-media-content
Summary: A Media content library in Tizen Native API
-Version: 0.6.4
+Version: 0.6.5
Release: 0
Group: Multimedia/API
License: Apache-2.0
BuildRequires: pkgconfig(dlog)
BuildRequires: pkgconfig(glib-2.0)
BuildRequires: pkgconfig(capi-base-common)
-BuildRequires: pkgconfig(capi-system-info)
BuildRequires: pkgconfig(libmedia-service)
BuildRequires: pkgconfig(libmedia-utils)
BuildRequires: pkgconfig(libtzplatform-config)
return MEDIA_CONTENT_ERROR_PERMISSION_DENIED;
case MS_MEDIA_ERR_THUMB_UNSUPPORTED:
return MEDIA_CONTENT_ERROR_UNSUPPORTED_CONTENT;
+ case MS_MEDIA_ERR_UNSUPPORTED_CONTENT:
+ return MEDIA_CONTENT_ERROR_NOT_SUPPORTED;
default:
return MEDIA_CONTENT_ERROR_INVALID_OPERATION;
}
folder_path = g_path_get_dirname(path);
content_retv_if(_media_util_is_ignorable_dir(folder_path), MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
- content_retvm_if(!_media_util_check_support_media_type(path), MEDIA_CONTENT_ERROR_NOT_SUPPORTED, "Unsupported type");
ret = media_svc_check_item_exist_by_path(_content_get_db_handle(), path);
if (ret == MS_MEDIA_ERR_NONE) {
if (ret != MEDIA_CONTENT_ERROR_NONE)
goto ERROR;
- if (!_media_util_check_support_media_type(path_array[idx])) {
- content_error("Not supported type: index[%d]", idx);
- ret = MEDIA_CONTENT_ERROR_NOT_SUPPORTED;
- goto ERROR;
- }
-
size = strlen(path_array[idx]);
if (fwrite(path_array[idx], 1, size, fp) != size) {
content_stderror("failed to write");
}
}
} else if (ret == MS_MEDIA_ERR_DB_NO_RECORD) {
- content_retvm_if(!_media_util_check_support_media_type(path), MEDIA_CONTENT_ERROR_NOT_SUPPORTED, "Unsupported media type");
-
ret = media_svc_insert_item_immediately(_content_get_db_handle(), storage_id, path, _content_get_uid());
if (ret != MS_MEDIA_ERR_NONE) {
if (ret == MS_MEDIA_ERR_DB_CONSTRAINT_FAIL) {
#include <dirent.h>
#include <fcntl.h>
#include <media_info_private.h>
-#include <system_info.h>
#include <sys/stat.h>
-static int MEDIA_CONTENT_OTHER_SUPPORT = -1;
-
-bool _media_util_check_support_media_type(const char *path)
-{
- int ret = SYSTEM_INFO_ERROR_NONE;
- int media_type = -1;
- bool is_supported = false;
-
- content_retvm_if(!STRING_VALID(path), false, "path is empty");
-
- if (MEDIA_CONTENT_OTHER_SUPPORT == -1) {
- ret = system_info_get_platform_bool("http://tizen.org/feature/content.scanning.others", &is_supported);
- content_retvm_if(ret != SYSTEM_INFO_ERROR_NONE, false, "SYSTEM_INFO_ERROR: content.scanning.others [%d]", ret);
-
- MEDIA_CONTENT_OTHER_SUPPORT = is_supported;
- }
-
- if (!MEDIA_CONTENT_OTHER_SUPPORT) {
- ret = media_svc_get_media_type(path, &media_type);
- content_retvm_if(ret != MS_MEDIA_ERR_NONE, false, "Failed to get media type");
- content_retv_if(media_type == MEDIA_CONTENT_TYPE_OTHERS, false);
- }
-
- return true;
-}
-
int _media_util_check_file_exist(const char *path)
{
int fd = open(path, O_RDONLY);