[v0.6.10] remove evas from ini
[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 #ifdef LOG_TAG
35 #undef LOG_TAG
36 #endif
37 #define LOG_TAG "MM_PLAYER"
38
39 #define MM_PLAYER_INI_DEFAULT_PATH      SYSCONFDIR"/multimedia/mmfw_player.ini" /* SYSCONFDIR is defined at .spec */
40 #define MM_PLAYER_INI_DEFAULT_AUDIOEFFECT_PATH  SYSCONFDIR"/multimedia/mmfw_player_audio_effect.ini" /* SYSCONFDIR is defined at .spec */
41
42 #define PLAYER_INI_MAX_STRLEN   100
43 #define PLAYER_INI_MAX_PARAM_STRLEN     256
44
45 #define PLAYER_INI_MAX_ELEMENT  10
46
47 /* NOTE : MMPlayer has no initalizing API for library itself
48  * so we cannot decide when those ini values to be released.
49  * this is the reason of all string items are static array.
50  * make it do with malloc when MMPlayerInitialize() API created
51  * before that time, we should be careful with size limitation
52  * of each string item.
53  */
54 enum keyword_type {
55         KEYWORD_EXCLUDE,        // for element exclude keyworld
56         KEYWORD_DUMP            // for dump element keyworld
57 };
58
59 typedef struct __mm_player_ini {
60         /* general */
61         gchar videosink_element_overlay[PLAYER_INI_MAX_STRLEN];
62         gchar videosink_element_fake[PLAYER_INI_MAX_STRLEN];
63         gchar videoconverter_element[PLAYER_INI_MAX_STRLEN];
64         gchar videocodec_element_hw[PLAYER_INI_MAX_STRLEN];
65         gchar audioresampler_element[PLAYER_INI_MAX_STRLEN];
66         gchar audiosink_element[PLAYER_INI_MAX_STRLEN];
67         gboolean skip_rescan;
68         gboolean generate_dot;
69         gboolean use_system_clock;
70         gint live_state_change_timeout;
71         gint localplayback_state_change_timeout;
72         gint delay_before_repeat;
73         gint eos_delay;
74         gboolean video_playback_supported;
75
76         gchar gst_param[5][PLAYER_INI_MAX_PARAM_STRLEN];
77         gchar exclude_element_keyword[PLAYER_INI_MAX_ELEMENT][PLAYER_INI_MAX_STRLEN];
78         gboolean async_start;
79         gboolean disable_segtrap;
80         gint pcm_buffer_size;
81         gint num_of_video_bo;
82         gint video_bo_timeout;
83
84         /* http streaming */
85         gchar httpsrc_element[PLAYER_INI_MAX_STRLEN];
86         gboolean http_use_file_buffer;
87         guint http_ring_buffer_size;
88         gdouble http_buffering_limit;
89         guint http_max_size_bytes;
90         gdouble http_buffering_time;
91         gint http_timeout;
92
93         /* audio effect */
94         gchar audioeffect_element[PLAYER_INI_MAX_STRLEN];
95         gchar audioeffect_element_custom[PLAYER_INI_MAX_STRLEN];
96
97         /* audio effect preset mode */
98         gboolean use_audio_effect_preset;
99         gboolean audio_effect_preset_list[MM_AUDIO_EFFECT_PRESET_NUM];
100         gboolean audio_effect_preset_earphone_only_list[MM_AUDIO_EFFECT_PRESET_NUM];
101
102         /* audio effect custom mode */
103         gboolean use_audio_effect_custom;
104         gboolean audio_effect_custom_list[MM_AUDIO_EFFECT_CUSTOM_NUM];
105         gboolean audio_effect_custom_earphone_only_list[MM_AUDIO_EFFECT_CUSTOM_NUM];
106         gint audio_effect_custom_eq_band_num;
107         gint audio_effect_custom_eq_band_width[MM_AUDIO_EFFECT_EQ_BAND_NUM_MAX];
108         gint audio_effect_custom_eq_band_freq[MM_AUDIO_EFFECT_EQ_BAND_NUM_MAX];
109         gint audio_effect_custom_ext_num;
110         gint audio_effect_custom_min_level_list[MM_AUDIO_EFFECT_CUSTOM_NUM];
111         gint audio_effect_custom_max_level_list[MM_AUDIO_EFFECT_CUSTOM_NUM];
112
113         /* dump buffer for debug */
114         gchar dump_element_keyword[PLAYER_INI_MAX_ELEMENT][PLAYER_INI_MAX_STRLEN];
115         gchar dump_element_path[PLAYER_INI_MAX_STRLEN];
116         gboolean set_dump_element_flag;
117 } mm_player_ini_t;
118
119 /* default values if each values are not specified in inifile */
120 /* general */
121 #define DEFAULT_AUDIO_EFFECT_ELEMENT                    ""
122 #define DEFAULT_USE_AUDIO_EFFECT_PRESET                 FALSE
123 #define DEFAULT_AUDIO_EFFECT_PRESET_LIST                ""
124 #define DEFAULT_AUDIO_EFFECT_PRESET_LIST_EARPHONE_ONLY  ""
125 #define DEFAULT_USE_AUDIO_EFFECT_CUSTOM                 FALSE
126 #define DEFAULT_AUDIO_EFFECT_CUSTOM_LIST                ""
127 #define DEFAULT_AUDIO_EFFECT_CUSTOM_LIST_EARPHONE_ONLY  ""
128 #define DEFAULT_AUDIO_EFFECT_CUSTOM_EQ_BAND_NUM         0
129 #define DEFAULT_AUDIO_EFFECT_CUSTOM_EQ_BAND_WIDTH               ""
130 #define DEFAULT_AUDIO_EFFECT_CUSTOM_EQ_BAND_FREQ                ""
131 #define DEFAULT_AUDIO_EFFECT_CUSTOM_EQ_MIN              0
132 #define DEFAULT_AUDIO_EFFECT_CUSTOM_EQ_MAX              0
133 #define DEFAULT_AUDIO_EFFECT_CUSTOM_EXT_NUM             0
134 #define DEFAULT_USE_SINK_HANDLER                        TRUE
135 #define DEFAULT_SKIP_RESCAN                             TRUE
136 #define DEFAULT_GENERATE_DOT                            FALSE
137 #define DEFAULT_USE_SYSTEM_CLOCK                TRUE
138 #define DEFAULT_DELAY_BEFORE_REPEAT                     50 /* msec */
139 #define DEFAULT_EOS_DELAY                               0 /* msec */
140 #define DEFAULT_VIDEOSINK_OVERLAY                       "waylandsink"
141 #define DEFAULT_VIDEOSINK_EVAS                          "evasimagesink"
142 #define DEFAULT_VIDEOSINK_FAKE                          "fakesink"
143 #define DEFAULT_AUDIORESAMPLER                  "audioresample"
144 #define DEFAULT_AUDIOSINK                               "pulsesink"
145 #define DEFAULT_VIDEOCODEC_HW                   ""
146 #define DEFAULT_GST_PARAM                               ""
147 #define DEFAULT_EXCLUDE_KEYWORD                 ""
148 #define DEFAULT_ASYNC_START                             TRUE
149 #define DEFAULT_DISABLE_SEGTRAP                         TRUE
150 #define DEFAULT_VIDEO_CONVERTER                         ""
151 #define DEFAULT_VIDEO_PLAYBACK_SUPPORTED                                TRUE
152 #define DEFAULT_LIVE_STATE_CHANGE_TIMEOUT               30 /* sec */
153 #define DEFAULT_LOCALPLAYBACK_STATE_CHANGE_TIMEOUT      10 /* sec */
154 #define DEFAULT_PCM_BUFFER_SIZE                 51200 /* bytes */
155 #define DEFAULT_NUM_OF_VIDEO_BO                 10
156 #define DEFAULT_TIMEOUT_OF_VIDEO_BO             10 /* sec */
157
158 /* http streaming */
159 #define DEFAULT_HTTPSRC                         "souphttpsrc"
160 #define DEFAULT_HTTP_USE_FILE_BUFFER    FALSE
161 #define DEFAULT_HTTP_RING_BUFFER_SIZE   (20*1024*1024) /* bytes : 20MBytes */
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
167 /* dump buffer for debug */
168 #define DEFAULT_DUMP_ELEMENT_KEYWORD                            ""
169 #define DEFAULT_DUMP_ELEMENT_PATH                               "/tmp/"
170
171 /* NOTE : following content should be same with above default values */
172 /* FIXIT : need smarter way to generate default ini file. */
173 /* FIXIT : finally, it should be an external file */
174 #define MM_PLAYER_DEFAULT_INI \
175 "\
176 [general] \n\
177 \n\
178 disable segtrap = yes ; same effect with --gst-disable-segtrap \n\
179 \n\
180 ; set default video sink but, it can be replaced with others selected by application\n\
181 ; 0:v4l2sink, 1:ximagesink, 2:xvimagesink, 3:fakesink 4:evasimagesink 5:glimagesink\n\
182 videosink element = 2 \n\
183 \n\
184 video converter element = \n\
185 \n\
186 audiosink element = pulsesink \n\
187 \n\
188 ; if yes. gstreamer will not update registry \n\
189 skip rescan = yes \n\
190 \n\
191 delay before repeat = 50 ; msec\n\
192 \n\
193 ; comma separated list of tocken which elemnts has it in it's name will not be used \n\
194 element exclude keyword = \n\
195 \n\
196 async start = yes \n\
197 \n\
198 ; parameters for initializing gstreamer \n\
199 gstparam1 = --gst-debug=2\n\
200 gstparam2 = \n\
201 gstparam3 = \n\
202 gstparam4 = \n\
203 gstparam5 = \n\
204 \n\
205 ; generating dot file representing pipeline state \n\
206 ; export GST_DEBUG_DUMP_DOT_DIR=/tmp/\n\
207 generate dot = no \n\
208 \n\
209 ; parameter is for only video to be determined \n\
210 ; which clock will be used \n\
211 ; if yes, system clock will be used \n\
212 ; apart from this, audiosink is clock provider for audio \n\
213 use system clock = yes \n\
214 \n\
215 ; allowed timeout for changing pipeline state \n\
216 live state change timeout = 30 ; sec \n\
217 localplayback state change timeout = 4 ; sec \n\
218 \n\
219 ; delay in msec for sending EOS \n\
220 eos delay = 150 ; msec \n\
221 \n\
222 \n\
223 [http streaming] \n\
224 \n\
225 httppsrc element = souphttpsrc \n\
226 \n\
227 ; if yes, use file for buffering.\n\
228 ; if no, use memory for buffering.\n\
229 http use file buffer = no\n\
230 \n\
231 ; ring buffer size when use mem buffer \n\
232 http ring buffer size = 20971520 ; 20MBytes \n\
233 \n\
234 http buffering limit = 99 ; percent\n\
235 \n\
236 http max size bytes = 1048576 ; bytes\n\
237 \n\
238 http buffering time = 1.2 \n\
239 \n\
240 http timeout = -1 ; infinite retry \n\
241 \n\
242 "
243
244 int
245 mm_player_ini_load(mm_player_ini_t* ini);
246
247 int
248 mm_player_audio_effect_ini_load(mm_player_ini_t* ini);
249
250 #ifdef __cplusplus
251         }
252 #endif
253
254 #endif