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