Tizen 2.0 Release
[profile/ivi/org.tizen.video-player.git] / include / mp-util-media-service.h
1 /*\r
2  * Copyright (c) [2012] Samsung Electronics Co., Ltd.\r
3  *\r
4  * Licensed under the Flora License, Version 1.0 (the License);\r
5  * you may not use this file except in compliance with the License.\r
6  * You may obtain a copy of the License at\r
7  *\r
8  *     http://floralicense.org/license/\r
9  *\r
10  * Unless required by applicable law or agreed to in writing, software\r
11  * distributed under the License is distributed on an AS IS BASIS,\r
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
13  * See the License for the specific language governing permissions and\r
14  * limitations under the License.\r
15  */\r
16 \r
17 \r
18 \r
19 #ifndef _MP_UTIL_DATABASE_\r
20 #define _MP_UTIL_DATABASE_\r
21 \r
22 #include "video-player.h"\r
23 #include <glib.h>\r
24 \r
25 typedef enum\r
26 {\r
27         MP_MEDIA_VIDEO_FILE_TYPE                        = 0,\r
28         MP_MEDIA_CAMERA_FILE_TYPE,\r
29         MP_MEDIA_ALL_FILE_TYPE,\r
30         MP_MEDIA_FILE_TYPE_MAX,\r
31 }MpMediaSvcVideoFileType;\r
32 \r
33 typedef enum\r
34 {\r
35         MP_MEDIA_SORT_BY_NONE                           = 0,\r
36         MP_MEDIA_SORT_BY_NAME_ASC,\r
37         MP_MEDIA_SORT_BY_NAME_DESC,\r
38         MP_MEDIA_SORT_BY_DATE_MOST_RECENT,\r
39         MP_MEDIA_SORT_BY_OLDEST,\r
40         MP_MEDIA_SORT_BY_MAX,\r
41 }MpMediaSvcSortType;\r
42 \r
43 typedef enum\r
44 {\r
45         MP_MEDIA_LIST_TYPE_FOLDER                       = 0,\r
46         MP_MEDIA_LIST_TYPE_ALL_FOLDER_GALLERY,\r
47         MP_MEDIA_LIST_TYPE_TAG_GALLERY,\r
48         MP_MEDIA_LIST_TYPE_FAVORITE,\r
49         MP_MEDIA_LIST_TYPE_ALLSHARE,\r
50         MP_MEDIA_LIST_TYPE_MAX,\r
51 }MpMediaSvcListType;\r
52 \r
53 \r
54 void MpUtilMediaSvcInitSession(void);\r
55 void MpUtilMediaSvcFinishSession(void);\r
56 \r
57 ////////////////////////////////////////////////////////\r
58 // Manage video item list\r
59 \r
60 // For gallery list\r
61 bool MpUtilMediaSvcExtractVideoListFromFolder(char* szFolderPath, int nSortType);    // For myfiles.\r
62 bool MpUtilMediaSvcExtractVideoListFromAllFolderOfGallery(int nSortType);            // For 'All' folder of gallery.\r
63 bool MpUtilMediaSvcExtractVideoListVideoType(int nSortType);                         // For only video type files of video list view.\r
64 bool MpUtilMediaSvcExtractVideoListRecordedType(int nSortType);                      // For only recorded type files of video list view.\r
65 bool MpUtilMediaSvcExtractVideoListByTagName(char *szTagName);                       // For tag folder of gallery.\r
66 bool MpUtilMediaSvcExtractVideoListFromFavorite(int nSortType);                      // For favorite naming of gallery.\r
67 bool MpUtilMediaSvcExtractVideoListForSearchView(const char *keyword);               // For only video type files of video search view*/\r
68 \r
69 \r
70 void MpUtilMediaSvcDestoryVideoList(void);\r
71 bool MpUtilMediaSvcRemoveItemByUrlWithList(char *szFilePath);\r
72 bool MpUtilMediaSvcRemoveItemByListIndex(int nVideoItemIndex);\r
73 bool MpUtilMediaSvcRemoveItemByListIndexWithoutListItem(int nVideoItemIndex);\r
74 \r
75 \r
76 bool MpUtilMediaSvcGetVideoIDByVideoUri(const char *szPath, char *szVideoID);\r
77 char* MpUtilMediaSvcGetVideoThumbnailByVideoUri(const char *szMediaUri);\r
78 unsigned int MpUtilMediaSvcGetVideoLastPlayTimeByVideoUri(const char *szPath);\r
79 unsigned int MpUtilMediaSvcGetVideoDurationByVideoUri(const char *szPath);\r
80 int MpUtilMediaSvcGetVideoFilesizeByVideoUri(const char *szPath);\r
81 void MpUtilMediaSvcSetVideoLastPlayedTimeByUri(char* szMediaUri, unsigned int nLastPlayedTime);\r
82 \r
83 bool MpUtilMediaSvcGetVideoCurrentUrlPreNextItem(char* szCurrMediaUri, char* szPreMediaUri, char* szNextMediaUri,bool bLoop);\r
84 \r
85 // For video list\r
86 char* MpUtilMediaSvcGetVideoUrl(const int nVideoItemIndex);\r
87 char* MpUtilMediaSvcGetVideoThumbnail(const int nVideoItemIndex);\r
88 char* MpUtilMediaSvcGetVideoTitle(const int nVideoItemIndex);\r
89 int MpUtilMediaSvcGetVideoDurationTime(const int nVideoItemIndex);\r
90 int MpUtilMediaSvcGetVideoLastPlayedPos(const int nVideoItemIndex);\r
91 int MpUtilMediaSvcGetVideoItemSize(const int nVideoItemIndex);\r
92 int MpUtilMediaSvcGetVideoItemWidth(const int nVideoItemIndex);\r
93 int MpUtilMediaSvcGetVideoItemHeight(const int nVideoItemIndex);\r
94 time_t MpUtilMediaSvcGetVideoItemDateTime(const int nVideoItemIndex);\r
95 char *MpUtilMediaSvcGetVideoItemExtension(const int nVideoItemIndex);\r
96 double MpUtilMediaSvcGetVideoItemLongitude(const int nVideoItemIndex);\r
97 double MpUtilMediaSvcGetVideoItemLatitude(const int nVideoItemIndex);\r
98 \r
99 int MpUtilMediaSvcGetVideoListSizeForCheckingIndex(void);\r
100 int MpUtilMediaSvcGetNumberOfVideoItemByType(void);\r
101 int MpUtilMediaSvcGetTotalVideoTypeFiles(void);\r
102 void MpUtilMediaSvcPrintListInfo(void);\r
103 int MpUtilMediaSvcFindVideoItemIndexByUrl(const char *szPath);\r
104 \r
105 // For folder list\r
106 bool MpUtilMediaSvcExtractVideoFolderList(int nSortType);\r
107 bool MpUtilMediaSvcDestoryVideoFolderList(void);\r
108 int MpUtilMediaSvcGetVideoFolderListSize(void);\r
109 char* MpUtilMediaSvcGetVideoFolderName(int nVideoFolderIndex);\r
110 char* MpUtilMediaSvcGetVideoFolderUrl(int nVideoFolderIndex);\r
111 \r
112 ////////////////////////////////////////////////////////\r
113 // Manage bookmark\r
114 \r
115 bool MpUtilMediaSvcBookmarkListGet(char *vid, GList **list);\r
116 void MpUtilMediaSvcBookmarkListClear(GList *list);\r
117 int MpUtilMediaSvcBookmarkInsert(char *vid, int position, char *path);\r
118 int MpUtilMediaSvcBookmarkDelete(char *vid, int position);\r
119 int MpUtilMediaSvcBookmarkDeleteAll(char *vid);\r
120 char* MpUtilMediaSvcBookmarkGetThumbnail(void* pBookmarkItemHandle);\r
121 int MpUtilMediaSvcBookmarkGetPos(void* pBookmarkItemHandle);\r
122 \r
123 #endif // _MP_UTIL_DATABASE_