change default evassink
[platform/core/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_video_converter[PLAYER_INI_MAX_STRLEN];
66         gboolean skip_rescan;
67         gboolean generate_dot;
68         gboolean provide_clock_for_music;
69         gboolean provide_clock_for_movie;
70         gint live_state_change_timeout;
71         gint localplayback_state_change_timeout;
72         gint delay_before_repeat;
73         gint eos_delay;
74
75         gchar gst_param[5][PLAYER_INI_MAX_PARAM_STRLEN];
76         gchar exclude_element_keyword[PLAYER_INI_MAX_ELEMENT][PLAYER_INI_MAX_STRLEN];
77         gboolean async_start;
78         gboolean disable_segtrap;
79
80         /* audio effect */
81         gchar name_of_audio_effect[PLAYER_INI_MAX_STRLEN];
82         gchar name_of_audio_effect_sec[PLAYER_INI_MAX_STRLEN];
83
84         gboolean use_audio_effect_preset;
85         gboolean audio_effect_preset_list[MM_AUDIO_EFFECT_PRESET_NUM];
86         gboolean audio_effect_preset_earphone_only_list[MM_AUDIO_EFFECT_PRESET_NUM];
87
88         gboolean use_audio_effect_custom;
89         gboolean audio_effect_custom_list[MM_AUDIO_EFFECT_CUSTOM_NUM];
90         gboolean audio_effect_custom_earphone_only_list[MM_AUDIO_EFFECT_CUSTOM_NUM];
91         gint audio_effect_custom_eq_band_num;
92         gint audio_effect_custom_eq_band_width[MM_AUDIO_EFFECT_EQ_BAND_NUM_MAX];
93         gint audio_effect_custom_eq_band_freq[MM_AUDIO_EFFECT_EQ_BAND_NUM_MAX];
94         gint audio_effect_custom_ext_num;
95         gint audio_effect_custom_min_level_list[MM_AUDIO_EFFECT_CUSTOM_NUM];
96         gint audio_effect_custom_max_level_list[MM_AUDIO_EFFECT_CUSTOM_NUM];
97
98         gboolean use_audio_effect_square;
99         gint audio_effect_square_max_row;
100         gint audio_effect_square_max_col;
101
102         /* http streaming */
103         gchar name_of_httpsrc[PLAYER_INI_MAX_STRLEN];
104         gchar http_file_buffer_path[PLAYER_INI_MAX_STRLEN];
105         gdouble http_buffering_limit;
106         guint http_max_size_bytes;
107         gdouble http_buffering_time;
108         gint http_timeout;
109
110         /* rtsp streaming */
111         gchar name_of_rtspsrc[PLAYER_INI_MAX_STRLEN];
112         guint rtsp_buffering_time;
113         guint rtsp_rebuffering_time;
114         gboolean rtsp_do_typefinding;
115
116         /* dump buffer for debug */
117         gchar dump_element_keyword[PLAYER_INI_MAX_ELEMENT][PLAYER_INI_MAX_STRLEN];
118         gchar dump_element_path[PLAYER_INI_MAX_STRLEN];
119         gboolean set_dump_element_flag;
120 } mm_player_ini_t;
121
122 /* default values if each values are not specified in inifile */
123 /* general */
124 #define DEFAULT_AUDIO_EFFECT_ELEMENT                    ""
125 #define DEFAULT_USE_AUDIO_EFFECT_PRESET                 FALSE
126 #define DEFAULT_AUDIO_EFFECT_PRESET_LIST                ""
127 #define DEFAULT_AUDIO_EFFECT_PRESET_LIST_EARPHONE_ONLY  ""
128 #define DEFAULT_USE_AUDIO_EFFECT_CUSTOM                 FALSE
129 #define DEFAULT_AUDIO_EFFECT_CUSTOM_LIST                ""
130 #define DEFAULT_AUDIO_EFFECT_CUSTOM_LIST_EARPHONE_ONLY  ""
131 #define DEFAULT_AUDIO_EFFECT_CUSTOM_EQ_BAND_NUM         0
132 #define DEFAULT_AUDIO_EFFECT_CUSTOM_EQ_BAND_WIDTH               ""
133 #define DEFAULT_AUDIO_EFFECT_CUSTOM_EQ_BAND_FREQ                ""
134 #define DEFAULT_AUDIO_EFFECT_CUSTOM_EQ_MIN              0
135 #define DEFAULT_AUDIO_EFFECT_CUSTOM_EQ_MAX              0
136 #define DEFAULT_AUDIO_EFFECT_CUSTOM_EXT_NUM             0
137 #define DEFAULT_USE_AUDIO_EFFECT_SQUARE                 FALSE
138 #define DEFAULT_AUDIO_EFFECT_SQUARE_ROW_MAX             0
139 #define DEFAULT_AUDIO_EFFECT_SQUARE_COL_MAX             0
140 #define DEFAULT_USE_SINK_HANDLER                        TRUE
141 #define DEFAULT_SKIP_RESCAN                             TRUE
142 #define DEFAULT_GENERATE_DOT                            FALSE
143 #define DEFAULT_PROVIDE_CLOCK_FOR_MUSIC         TRUE
144 #define DEFAULT_PROVIDE_CLOCK_FOR_MOVIE         FALSE
145 #define DEFAULT_DELAY_BEFORE_REPEAT                     50 /* msec */
146 #define DEFAULT_EOS_DELAY                               150 /* msec */
147 #define DEFAULT_VIDEOSINK_X                             "xvimagesink"
148 #define DEFAULT_VIDEOSINK_EVAS                          "evaspixmapsink"
149 #define DEFAULT_VIDEOSINK_FAKE                          "fakesink"
150 #define DEFAULT_AUDIORESAMPLER                  "audioresample"
151 #define DEFAULT_AUDIOSINK                               "pulsesink"
152 #define DEFAULT_GST_PARAM                               ""
153 #define DEFAULT_EXCLUDE_KEYWORD                         ""
154 #define DEFAULT_ASYNC_START                             TRUE
155 #define DEFAULT_DISABLE_SEGTRAP                         TRUE
156 #define DEFAULT_VIDEO_CONVERTER                         ""
157 #define DEFAULT_LIVE_STATE_CHANGE_TIMEOUT               30 /* sec */
158 #define DEFAULT_LOCALPLAYBACK_STATE_CHANGE_TIMEOUT      10 /* sec */
159 /* http streaming */
160 #define DEFAULT_HTTPSRC                         "souphttpsrc"
161 #define DEFAULT_HTTP_FILE_BUFFER_PATH           "/opt/usr/media"
162 #define DEFAULT_HTTP_BUFFERING_LIMIT    99.0            /* percent */
163 #define DEFAULT_HTTP_MAX_SIZE_BYTES             1048576         /* bytes : 1 MBytes  */
164 #define DEFAULT_HTTP_BUFFERING_TIME             1.2                     /* sec */
165 #define DEFAULT_HTTP_TIMEOUT                    -1                      /* infinite retry */
166 /* rtsp streaming */
167 #define DEFAULT_RTSPSRC                         "secrtspsrc"
168 #define DEFAULT_RTSP_BUFFERING                  5000    /* msec */
169 #define DEFAULT_RTSP_REBUFFERING                15000   /* msec */
170 #define DEFAULT_RTSP_DO_TYPEFINDING             FALSE
171
172 /* dump buffer for debug */
173 #define DEFAULT_DUMP_ELEMENT_KEYWORD                            ""
174 #define DEFAULT_DUMP_ELEMENT_PATH                               "/opt/usr/media/"
175
176 /* NOTE : following content should be same with above default values */
177 /* FIXIT : need smarter way to generate default ini file. */
178 /* FIXIT : finally, it should be an external file */
179 #define MM_PLAYER_DEFAULT_INI \
180 "\
181 [general] \n\
182 \n\
183 disable segtrap = yes ; same effect with --gst-disable-segtrap \n\
184 \n\
185 ; set default video sink but, it can be replaced with others selected by application\n\
186 ; 0:v4l2sink, 1:ximagesink, 2:xvimagesink, 3:fakesink 4:evasimagesink 5:glimagesink\n\
187 videosink element = 2 \n\
188 \n\
189 video converter element = \n\
190 \n\
191 audiosink element = pulsesink \n\
192 \n\
193 ; if yes. gstreamer will not update registry \n\
194 skip rescan = yes \n\
195 \n\
196 delay before repeat = 50 ; msec\n\
197 \n\
198 ; comma separated list of tocken which elemnts has it in it's name will not be used \n\
199 element exclude keyword = \n\
200 \n\
201 async start = yes \n\
202 \n\
203 ; parameters for initializing gstreamer \n\
204 gstparam1 = \n\
205 gstparam2 = \n\
206 gstparam3 = \n\
207 gstparam4 = \n\
208 gstparam5 = \n\
209 \n\
210 ; generating dot file representing pipeline state \n\
211 generate dot = no \n\
212 \n\
213 ; parameter for clock provide in audiosink \n\
214 provide clock for music = yes \n\
215 provide clock for movie = no \n\
216 \n\
217 ; allowed timeout for changing pipeline state \n\
218 live state change timeout = 30 ; sec \n\
219 localplayback state change timeout = 4 ; sec \n\
220 \n\
221 ; delay in msec for sending EOS \n\
222 eos delay = 150 ; msec \n\
223 \n\
224 \n\
225 [http streaming] \n\
226 \n\
227 httppsrc element = souphttpsrc \n\
228 \n\
229 ; if set, use file or not use memory for buffering\n\
230 http file buffer path = /opt/usr/media\n\
231 \n\
232 http buffering limit = 99 ; percent\n\
233 \n\
234 http max size bytes = 1048576 ; bytes\n\
235 \n\
236 http buffering time = 1.2 \n\
237 \n\
238 http timeout = -1 ; infinite retry \n\
239 \n\
240 \n\
241 [rtsp streaming] \n\
242 \n\
243 rtspsrc element = secrtspsrc \n\
244 \n\
245 rtsp buffering time = 5000; msec \n\
246 \n\
247 rtsp rebuffering time = 15000; msec \n\
248 \n\
249 rtsp do typefinding = no; if no, caps on rtspsrc:src pad will be used for autoplugging \n\
250 \n\
251 "
252
253 int
254 mm_player_ini_load(mm_player_ini_t* ini);
255
256 int
257 mm_player_audio_effect_ini_load(mm_player_ini_t* ini);
258
259 #ifdef __cplusplus
260         }
261 #endif
262
263 #endif