Remove hardcoded path for multiuser support
[platform/core/multimedia/libmedia-service.git] / src / include / common / media-svc-env.h
1 /*
2  * libmedia-service
3  *
4  * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
5  *
6  * Contact: Hyunjun Ko <zzoon.ko@samsung.com>, Haejeong Kim <backto.kim@samsung.com>
7  *
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  * You may obtain a copy of the License at
11  *
12  * http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  *
20  */
21
22
23
24 #ifndef _MEDIA_SVC_ENV_H_
25 #define _MEDIA_SVC_ENV_H_
26
27 #include <time.h>
28 #include <media-util.h>
29 #include <tzplatform_config.h>
30
31 #ifdef __cplusplus
32 extern "C" {
33 #endif
34
35 /**
36  * DB information
37  */
38
39 #define MEDIA_SVC_DB_NAME                                               MEDIA_DB_NAME           /**<  media db name*/
40
41 /**
42  * DB table information
43  */
44
45 #define MEDIA_SVC_DB_TABLE_MEDIA                                        "media"                         /**<  media table*/
46 #define MEDIA_SVC_DB_TABLE_FOLDER                                       "folder"                                /**<  media_folder table*/
47 #define MEDIA_SVC_DB_TABLE_PLAYLIST                             "playlist"                              /**<  playlist table*/
48 #define MEDIA_SVC_DB_TABLE_PLAYLIST_MAP                 "playlist_map"                  /**<  playlist_map table*/
49 #define MEDIA_SVC_DB_TABLE_ALBUM                                        "album"                         /**<  album table*/
50 #define MEDIA_SVC_DB_TABLE_TAG                                  "tag"                           /**<  tag table*/
51 #define MEDIA_SVC_DB_TABLE_TAG_MAP                              "tag_map"                       /**<  tag_map table*/
52 #define MEDIA_SVC_DB_TABLE_BOOKMARK                             "bookmark"                      /**<  bookmark table*/
53 #define MEDIA_SVC_DB_TABLE_CUSTOM                               "custom"                                /**<  custom table*/
54
55
56 #define MEDIA_SVC_METADATA_LEN_MAX                      128                                             /**<  Length of metadata*/
57 #define MEDIA_SVC_METADATA_DESCRIPTION_MAX      512                                             /**<  Length of description*/
58 #define MEDIA_SVC_PATHNAME_SIZE                         4096                                    /**<  Length of Path name. */
59 #define MEDIA_SVC_UUID_SIZE                                             36                                              /**< Length of UUID*/
60
61 #define MEDIA_SVC_TAG_UNKNOWN                           "Unknown"
62 #define MEDIA_SVC_MEDIA_PATH                            tzplatform_mkpath(TZ_USER_DATA, "file-manager-service")                 /**<  Media path*/
63 #define MEDIA_SVC_THUMB_PATH_PREFIX                     tzplatform_mkpath(TZ_USER_DATA, "file-manager-service/.thumb")                  /**< Thumbnail path prefix*/
64 #define MEDIA_SVC_THUMB_INTERNAL_PATH           tzplatform_mkpath(TZ_USER_DATA, "file-manager-service/.thumb/phone")    /**<  Phone thumbnail path*/
65 #define MEDIA_SVC_THUMB_EXTERNAL_PATH           tzplatform_mkpath(TZ_USER_DATA, "file-manager-service/.thumb/mmc")              /**<  MMC thumbnail path*/
66 #define MEDIA_SVC_THUMB_DEFAULT_PATH            tzplatform_mkpath(TZ_USER_DATA, "file-manager-service/.thumb/thumb_default.png") /** default thumbnail */
67
68 #define MEDIA_SVC_DEFAULT_GPS_VALUE                     -200                    /**<  Default GPS Value*/
69 #define THUMB_EXT       "jpg"
70
71 #define MEDIA_SVC_PATH_PHONE                            MEDIA_ROOT_PATH_INTERNAL
72 #define MEDIA_SVC_PATH_MMC                                      MEDIA_ROOT_PATH_SDCARD
73
74 enum Exif_Orientation {
75     NOT_AVAILABLE=0,
76     NORMAL  =1,
77     HFLIP   =2,
78     ROT_180 =3,
79     VFLIP   =4,
80     TRANSPOSE   =5,
81     ROT_90  =6,
82     TRANSVERSE  =7,
83     ROT_270 =8
84 };
85
86 #if 0
87 /**
88  * Media meta data information
89  */
90 typedef struct {
91         char            title[MEDIA_SVC_METADATA_LEN_MAX];                              /**< track title*/
92         char            album[MEDIA_SVC_METADATA_LEN_MAX];                      /**< album name*/
93         char            artist[MEDIA_SVC_METADATA_LEN_MAX];                     /**< artist name*/
94         char            genre[MEDIA_SVC_METADATA_LEN_MAX];                      /**< genre of track*/
95         char            author[MEDIA_SVC_METADATA_LEN_MAX];                     /**< author name*/
96         char            year[MEDIA_SVC_METADATA_LEN_MAX];                               /**< author name*/
97         char            recorded_date[MEDIA_SVC_METADATA_LEN_MAX];              /**< recorded date*/
98         char            copyright[MEDIA_SVC_METADATA_LEN_MAX];                  /**< copyright*/
99         char            track_num[MEDIA_SVC_METADATA_LEN_MAX];          /**< track number*/
100         char            description[MEDIA_SVC_METADATA_DESCRIPTION_MAX];        /**< description*/
101         int             bitrate;                                                                                        /**< bitrate*/
102         int             samplerate;                                                                             /**< samplerate*/
103         int             channel;                                                                                        /**< channel*/
104         int             duration;                                                                               /**< duration*/
105         float           longitude;                                                                              /**< longitude*/
106         float           latitude;                                                                                       /**< latitude*/
107         float           altitude;                                                                                       /**< altitude*/
108         int             width;                                                                                  /**< width*/
109         int             height;                                                                                 /**< height*/
110         char            datetaken[MEDIA_SVC_METADATA_LEN_MAX];          /**< datetaken*/
111         char            timetaken[MEDIA_SVC_METADATA_LEN_MAX];          /**< timetaken*/
112         int             orientation;                                                                            /**< orientation*/
113         int             rating;                                                                                 /**< user defined rating */
114 } media_svc_content_meta_s;
115
116
117 /**
118  * Media data information
119  */
120 typedef struct {
121         char            media_uuid[MEDIA_SVC_UUID_SIZE+1];                      /**< Unique ID of item */
122         char            path[MEDIA_SVC_PATHNAME_SIZE];                          /**< Full path and file name of media file */
123         char            file_name[MEDIA_SVC_PATHNAME_SIZE];                     /**< Full path and file name of media file */
124         int             media_type;                                                                     /**< Type of media file : internal/external */
125         char            mime_type[MEDIA_SVC_PATHNAME_SIZE];                     /**< Full path and file name of media file */
126         int             size;
127         int             added_time;                                                                     /**< added time */
128         int             modified_time;                                                          /**< modified time */
129         char            folder_uuid[MEDIA_SVC_UUID_SIZE+1];                     /**< Unique ID of folder */
130         int             album_id;                                                                       /**< Unique ID of album */
131         char            thumbnail_path[MEDIA_SVC_PATHNAME_SIZE];                /**< Thumbnail image file path */
132         int             played_count;                                                           /**< played count */
133         int             last_played_time;                                                                       /**< last played time */
134         int             last_played_position;
135         int             favourate;                                                                      /**< favourate. o or 1 */
136         int             hiding;                                                                         /**< hiding. o or 1 */
137         int             is_drm;                                                                         /**< is_drm. o or 1 */
138         int             storage_type;                                                                   /**< Storage of media file : internal/external */
139         media_svc_content_meta_s                media_meta;                                     /**< meta data structure for audio files */
140 } media_svc_content_info_s;
141 #else
142 /**
143  * Media meta data information
144  */
145 typedef struct {
146         char    *       title;                          /**< track title*/
147         char    *       album;                          /**< album name*/
148         char    *       artist;                         /**< artist name*/
149         char    *       genre;                          /**< genre of track*/
150         char    *       composer;                       /**< composer name*/
151         char    *       year;                           /**< year*/
152         char    *       recorded_date;          /**< recorded date*/
153         char    *       copyright;                      /**< copyright*/
154         char    *       track_num;                      /**< track number*/
155         char    *       description;                    /**< description*/
156         int             bitrate;                                /**< bitrate*/
157         int             samplerate;                     /**< samplerate*/
158         int             channel;                                /**< channel*/
159         int             duration;                       /**< duration*/
160         float           longitude;                      /**< longitude*/
161         float           latitude;                               /**< latitude*/
162         float           altitude;                               /**< altitude*/
163         int             width;                          /**< width*/
164         int             height;                         /**< height*/
165         char    *       datetaken;                      /**< datetaken*/
166         int             orientation;                    /**< orientation*/
167         int             rating;                         /**< user defined rating */
168 } media_svc_content_meta_s;
169
170
171 /**
172  * Media data information
173  */
174 typedef struct {
175         char    *       media_uuid;                                     /**< Unique ID of item */
176         char    *       path;                                           /**< Full path of media file */
177         char    *       file_name;                                      /**< File name of media file. Display name */
178         int             media_type;                                     /**< Type of media file : internal/external */
179         char    *       mime_type;                                      /**< Full path and file name of media file */
180         unsigned long long      size;                                                   /**< size */
181         time_t  added_time;                                     /**< added time, time_t */
182         time_t  modified_time;                          /**< modified time, time_t */
183         char    *       folder_uuid;                                    /**< Unique ID of folder */
184         int             album_id;                                       /**< Unique ID of album */
185         char    *       thumbnail_path;                         /**< Thumbnail image file path */
186         int             played_count;                           /**< played count */
187         int             last_played_time;                               /**< last played time */
188         int             last_played_position;                   /**< last played position */
189         int             favourate;                                      /**< favourate. o or 1 */
190         int             is_drm;                                         /**< is_drm. o or 1 */
191         int             storage_type;                                   /**< Storage of media file : internal/external */
192         media_svc_content_meta_s        media_meta;     /**< meta data structure for audio files */
193 } media_svc_content_info_s;
194 #endif
195
196 typedef enum{
197         MEDIA_SVC_QUERY_INSERT_ITEM,
198         MEDIA_SVC_QUERY_SET_ITEM_VALIDITY,
199         MEDIA_SVC_QUERY_MOVE_ITEM,
200 } media_svc_query_type_e;
201
202 #ifdef __cplusplus
203 }
204 #endif
205
206 #endif /*_MEDIA_SVC_ENV_H_*/