Change to check 'content.scanning.others' feature if media type is other.
Change-Id: Ie06e7ee6d3ef38549f2b28af728793d51e8308a2
Signed-off-by: Minje Ahn <minje.ahn@samsung.com>
INCLUDE(FindPkgConfig)
-pkg_check_modules(pkgs REQUIRED glib-2.0 dlog sqlite3 libexif mm-fileinfo libmedia-utils aul uuid libxml-2.0 libzip media-thumbnail libpodofo iniparser)
+pkg_check_modules(pkgs REQUIRED glib-2.0 dlog sqlite3 libexif mm-fileinfo libmedia-utils aul uuid libxml-2.0 libzip media-thumbnail libpodofo iniparser capi-system-info)
FOREACH(flag ${pkgs_CFLAGS})
SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
int _media_svc_extract_book_metadata(media_svc_content_info_s *content_info);
void _media_svc_destroy_content_info(media_svc_content_info_s *content_info);
int _media_svc_create_thumbnail(const char *path, char *thumb_path, media_svc_media_type_e media_type, uid_t uid);
-int _media_svc_get_media_type(const char *path, int *mediatype);
bool _media_svc_is_keyword_included(const char *path, const char *keyword);
void _media_svc_update_wordbook(const char *path, uid_t uid);
void _media_svc_clean_wordbook(uid_t uid);
int media_svc_append_query(const char *query, uid_t uid);
int media_svc_send_query(uid_t uid);
-int media_svc_get_media_type(const char *path, int *mediatype);
int media_svc_create_thumbnail(const char *file_path, int media_type, uid_t uid, char **thumbnail_path);
int media_svc_get_book_by_keyword(sqlite3 *handle, const char *keyword, uid_t uid, GList **result);
Name: libmedia-service
Summary: Media information service library for multimedia applications
-Version: 0.7.1
+Version: 0.7.2
Release: 0
Group: Multimedia/Libraries
License: Apache-2.0
BuildRequires: pkgconfig(media-thumbnail)
BuildRequires: pkgconfig(libpodofo)
BuildRequires: pkgconfig(iniparser)
+BuildRequires: pkgconfig(capi-system-info)
%description
This package is a library that provides the media information service for the multimedia applications.
return media_svc_check_folder_exist_by_path(handle, folder_path);
}
-int get_media_type(const char *path, int *mediatype)
-{
- return media_svc_get_media_type(path, mediatype);
-}
-
int refresh_item(sqlite3 *handle, const char *path, uid_t uid)
{
return media_svc_refresh_item(handle, true, path, uid);
return (ret == THUMB_OK) ? MS_MEDIA_ERR_NONE : MS_MEDIA_ERR_INTERNAL;
}
-int _media_svc_get_media_type(const char *path, int *mediatype)
-{
- int ret = MS_MEDIA_ERR_NONE;
- char mime_type[256] = {0};
- media_svc_media_type_e media_type = MEDIA_SVC_MEDIA_TYPE_OTHER;
-
- media_svc_retvm_if(mediatype == NULL, MS_MEDIA_ERR_INVALID_PARAMETER, "mediatype is NULL");
-
- ret = __media_svc_get_mime_type(path, mime_type);
- if (ret == MS_MEDIA_ERR_NONE)
- __media_svc_get_media_type(path, mime_type, &media_type);
- else
- media_svc_error("__media_svc_get_mime_type failed");
-
- *mediatype = media_type;
-
- return ret;
-}
-
bool _media_svc_is_keyword_included(const char *path, const char *keyword)
{
bool ret = false;
#include "media-svc-storage.h"
#include <iniparser.h>
+#include <system_info.h>
#define CONTENT_INI_DEFAULT_PATH SYSCONFDIR"/multimedia/media_content_config.ini"
static __thread int g_media_svc_cur_data_cnt = 0;
+static int g_media_svc_other_support = -1;
/* Flag for items to be published by notification */
static __thread bool g_insert_with_noti = false;
return ret;
}
+static bool __media_svc_check_support_media_type(void)
+{
+ int ret = SYSTEM_INFO_ERROR_NONE;
+ bool is_supported = false;
+
+ if (g_media_svc_other_support == -1) {
+ ret = system_info_get_platform_bool("http://tizen.org/feature/content.scanning.others", &is_supported);
+ media_svc_retvm_if(ret != SYSTEM_INFO_ERROR_NONE, false, "SYSTEM_INFO_ERROR: content.scanning.others [%d]", ret);
+
+ g_media_svc_other_support = is_supported;
+ }
+
+ return (g_media_svc_other_support);
+}
+
static int __media_svc_set_info(sqlite3 *handle,
const char *storage_id,
const char *path,
ret = _media_svc_extract_book_metadata(info);
break;
default:
+ /* Check other feature */
+ media_svc_retv_del_if(!__media_svc_check_support_media_type(), MS_MEDIA_ERR_UNSUPPORTED_CONTENT, info);
+
/* The 'TITLE' should always be filled in */
info->media_meta.title = _media_svc_get_title_from_filename(info->file_name);
break;
return _media_svc_list_query_do(MEDIA_SVC_QUERY_UPDATE_COMMON, uid);
}
-int media_svc_get_media_type(const char *path, int *mediatype)
-{
- return _media_svc_get_media_type(path, mediatype);
-}
-
int media_svc_create_thumbnail(const char *file_path, int media_type, uid_t uid, char **thumbnail_path)
{
int ret = MS_MEDIA_ERR_NONE;