From: ji.yong.seo Date: Thu, 1 Dec 2016 06:50:46 +0000 (+0900) Subject: add stitched info field. X-Git-Tag: accepted/tizen/common/20161208.135234~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d41a883448ab31d70a6f16aecc2eec788da10c69;p=platform%2Fcore%2Fapi%2Fmedia-content.git add stitched info field. Signed-off-by: ji.yong.seo Change-Id: I26f31645e14ee8dbb2c25f920634b42d54a5353a (cherry picked from commit 5bf4cf203d6919d9efa96981d873a3239eeac747) --- diff --git a/include_product/media_info.h b/include_product/media_info.h index e9f6ecf..a1d1202 100755 --- a/include_product/media_info.h +++ b/include_product/media_info.h @@ -1074,6 +1074,9 @@ int media_info_is_drm(media_info_h media, bool *is_drm); */ int media_info_is_360_content(media_info_h media, bool *is_360); +int media_info_get_360_stitched_content(media_info_h media, int *type_360); +int media_info_get_360_engine_content(media_info_h media, int *type_360); + /** * @brief Gets the storage type of media info. * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif diff --git a/include_product/media_info_private.h b/include_product/media_info_private.h index e1f79c3..e766540 100755 --- a/include_product/media_info_private.h +++ b/include_product/media_info_private.h @@ -131,6 +131,7 @@ typedef enum { MEDIA_INFO_SYNC_STATUS, MEDIA_INFO_STORAGE_UUID, MEDIA_INFO_IS_360, + MEDIA_INFO_STITCHED_INFO, MEDIA_INFO_EXTRACT_FLAG, MEDIA_INFO_MODIFIED_MONTH, #ifdef _USE_SENIOR_MODE @@ -329,6 +330,7 @@ typedef struct { unsigned int request_id; unsigned int face_request_id; int is_360; + int stitched_info; int extract_flag; #ifdef _USE_SENIOR_MODE char* contact; @@ -577,6 +579,7 @@ typedef struct _media_content_cb_data { #define DB_FIELD_MEDIA_AGE_RATING_PINYIN "age_rating_pinyin" #define DB_FIELD_MEDIA_KEYWORD_PINYIN "keyword_pinyin" #define DB_FIELD_MEDIA_360 "is_360" +#define DB_FIELD_MEDIA_STITCHED_INFO "stitched_info" #ifdef _USE_SENIOR_MODE #define DB_FIELD_MEDIA_CONTACT "contact" #define DB_FIELD_MEDIA_APP_DATA "app_data" @@ -742,10 +745,10 @@ typedef struct _media_content_cb_data { /* Get Media list of Group */ #ifdef _USE_SENIOR_MODE #define MEDIA_INFO_ITEM "media_uuid, path, file_name, media_type, mime_type, size, added_time, modified_time, thumbnail_path, description, \ - rating, favourite, author, provider, content_name, category, location_tag, age_rating, keyword, is_drm, storage_type, longitude, latitude, altitude, exposure_time, fnumber, iso, model, width, height, datetaken, orientation, title, album, artist, album_artist, genre, composer, year, recorded_date, copyright, track_num, bitrate, bitpersample, duration, played_count, last_played_time, last_played_position, samplerate, channel, burst_id, timeline, weather, sync_status, storage_uuid, is_360, extract_flag, modified_date, contact, app_data" + rating, favourite, author, provider, content_name, category, location_tag, age_rating, keyword, is_drm, storage_type, longitude, latitude, altitude, exposure_time, fnumber, iso, model, width, height, datetaken, orientation, title, album, artist, album_artist, genre, composer, year, recorded_date, copyright, track_num, bitrate, bitpersample, duration, played_count, last_played_time, last_played_position, samplerate, channel, burst_id, timeline, weather, sync_status, storage_uuid, is_360, stitched_info, extract_flag, modified_date, contact, app_data" #else #define MEDIA_INFO_ITEM "media_uuid, path, file_name, media_type, mime_type, size, added_time, modified_time, thumbnail_path, description, \ - rating, favourite, author, provider, content_name, category, location_tag, age_rating, keyword, is_drm, storage_type, longitude, latitude, altitude, exposure_time, fnumber, iso, model, width, height, datetaken, orientation, title, album, artist, album_artist, genre, composer, year, recorded_date, copyright, track_num, bitrate, bitpersample, duration, played_count, last_played_time, last_played_position, samplerate, channel, burst_id, timeline, weather, sync_status, storage_uuid, is_360, extract_flag, modified_date" + rating, favourite, author, provider, content_name, category, location_tag, age_rating, keyword, is_drm, storage_type, longitude, latitude, altitude, exposure_time, fnumber, iso, model, width, height, datetaken, orientation, title, album, artist, album_artist, genre, composer, year, recorded_date, copyright, track_num, bitrate, bitpersample, duration, played_count, last_played_time, last_played_position, samplerate, channel, burst_id, timeline, weather, sync_status, storage_uuid, is_360, stitched_info, extract_flag, modified_date" #endif /*Folder info*/ diff --git a/packaging/capi-content-media-content.spec b/packaging/capi-content-media-content.spec index 3bca763..1149da8 100755 --- a/packaging/capi-content-media-content.spec +++ b/packaging/capi-content-media-content.spec @@ -1,6 +1,6 @@ Name: capi-content-media-content Summary: A Media content library in Tizen Native API -Version: 0.2.91 +Version: 0.2.92 Release: 0 Group: Multimedia/API License: Apache-2.0 diff --git a/src/media_content.c b/src/media_content.c index d0175f9..dbf8353 100755 --- a/src/media_content.c +++ b/src/media_content.c @@ -294,6 +294,11 @@ static int __media_content_create_attr_handle(void) ret = _media_filter_attribute_add(g_attr_handle, MEDIA_360, DB_FIELD_MEDIA_360); media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); +#ifdef _USE_TV_PROFILE + ret = _media_filter_attribute_add(g_attr_handle, MEDIA_STITCHED_INFO, DB_FIELD_MEDIA_STITCHED_INFO); + media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); +#endif + /* Storage*/ ret = _media_filter_attribute_add(g_attr_handle, MEDIA_STORAGE_ID, DB_FIELD_STORAGE_ID); media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); diff --git a/src/media_info.c b/src/media_info.c index 39f7435..a3bc321 100755 --- a/src/media_info.c +++ b/src/media_info.c @@ -309,6 +309,9 @@ void _media_info_item_get_detail(sqlite3_stmt* stmt, media_info_h media) _media->sync_status = (int)sqlite3_column_int(stmt, MEDIA_INFO_SYNC_STATUS); _media->storage_uuid = g_strdup((const char *)sqlite3_column_text(stmt, MEDIA_INFO_STORAGE_UUID)); _media->is_360 = (int)sqlite3_column_int(stmt, MEDIA_INFO_IS_360); +#ifdef _USE_TV_PROFILE + _media->stitched_info = (int)sqlite3_column_int(stmt, MEDIA_INFO_STITCHED_INFO); +#endif if (_media->media_type == MEDIA_CONTENT_TYPE_IMAGE) { _media->image_meta = (image_meta_s *)calloc(1, sizeof(image_meta_s)); @@ -1076,6 +1079,7 @@ int media_info_clone(media_info_h *dst, media_info_h src) _dst->face_request_id = _src->face_request_id; _dst->is_360 = _src->is_360; #ifdef _USE_TV_PROFILE + _dst->stitched_info = _src->stitched_info; _dst->extract_flag = _src->extract_flag; #endif @@ -2130,6 +2134,40 @@ int media_info_is_360_content(media_info_h media, bool *is_360) return ret; } +#ifdef _USE_TV_PROFILE +int media_info_get_stitched_state(media_info_h media, int *stitched_info) +{ + int ret = MEDIA_CONTENT_ERROR_NONE; + media_info_s *_media = (media_info_s*)media; + + if (_media) { + *stitched_info = (_media->stitched_info & 0xFFFF0000) >> 16; + ret = MEDIA_CONTENT_ERROR_NONE; + } else { + media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER); + ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER; + } + + return ret; +} + +int media_info_get_stitched_engine(media_info_h media, int *stitched_info) +{ + int ret = MEDIA_CONTENT_ERROR_NONE; + media_info_s *_media = (media_info_s*)media; + + if (_media) { + *stitched_info = _media->stitched_info & 0x0000FFFF; + ret = MEDIA_CONTENT_ERROR_NONE; + } else { + media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER); + ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER; + } + + return ret; +} +#endif + int media_info_get_storage_type(media_info_h media, media_content_storage_e *storage_type) { int ret = MEDIA_CONTENT_ERROR_NONE; diff --git a/test/media-content_test.c b/test/media-content_test.c index b6b830d..9c1be5c 100755 --- a/test/media-content_test.c +++ b/test/media-content_test.c @@ -500,11 +500,21 @@ bool media_item_cb(media_info_h media, void *user_data) media_content_error("error when get info : [%d]", ret); media_content_debug("is_drm : [%d]", b_value); - ret = media_info_is_360(media, &b_value); + ret = media_info_is_360_content(media, &b_value); if (ret != MEDIA_CONTENT_ERROR_NONE) media_content_error("error when get info : [%d]", ret); media_content_debug("is_360 : [%d]", b_value); + ret = media_info_get_stitched_state(media, &i_value); + if (ret != MEDIA_CONTENT_ERROR_NONE) + media_content_error("error when get info : [%d]", ret); + media_content_debug("360 stitched : [%d]", i_value); + + ret = media_info_get_stitched_engine(media, &i_value); + if (ret != MEDIA_CONTENT_ERROR_NONE) + media_content_error("error when get info : [%d]", ret); + media_content_debug("360 engine : [%d]", i_value); + ret = media_info_set_weather(media, "Sunny"); if (ret != MEDIA_CONTENT_ERROR_NONE) { media_content_error("Fail to set weather");