Update to the latest
[framework/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
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
32
33 /**
34  * DB information
35  */
36
37 #define MEDIA_SVC_DB_NAME                                               "/opt/dbspace/.media.db"                /**<  media db name*/
38
39 /**
40  * DB table information
41  */
42
43 #define MEDIA_SVC_DB_TABLE_MEDIA                                        "media"                         /**<  media table*/
44 #define MEDIA_SVC_DB_TABLE_FOLDER                                       "folder"                                /**<  media_folder table*/
45 #define MEDIA_SVC_DB_TABLE_PLAYLIST                             "playlist"                              /**<  playlist table*/
46 #define MEDIA_SVC_DB_TABLE_PLAYLIST_MAP                 "playlist_map"                  /**<  playlist_map table*/
47 #define MEDIA_SVC_DB_TABLE_ALBUM                                        "album"                         /**<  album table*/
48 #define MEDIA_SVC_DB_TABLE_TAG                                  "tag"                           /**<  tag table*/
49 #define MEDIA_SVC_DB_TABLE_TAG_MAP                              "tag_map"                       /**<  tag_map table*/
50 #define MEDIA_SVC_DB_TABLE_BOOKMARK                             "bookmark"                      /**<  bookmark table*/
51 #define MEDIA_SVC_DB_TABLE_CUSTOM                               "custom"                                /**<  custom table*/
52
53
54 #define MEDIA_SVC_METADATA_LEN_MAX                      128                                             /**<  Length of metadata*/
55 #define MEDIA_SVC_METADATA_DESCRIPTION_MAX      512                                             /**<  Length of description*/
56 #define MEDIA_SVC_PATHNAME_SIZE                         4096                                    /**<  Length of Path name. */
57 #define MEDIA_SVC_UUID_SIZE                                             36                                              /**< Length of UUID*/
58
59 #define MEDIA_SVC_TAG_UNKNOWN                           "Unknown"
60 #define MEDIA_SVC_MEDIA_PATH                                    "/opt/data/file-manager-service"                        /**<  Media path*/
61 #define MEDIA_SVC_THUMB_PATH_PREFIX                     MEDIA_SVC_MEDIA_PATH"/.thumb"                   /**< Thumbnail path prefix*/
62 #define MEDIA_SVC_THUMB_INTERNAL_PATH           MEDIA_SVC_THUMB_PATH_PREFIX"/phone"     /**<  Phone thumbnail path*/
63 #define MEDIA_SVC_THUMB_EXTERNAL_PATH           MEDIA_SVC_THUMB_PATH_PREFIX"/mmc"               /**<  MMC thumbnail path*/
64
65 #define MEDIA_SVC_DEFAULT_GPS_VALUE                     -200                    /**<  Default GPS Value*/
66 #define THUMB_EXT       "jpg"
67
68 #define MEDIA_SVC_PATH_PHONE                            "/opt/media"
69 #define MEDIA_SVC_PATH_MMC                                      "/opt/storage/sdcard"
70
71 enum Exif_Orientation {
72     NOT_AVAILABLE=0,
73     NORMAL  =1,
74     HFLIP   =2,
75     ROT_180 =3,
76     VFLIP   =4,
77     TRANSPOSE   =5,
78     ROT_90  =6,
79     TRANSVERSE  =7,
80     ROT_270 =8
81 };
82
83 #if 0
84 /**
85  * Media meta data information
86  */
87 typedef struct {
88         char            title[MEDIA_SVC_METADATA_LEN_MAX];                              /**< track title*/
89         char            album[MEDIA_SVC_METADATA_LEN_MAX];                      /**< album name*/
90         char            artist[MEDIA_SVC_METADATA_LEN_MAX];                     /**< artist name*/
91         char            genre[MEDIA_SVC_METADATA_LEN_MAX];                      /**< genre of track*/
92         char            author[MEDIA_SVC_METADATA_LEN_MAX];                     /**< author name*/
93         char            year[MEDIA_SVC_METADATA_LEN_MAX];                               /**< author name*/
94         char            recorded_date[MEDIA_SVC_METADATA_LEN_MAX];              /**< recorded date*/
95         char            copyright[MEDIA_SVC_METADATA_LEN_MAX];                  /**< copyright*/
96         char            track_num[MEDIA_SVC_METADATA_LEN_MAX];          /**< track number*/
97         char            description[MEDIA_SVC_METADATA_DESCRIPTION_MAX];        /**< description*/
98         int             bitrate;                                                                                        /**< bitrate*/
99         int             samplerate;                                                                             /**< samplerate*/
100         int             channel;                                                                                        /**< channel*/
101         int             duration;                                                                               /**< duration*/
102         float           longitude;                                                                              /**< longitude*/
103         float           latitude;                                                                                       /**< latitude*/
104         float           altitude;                                                                                       /**< altitude*/
105         int             width;                                                                                  /**< width*/
106         int             height;                                                                                 /**< height*/
107         char            datetaken[MEDIA_SVC_METADATA_LEN_MAX];          /**< datetaken*/
108         char            timetaken[MEDIA_SVC_METADATA_LEN_MAX];          /**< timetaken*/
109         int             orientation;                                                                            /**< orientation*/
110         int             rating;                                                                                 /**< user defined rating */
111 } media_svc_content_meta_s;
112
113
114 /**
115  * Media data information
116  */
117 typedef struct {
118         char            media_uuid[MEDIA_SVC_UUID_SIZE+1];                      /**< Unique ID of item */
119         char            path[MEDIA_SVC_PATHNAME_SIZE];                          /**< Full path and file name of media file */
120         char            file_name[MEDIA_SVC_PATHNAME_SIZE];                     /**< Full path and file name of media file */
121         int             media_type;                                                                     /**< Type of media file : internal/external */
122         char            mime_type[MEDIA_SVC_PATHNAME_SIZE];                     /**< Full path and file name of media file */
123         int             size;
124         int             added_time;                                                                     /**< added time */
125         int             modified_time;                                                          /**< modified time */
126         char            folder_uuid[MEDIA_SVC_UUID_SIZE+1];                     /**< Unique ID of folder */
127         int             album_id;                                                                       /**< Unique ID of album */
128         char            thumbnail_path[MEDIA_SVC_PATHNAME_SIZE];                /**< Thumbnail image file path */
129         int             played_count;                                                           /**< played count */
130         int             last_played_time;                                                                       /**< last played time */
131         int             last_played_position;
132         int             favourate;                                                                      /**< favourate. o or 1 */
133         int             hiding;                                                                         /**< hiding. o or 1 */
134         int             is_drm;                                                                         /**< is_drm. o or 1 */
135         int             storage_type;                                                                   /**< Storage of media file : internal/external */
136         media_svc_content_meta_s                media_meta;                                     /**< meta data structure for audio files */
137 } media_svc_content_info_s;
138 #else
139 /**
140  * Media meta data information
141  */
142 typedef struct {
143         char    *       title;                          /**< track title*/
144         char    *       album;                          /**< album name*/
145         char    *       artist;                         /**< artist name*/
146         char    *       genre;                          /**< genre of track*/
147         char    *       composer;                       /**< composer name*/
148         char    *       year;                           /**< year*/
149         char    *       recorded_date;          /**< recorded date*/
150         char    *       copyright;                      /**< copyright*/
151         char    *       track_num;                      /**< track number*/
152         char    *       description;                    /**< description*/
153         int             bitrate;                                /**< bitrate*/
154         int             samplerate;                     /**< samplerate*/
155         int             channel;                                /**< channel*/
156         int             duration;                       /**< duration*/
157         float           longitude;                      /**< longitude*/
158         float           latitude;                               /**< latitude*/
159         float           altitude;                               /**< altitude*/
160         int             width;                          /**< width*/
161         int             height;                         /**< height*/
162         char    *       datetaken;                      /**< datetaken*/
163         int             orientation;                    /**< orientation*/
164         int             rating;                         /**< user defined rating */
165 } media_svc_content_meta_s;
166
167
168 /**
169  * Media data information
170  */
171 typedef struct {
172         char    *       media_uuid;                                     /**< Unique ID of item */
173         char    *       path;                                           /**< Full path of media file */
174         char    *       file_name;                                      /**< File name of media file. Display name */
175         int             media_type;                                     /**< Type of media file : internal/external */
176         char    *       mime_type;                                      /**< Full path and file name of media file */
177         unsigned long long      size;                                                   /**< size */
178         time_t  added_time;                                     /**< added time, time_t */
179         time_t  modified_time;                          /**< modified time, time_t */
180         char    *       folder_uuid;                                    /**< Unique ID of folder */
181         int             album_id;                                       /**< Unique ID of album */
182         char    *       thumbnail_path;                         /**< Thumbnail image file path */
183         int             played_count;                           /**< played count */
184         int             last_played_time;                               /**< last played time */
185         int             last_played_position;                   /**< last played position */
186         int             favourate;                                      /**< favourate. o or 1 */
187         int             is_drm;                                         /**< is_drm. o or 1 */
188         int             storage_type;                                   /**< Storage of media file : internal/external */
189         media_svc_content_meta_s        media_meta;     /**< meta data structure for audio files */
190 } media_svc_content_info_s;
191 #endif
192
193 typedef enum{
194         MEDIA_SVC_QUERY_INSERT_ITEM,
195         MEDIA_SVC_QUERY_SET_ITEM_VALIDITY,
196         MEDIA_SVC_QUERY_MOVE_ITEM,
197 } media_svc_query_type_e;
198
199 #ifdef __cplusplus
200 }
201 #endif
202
203 #endif /*_MEDIA_SVC_ENV_H_*/