Add API to get the rotate information from video metadata 49/119749/6
authorMinje Ahn <minje.ahn@samsung.com>
Mon, 20 Mar 2017 04:29:33 +0000 (13:29 +0900)
committerMinje Ahn <minje.ahn@samsung.com>
Tue, 21 Mar 2017 07:59:53 +0000 (16:59 +0900)
Change-Id: I849abb2df40275dab95029d6c6b5090865deee71
Signed-off-by: Minje Ahn <minje.ahn@samsung.com>
include/media_info_private.h
src/media_info.c
src/media_video.c

index aaf565d..918f775 100755 (executable)
@@ -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;
index 1c588c3..6215cf6 100755 (executable)
@@ -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;
 
index bc91b9c..3ba6f6b 100755 (executable)
@@ -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;