4 * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
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>
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
13 * http://www.apache.org/licenses/LICENSE-2.0
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.
23 #ifndef __MM_PLAYER_INI_H__
24 #define __MM_PLAYER_INI_H__
28 #include "mm_player_audioeffect.h"
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"
38 #define PLAYER_INI_MAX_STRLEN 100
39 #define PLAYER_INI_MAX_PARAM_STRLEN 256
41 #define PLAYER_INI_MAX_ELEMENT 10
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.
52 KEYWORD_EXCLUDE, // for element exclude keyworld
53 KEYWORD_DUMP // for dump element keyworld
56 /* @ mark means the item has tested */
57 typedef struct __mm_player_ini
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];
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;
75 gboolean multiple_codec_supported;
77 gchar gst_param[5][PLAYER_INI_MAX_PARAM_STRLEN];
78 gchar exclude_element_keyword[PLAYER_INI_MAX_ELEMENT][PLAYER_INI_MAX_STRLEN];
80 gboolean disable_segtrap;
83 gchar name_of_audio_effect[PLAYER_INI_MAX_STRLEN];
84 gchar name_of_audio_effect_sec[PLAYER_INI_MAX_STRLEN];
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];
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];
100 gboolean use_audio_effect_square;
101 gint audio_effect_square_max_row;
102 gint audio_effect_square_max_col;
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;
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 */
120 gboolean use_video_hw_accel;
123 gboolean use_priority_setting;
125 gint audiosink_priority;
126 gint videosink_priority;
127 gint ringbuffer_priority;
130 gint mirroring_width;
131 gint mirroring_height;
133 guint font_background_color;
134 gboolean external_subtitle;
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;
142 /* default values if each values are not specified in inifile */
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 */
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 */
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
195 #define DEFAULT_USE_VIDEO_HW_ACCEL FALSE
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
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
209 /* dump buffer for debug */
210 #define DEFAULT_DUMP_ELEMENT_KEYWORD ""
211 #define DEFAULT_DUMP_ELEMENT_PATH "/opt/usr/media/"
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 \
220 use sink handler = yes \n\
222 disable segtrap = yes ; same effect with --gst-disable-segtrap \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\
228 video converter element = \n\
230 audiosink element = avsysaudiosink \n\
232 drmsrc element = drmsrc \n\
234 ; if yes. gstreamer will not update registry \n\
235 skip rescan = yes \n\
237 delay before repeat = 50 ; msec\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\
242 async start = yes \n\
244 multiple codec supported = yes \n\
246 ; parameters for initializing gstreamer \n\
253 ; generating dot file representing pipeline state \n\
254 generate dot = no \n\
256 ; parameter for clock provide in audiosink \n\
257 provide clock for music = yes \n\
258 provide clock for movie = no \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\
264 ; delay in msec for sending EOS \n\
265 eos delay = 150 ; msec \n\
270 httppsrc element = souphttpsrc \n\
272 ; if set, use file or not use memory for buffering\n\
273 http file buffer path = /opt/usr/media\n\
275 http buffering limit = 99 ; percent\n\
277 http max size bytes = 1048576 ; bytes\n\
279 http buffering time = 1.2 \n\
281 http timeout = -1 ; infinite retry \n\
286 rtspsrc element = secrtspsrc \n\
288 rtsp buffering time = 5000; msec \n\
290 rtsp rebuffering time = 15000; msec \n\
292 rtsp do typefinding = no; if no, caps on rtspsrc:src pad will be used for autoplugging \n\
294 rtsp error concealment = yes \n\
298 use video hw accel = yes \n\
303 use priority setting = no \n\
316 mirroring width = 1920 \n\
318 mirroring height = 1080 \n\
320 font color = 0xffffffff \n\
322 font background color = 0x00000000 \n\
327 mm_player_ini_load(mm_player_ini_t* ini);
330 mm_player_audio_effect_ini_load(mm_player_ini_t* ini);