From: Minje Ahn Date: Mon, 20 Mar 2017 04:29:33 +0000 (+0900) Subject: Add API to get the rotate information from video metadata X-Git-Tag: submit/tizen/20170404.092228~1^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F49%2F119749%2F6;p=platform%2Fcore%2Fapi%2Fmedia-content.git Add API to get the rotate information from video metadata Change-Id: I849abb2df40275dab95029d6c6b5090865deee71 Signed-off-by: Minje Ahn --- diff --git a/include/media_info_private.h b/include/media_info_private.h index aaf565d..918f775 100755 --- a/include/media_info_private.h +++ b/include/media_info_private.h @@ -252,6 +252,7 @@ typedef struct { int width; int height; int played_count; + int rotation; time_t played_time; int played_position; } video_meta_s; diff --git a/src/media_info.c b/src/media_info.c index 1c588c3..6215cf6 100755 --- a/src/media_info.c +++ b/src/media_info.c @@ -350,6 +350,7 @@ void _media_info_item_get_detail(sqlite3_stmt* stmt, media_info_h media) _media->video_meta->played_count = sqlite3_column_int(stmt, MEDIA_INFO_PLAYED_COUNT); _media->video_meta->played_time = sqlite3_column_int(stmt, MEDIA_INFO_LAST_PLAYED_TIME); _media->video_meta->played_position = sqlite3_column_int(stmt, MEDIA_INFO_LAST_PLAYED_POSITION); + _media->video_meta->rotation = sqlite3_column_int(stmt, MEDIA_INFO_ORIENTATION); } } else if ((_media->media_type == MEDIA_CONTENT_TYPE_MUSIC) || (_media->media_type == MEDIA_CONTENT_TYPE_SOUND)) { @@ -1255,6 +1256,7 @@ int media_info_clone(media_info_h *dst, media_info_h src) _dst->video_meta->played_count = _src->video_meta->played_count; _dst->video_meta->played_time = _src->video_meta->played_time; _dst->video_meta->played_position = _src->video_meta->played_position; + _dst->video_meta->rotation = _src->video_meta->rotation; } else if ((_src->media_type == MEDIA_CONTENT_TYPE_MUSIC || _src->media_type == MEDIA_CONTENT_TYPE_SOUND) && _src->audio_meta) { _dst->audio_meta = (audio_meta_s *)calloc(1, sizeof(audio_meta_s)); @@ -1547,6 +1549,7 @@ int media_info_get_video(media_info_h media, video_meta_h *video) _video->played_count = _media->video_meta->played_count; _video->played_time = _media->video_meta->played_time; _video->played_position = _media->video_meta->played_position; + _video->rotation = _media->video_meta->rotation; *video = (video_meta_h)_video; diff --git a/src/media_video.c b/src/media_video.c index bc91b9c..3ba6f6b 100755 --- a/src/media_video.c +++ b/src/media_video.c @@ -161,6 +161,7 @@ int video_meta_clone(video_meta_h *dst, video_meta_h src) _dst->played_count = _src->played_count; _dst->played_time = _src->played_time; _dst->played_position = _src->played_position; + _dst->rotation = _src->rotation; *dst = (video_meta_h)_dst; @@ -466,6 +467,22 @@ int video_meta_get_height(video_meta_h video, int *height) return ret; } +int video_meta_get_rotation(video_meta_h video, int *rotation) +{ + int ret = MEDIA_CONTENT_ERROR_NONE; + video_meta_s *_video = (video_meta_s*)video; + if (_video && rotation) { + *rotation = _video->rotation; + 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 video_meta_get_played_count(video_meta_h video, int *played_count) { int ret = MEDIA_CONTENT_ERROR_NONE;