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