tizen 2.3.1 release
[framework/multimedia/libmm-player.git] / src / include / mm_player_ini.h
1 /*
2  * libmm-player
3  *
4  * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
5  *
6  * Contact: JongHyuk Choi <jhchoi.choi@samsung.com>, YeJin Cho <cho.yejin@samsung.com>,
7  * Seungbae Shin <seungbae.shin@samsung.com>, YoungHwan An <younghwan_.an@samsung.com>
8  *
9  * Licensed under the Apache License, Version 2.0 (the "License");
10  * you may not use this file except in compliance with the License.
11  * You may obtain a copy of the License at
12  *
13  * http://www.apache.org/licenses/LICENSE-2.0
14  *
15  * Unless required by applicable law or agreed to in writing, software
16  * distributed under the License is distributed on an "AS IS" BASIS,
17  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18  * See the License for the specific language governing permissions and
19  * limitations under the License.
20  *
21  */
22
23 #ifndef __MM_PLAYER_INI_H__
24 #define __MM_PLAYER_INI_H__
25
26 #include <glib.h>
27 #include <mm_types.h>
28 #include "mm_player_audioeffect.h"
29
30 #ifdef __cplusplus
31         extern "C" {
32 #endif
33
34
35 #define MM_PLAYER_INI_DEFAULT_PATH      "/usr/etc/mmfw_player.ini"
36 #define MM_PLAYER_INI_DEFAULT_AUDIOEFFECT_PATH  "/usr/etc/mmfw_player_audio_effect.ini"
37
38 #define PLAYER_INI_MAX_STRLEN   100
39 #define PLAYER_INI_MAX_PARAM_STRLEN     256
40
41 #define PLAYER_INI_MAX_ELEMENT  10
42
43 /* NOTE : MMPlayer has no initalizing API for library itself
44  * so we cannot decide when those ini values to be released.
45  * this is the reason of all string items are static array.
46  * make it do with malloc when MMPlayerInitialize() API created
47  * before that time, we should be careful with size limitation
48  * of each string item.
49  */
50 enum keyword_type
51 {
52         KEYWORD_EXCLUDE,        // for element exclude keyworld
53         KEYWORD_DUMP            // for dump element keyworld
54 };
55
56 /* @ mark means the item has tested */
57 typedef struct __mm_player_ini
58 {
59         /* general */
60         gchar videosink_element_x[PLAYER_INI_MAX_STRLEN];
61         gchar videosink_element_evas[PLAYER_INI_MAX_STRLEN];
62         gchar videosink_element_fake[PLAYER_INI_MAX_STRLEN];
63         gchar name_of_audio_resampler[PLAYER_INI_MAX_STRLEN];
64         gchar name_of_audiosink[PLAYER_INI_MAX_STRLEN];
65         gchar name_of_drmsrc[PLAYER_INI_MAX_STRLEN];
66         gchar name_of_video_converter[PLAYER_INI_MAX_STRLEN];
67         gboolean skip_rescan;
68         gboolean generate_dot;
69         gboolean provide_clock_for_music;
70         gboolean provide_clock_for_movie;
71         gint live_state_change_timeout;
72         gint localplayback_state_change_timeout;
73         gint delay_before_repeat;
74         gint eos_delay;
75         gboolean multiple_codec_supported;
76
77         gchar gst_param[5][PLAYER_INI_MAX_PARAM_STRLEN];
78         gchar exclude_element_keyword[PLAYER_INI_MAX_ELEMENT][PLAYER_INI_MAX_STRLEN];
79         gboolean async_start;
80         gboolean disable_segtrap;
81
82         /* audio effect */
83         gchar name_of_audio_effect[PLAYER_INI_MAX_STRLEN];
84         gchar name_of_audio_effect_sec[PLAYER_INI_MAX_STRLEN];
85
86         gboolean use_audio_effect_preset;
87         gboolean audio_effect_preset_list[MM_AUDIO_EFFECT_PRESET_NUM];
88         gboolean audio_effect_preset_earphone_only_list[MM_AUDIO_EFFECT_PRESET_NUM];
89
90         gboolean use_audio_effect_custom;
91         gboolean audio_effect_custom_list[MM_AUDIO_EFFECT_CUSTOM_NUM];
92         gboolean audio_effect_custom_earphone_only_list[MM_AUDIO_EFFECT_CUSTOM_NUM];
93         gint audio_effect_custom_eq_band_num;
94         gint audio_effect_custom_eq_band_width[MM_AUDIO_EFFECT_EQ_BAND_NUM_MAX];
95         gint audio_effect_custom_eq_band_freq[MM_AUDIO_EFFECT_EQ_BAND_NUM_MAX];
96         gint audio_effect_custom_ext_num;
97         gint audio_effect_custom_min_level_list[MM_AUDIO_EFFECT_CUSTOM_NUM];
98         gint audio_effect_custom_max_level_list[MM_AUDIO_EFFECT_CUSTOM_NUM];
99
100         gboolean use_audio_effect_square;
101         gint audio_effect_square_max_row;
102         gint audio_effect_square_max_col;
103
104         /* http streaming */
105         gchar name_of_httpsrc[PLAYER_INI_MAX_STRLEN];
106         gchar http_file_buffer_path[PLAYER_INI_MAX_STRLEN];
107         gdouble http_buffering_limit;
108         guint http_max_size_bytes;
109         gdouble http_buffering_time;
110         gint http_timeout;
111
112         /* rtsp streaming */
113         gchar name_of_rtspsrc[PLAYER_INI_MAX_STRLEN];
114         guint rtsp_buffering_time;
115         guint rtsp_rebuffering_time;
116         gboolean rtsp_do_typefinding;
117         gboolean rtsp_error_concealment; /* testing purpose */
118
119         /* hw accelation */
120         gboolean use_video_hw_accel;
121
122         /* priority */
123         gboolean use_priority_setting;
124         gint demux_priority;
125         gint audiosink_priority;
126         gint videosink_priority;
127         gint ringbuffer_priority;
128
129         /* subtitle */
130         gint mirroring_width;
131         gint mirroring_height;
132         guint font_color;
133         guint font_background_color;
134         gboolean external_subtitle;
135
136         /* dump buffer for debug */
137         gchar dump_element_keyword[PLAYER_INI_MAX_ELEMENT][PLAYER_INI_MAX_STRLEN];
138         gchar dump_element_path[PLAYER_INI_MAX_STRLEN];
139         gboolean set_dump_element_flag;
140 } mm_player_ini_t;
141
142 /* default values if each values are not specified in inifile */
143 /* general */
144 #define DEFAULT_AUDIO_EFFECT_ELEMENT                    ""
145 #define DEFAULT_USE_AUDIO_EFFECT_PRESET                 FALSE
146 #define DEFAULT_AUDIO_EFFECT_PRESET_LIST                ""
147 #define DEFAULT_AUDIO_EFFECT_PRESET_LIST_EARPHONE_ONLY  ""
148 #define DEFAULT_USE_AUDIO_EFFECT_CUSTOM                 FALSE
149 #define DEFAULT_AUDIO_EFFECT_CUSTOM_LIST                ""
150 #define DEFAULT_AUDIO_EFFECT_CUSTOM_LIST_EARPHONE_ONLY  ""
151 #define DEFAULT_AUDIO_EFFECT_CUSTOM_EQ_BAND_NUM         0
152 #define DEFAULT_AUDIO_EFFECT_CUSTOM_EQ_BAND_WIDTH               ""
153 #define DEFAULT_AUDIO_EFFECT_CUSTOM_EQ_BAND_FREQ                ""
154 #define DEFAULT_AUDIO_EFFECT_CUSTOM_EQ_MIN              0
155 #define DEFAULT_AUDIO_EFFECT_CUSTOM_EQ_MAX              0
156 #define DEFAULT_AUDIO_EFFECT_CUSTOM_EXT_NUM             0
157 #define DEFAULT_USE_AUDIO_EFFECT_SQUARE                 FALSE
158 #define DEFAULT_AUDIO_EFFECT_SQUARE_ROW_MAX             0
159 #define DEFAULT_AUDIO_EFFECT_SQUARE_COL_MAX             0
160 #define DEFAULT_USE_SINK_HANDLER                        TRUE
161 #define DEFAULT_SKIP_RESCAN                             TRUE
162 #define DEFAULT_GENERATE_DOT                            FALSE
163 #define DEFAULT_PROVIDE_CLOCK_FOR_MUSIC         TRUE
164 #define DEFAULT_PROVIDE_CLOCK_FOR_MOVIE         FALSE
165 #define DEFAULT_DELAY_BEFORE_REPEAT                     50 /* msec */
166 #define DEFAULT_EOS_DELAY                               150 /* msec */
167 #define DEFAULT_DRMSRC                                  "drmsrc"
168 #define DEFAULT_VIDEOSINK_X                             "xvimagesink"
169 #define DEFAULT_VIDEOSINK_EVAS                          "evasimagesink"
170 #define DEFAULT_VIDEOSINK_FAKE                          "fakesink"
171 #define DEFAULT_AUDIORESAMPLER                  "audioresample"
172 #define DEFAULT_AUDIOSINK                               "avsysaudiosink"
173 #define DEFAULT_GST_PARAM                               ""
174 #define DEFAULT_EXCLUDE_KEYWORD                         ""
175 #define DEFAULT_ASYNC_START                             TRUE
176 #define DEFAULT_DISABLE_SEGTRAP                         TRUE
177 #define DEFAULT_VIDEO_CONVERTER                         ""
178 #define DEFAULT_MULTIPLE_CODEC_SUPPORTED                TRUE
179 #define DEFAULT_LIVE_STATE_CHANGE_TIMEOUT               30 /* sec */
180 #define DEFAULT_LOCALPLAYBACK_STATE_CHANGE_TIMEOUT      10 /* sec */
181 /* http streaming */
182 #define DEFAULT_HTTPSRC                         "souphttpsrc"
183 #define DEFAULT_HTTP_FILE_BUFFER_PATH           "/opt/usr/media"
184 #define DEFAULT_HTTP_BUFFERING_LIMIT    99.0            /* percent */
185 #define DEFAULT_HTTP_MAX_SIZE_BYTES             1048576         /* bytes : 1 MBytes  */
186 #define DEFAULT_HTTP_BUFFERING_TIME             1.2                     /* sec */
187 #define DEFAULT_HTTP_TIMEOUT                    -1                      /* infinite retry */
188 /* rtsp streaming */
189 #define DEFAULT_RTSPSRC                         "secrtspsrc"
190 #define DEFAULT_RTSP_BUFFERING                  5000    /* msec */
191 #define DEFAULT_RTSP_REBUFFERING                15000   /* msec */
192 #define DEFAULT_RTSP_DO_TYPEFINDING             FALSE
193 #define DEFAULT_RTSP_ERROR_CONCEALMENT          TRUE
194 /* hw accel */
195 #define DEFAULT_USE_VIDEO_HW_ACCEL      FALSE
196 /* priority */
197 #define DEFAULT_USE_PRIORITY_SETTING    FALSE
198 #define DEFAULT_PRIORITY_DEMUX          96
199 #define DEFAULT_PRIORITY_VIDEO_SINK     97
200 #define DEFAULT_PRIORITY_AUDIO_SINK     98
201 #define DEFAULT_PRIORITY_RINGBUFFER     99
202 /* subtitle */
203 #define DEFAULT_MIRRORING_WIDTH                 1920
204 #define DEFAULT_MIRRORING_HEIGHT                        1080
205 #define DEFAULT_FONT_COLOR              "0xffffffff"
206 #define DEFAULT_FONT_BACKGROUND_COLOR           "0x0"
207 #define DEFAULT_EXTERNAL_SUBTITLE               FALSE
208
209 /* dump buffer for debug */
210 #define DEFAULT_DUMP_ELEMENT_KEYWORD                            ""
211 #define DEFAULT_DUMP_ELEMENT_PATH                               "/opt/usr/media/"
212
213 /* NOTE : following content should be same with above default values */
214 /* FIXIT : need smarter way to generate default ini file. */
215 /* FIXIT : finally, it should be an external file */
216 #define MM_PLAYER_DEFAULT_INI \
217 "\
218 [general] \n\
219 \n\
220 use sink handler = yes \n\
221 \n\
222 disable segtrap = yes ; same effect with --gst-disable-segtrap \n\
223 \n\
224 ; set default video sink but, it can be replaced with others selected by application\n\
225 ; 0:v4l2sink, 1:ximagesink, 2:xvimagesink, 3:fakesink 4:evasimagesink 5:glimagesink\n\
226 videosink element = 2 \n\
227 \n\
228 video converter element = \n\
229 \n\
230 audiosink element = avsysaudiosink \n\
231 \n\
232 drmsrc element = drmsrc \n\
233 \n\
234 ; if yes. gstreamer will not update registry \n\
235 skip rescan = yes \n\
236 \n\
237 delay before repeat = 50 ; msec\n\
238 \n\
239 ; comma separated list of tocken which elemnts has it in it's name will not be used \n\
240 element exclude keyword = \n\
241 \n\
242 async start = yes \n\
243 \n\
244 multiple codec supported = yes \n\
245 \n\
246 ; parameters for initializing gstreamer \n\
247 gstparam1 = \n\
248 gstparam2 = \n\
249 gstparam3 = \n\
250 gstparam4 = \n\
251 gstparam5 = \n\
252 \n\
253 ; generating dot file representing pipeline state \n\
254 generate dot = no \n\
255 \n\
256 ; parameter for clock provide in audiosink \n\
257 provide clock for music = yes \n\
258 provide clock for movie = no \n\
259 \n\
260 ; allowed timeout for changing pipeline state \n\
261 live state change timeout = 30 ; sec \n\
262 localplayback state change timeout = 4 ; sec \n\
263 \n\
264 ; delay in msec for sending EOS \n\
265 eos delay = 150 ; msec \n\
266 \n\
267 \n\
268 [http streaming] \n\
269 \n\
270 httppsrc element = souphttpsrc \n\
271 \n\
272 ; if set, use file or not use memory for buffering\n\
273 http file buffer path = /opt/usr/media\n\
274 \n\
275 http buffering limit = 99 ; percent\n\
276 \n\
277 http max size bytes = 1048576 ; bytes\n\
278 \n\
279 http buffering time = 1.2 \n\
280 \n\
281 http timeout = -1 ; infinite retry \n\
282 \n\
283 \n\
284 [rtsp streaming] \n\
285 \n\
286 rtspsrc element = secrtspsrc \n\
287 \n\
288 rtsp buffering time = 5000; msec \n\
289 \n\
290 rtsp rebuffering time = 15000; msec \n\
291 \n\
292 rtsp do typefinding = no; if no, caps on rtspsrc:src pad will be used for autoplugging \n\
293 \n\
294 rtsp error concealment = yes \n\
295 \n\
296 \n\
297 [hw accelation] \n\
298 use video hw accel = yes \n\
299 \n\
300 \n\
301 [priority] \n\
302 \n\
303 use priority setting = no \n\
304 \n\
305 demux = 95 \n\
306 \n\
307 videosink = 96 \n\
308 \n\
309 audiosink = 97\n\
310 \n\
311 ringbuffer = 98 \n\
312 \n\
313 \n\
314 [subtitle] \n\
315 \n\
316 mirroring width = 1920 \n\
317 \n\
318 mirroring height = 1080 \n\
319 \n\
320 font color = 0xffffffff \n\
321 \n\
322 font background color = 0x00000000 \n\
323 \n\
324 "
325
326 int
327 mm_player_ini_load(mm_player_ini_t* ini);
328
329 int
330 mm_player_audio_effect_ini_load(mm_player_ini_t* ini);
331
332 #ifdef __cplusplus
333         }
334 #endif
335
336 #endif