[0.6.286] Change the property name for setting max-bitrate used in adaptivedemux
[platform/core/multimedia/libmm-player.git] / src / include / mm_player_audioeffect.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_AUDIOEFFECT_H__
24 #define __MM_PLAYER_AUDIOEFFECT_H__
25
26 #include <mm_types.h>
27
28 #ifdef __cplusplus
29         extern "C" {
30 #endif
31
32 #define MM_AUDIO_EFFECT_EQ_BAND_NUM_MAX         10
33 #define MM_AUDIO_EFFECT_CUSTOM_LEVEL_INIT       0
34
35 #define MM_AUDIO_EFFECT_SQUARE_VALUE_MAX        4
36 #define MM_AUDIO_EFFECT_SQUARE_VALUE_MIN        0
37
38 /**
39         @addtogroup PLAYER_INTERNAL
40
41 */
42
43 /**
44  * Enumerations of Audio Effect Preset Type
45  */
46 typedef enum {
47         MM_AUDIO_EFFECT_PRESET_AUTO = 0,     /**<  Preset type Auto */
48         MM_AUDIO_EFFECT_PRESET_NORMAL,       /**<  Preset type Normal */
49         MM_AUDIO_EFFECT_PRESET_POP,          /**<  Preset type Pop */
50         MM_AUDIO_EFFECT_PRESET_ROCK,         /**<  Preset type Rock */
51         MM_AUDIO_EFFECT_PRESET_DANCE,        /**<  Preset type Dance */
52         MM_AUDIO_EFFECT_PRESET_JAZZ,         /**<  Preset type Jazz */
53         MM_AUDIO_EFFECT_PRESET_CLASSIC,      /**<  Preset type Classic */
54         MM_AUDIO_EFFECT_PRESET_VOCAL,        /**<  Preset type Vocal */
55         MM_AUDIO_EFFECT_PRESET_BASS_BOOST,   /**<  Preset type Bass Boost */
56         MM_AUDIO_EFFECT_PRESET_TREBLE_BOOST, /**<  Preset type Treble Boost */
57         MM_AUDIO_EFFECT_PRESET_MTHEATER,     /**<  Preset type MTheater */
58         MM_AUDIO_EFFECT_PRESET_EXT,          /**<  Preset type Externalization */
59         MM_AUDIO_EFFECT_PRESET_CAFE,         /**<  Preset type Cafe */
60         MM_AUDIO_EFFECT_PRESET_CONCERT_HALL, /**<  Preset type Concert Hall */
61         MM_AUDIO_EFFECT_PRESET_VOICE,        /**<  Preset type Voice */
62         MM_AUDIO_EFFECT_PRESET_MOVIE,        /**<  Preset type Movie */
63         MM_AUDIO_EFFECT_PRESET_VIRT51,       /**<  Preset type Virtual 5.1 */
64         MM_AUDIO_EFFECT_PRESET_HIPHOP,       /**<  Preset type HipHop */
65         MM_AUDIO_EFFECT_PRESET_RNB,          /**<  Preset type R&B */
66         MM_AUDIO_EFFECT_PRESET_FLAT,         /**<  Preset type Flat */
67         MM_AUDIO_EFFECT_PRESET_TUBE,         /**<  Preset type Tube */
68         MM_AUDIO_EFFECT_PRESET_VIRT71,       /**<  Preset type Virtual 7.1 */
69         MM_AUDIO_EFFECT_PRESET_STUDIO,       /**<  Preset type Studio */
70         MM_AUDIO_EFFECT_PRESET_CLUB,         /**<  Preset type Club */
71         MM_AUDIO_EFFECT_PRESET_NUM,          /**<  Number of Preset type */
72 } mm_audio_effect_preset_type_e;
73
74 /**
75  * Enumerations of Audio Effect Custom Type
76  */
77 typedef enum {
78         MM_AUDIO_EFFECT_CUSTOM_EQ = 0,       /**<  Custom type Equalizer */
79         MM_AUDIO_EFFECT_CUSTOM_3D,           /**<  Custom type 3D */
80         MM_AUDIO_EFFECT_CUSTOM_BASS,         /**<  Custom type Bass */
81         MM_AUDIO_EFFECT_CUSTOM_ROOM_SIZE,    /**<  Custom type Room Size */
82         MM_AUDIO_EFFECT_CUSTOM_REVERB_LEVEL, /**<  Custom type Reverb Level */
83         MM_AUDIO_EFFECT_CUSTOM_CLARITY,      /**<  Custom type Clarity */
84         MM_AUDIO_EFFECT_CUSTOM_NUM,          /**<  Number of Custom type */
85 } mm_audio_effect_custom_type_e;
86
87 /**
88  * Enumerations of Audio Effect Type
89  */
90 typedef enum {
91         MM_AUDIO_EFFECT_TYPE_NONE,
92         MM_AUDIO_EFFECT_TYPE_PRESET,
93         MM_AUDIO_EFFECT_TYPE_CUSTOM,
94         MM_AUDIO_EFFECT_TYPE_SQUARE,
95 } mm_audio_effect_type_e;
96
97
98 /**
99  * Enumerations of Output Mode
100  */
101 typedef enum {
102         MM_AUDIO_EFFECT_OUTPUT_SPK,    /**< Speaker out */
103         MM_AUDIO_EFFECT_OUTPUT_EAR,    /**< Earjack out */
104         MM_AUDIO_EFFECT_OUTPUT_OTHERS, /**< MIRRORING out */
105         MM_AUDIO_EFFECT_OUTPUT_BT,
106         MM_AUDIO_EFFECT_OUTPUT_DOCK,
107         MM_AUDIO_EFFECT_OUTPUT_MULTIMEDIA_DOCK,
108         MM_AUDIO_EFFECT_OUTPUT_USB_AUDIO,
109         MM_AUDIO_EFFECT_OUTPUT_HDMI,
110         MM_AUDIO_EFFECT_OUTPUT_NUM
111 } mm_audio_effect_output_mode_e;
112
113
114 /**
115  * Structure of AudioEffectInfo
116  */
117 typedef struct {
118         mm_audio_effect_type_e effect_type;      /**< effect type, (NONE,PRESET,CUSTOM)*/
119         mm_audio_effect_preset_type_e preset;     /**< for preset type*/
120         int *custom_ext_level_for_plugin;   /**< for custom type, level value list of Extension effects*/
121         int custom_eq_level[MM_AUDIO_EFFECT_EQ_BAND_NUM_MAX];   /**< for custom type, EQ info*/
122         int custom_ext_level[MM_AUDIO_EFFECT_CUSTOM_NUM-1];     /**< for custom type, Extension effect info*/
123         int square_row;    /**< for square type, square row configure*/
124         int square_col;    /**< for square type, square col configure*/
125 } mm_audio_effect_info_t;
126
127
128 /**
129  * @brief Called to get each supported audio effect.
130  *
131  * @param       effect_type     [in]    Type of effect (preset effect or custom effect).
132  * @param       effect          [in]    Supported audio effect.
133  * @param       user_data       [in]    Pointer of user data.
134  *
135  * @return      True to continue with the next iteration of the loop, False to break out of the loop.
136  * @see         mm_player_get_foreach_present_supported_effect_type()
137  */
138 typedef bool (*mmplayer_supported_audio_effect_cb)(int effect_type, int type, void *user_data);
139
140 /**
141  * This function is to get supported effect type.
142  *
143  * @param       hplayer         [in]    Handle of player.
144  * @param       effect_type     [in]    Type of effect.
145  * @param       foreach_cb      [in]    Callback function to be passed the result.
146  * @param       user_data       [in]    Pointer of user data.
147  *
148  * @return      This function returns zero on success, or negative value with error code.
149  *
150  * @remark
151  * @see
152  * @since
153  */
154 int mm_player_get_foreach_present_supported_effect_type(MMHandleType player, mm_audio_effect_type_e effect_type, mmplayer_supported_audio_effect_cb foreach_cb, void *user_data);
155
156 /**
157  * This function is to bypass audio effect.
158  *
159  * @param       hplayer         [in]    Handle of player.
160  *
161  * @return      This function returns zero on success, or negative value with error code.
162  *
163  * @remark
164  * @see
165  * @since
166  */
167 int mm_player_audio_effect_bypass(MMHandleType hplayer);
168
169 /**
170  * This function is to apply custom effect(Equalizer and Extension effects).
171  *
172  * @param       hplayer         [in]    Handle of player.
173  *
174  * @return      This function returns zero on success, or negative value with error code.
175  *
176  * @remark
177  * @see
178  * @since
179  */
180 int mm_player_audio_effect_custom_apply(MMHandleType hplayer);
181
182 /**
183  * This function is to clear Equalizer custom effect.
184  *
185  * @param       hplayer         [in]    Handle of player.
186  *
187  * @return      This function returns zero on success, or negative value with error code.
188  *
189  * @remark
190  * @see
191  * @since
192  */
193 int mm_player_audio_effect_custom_clear_eq_all(MMHandleType hplayer);
194
195 /**
196  * This function is to clear Extension custom effects.
197  *
198  * @param       hplayer         [in]    Handle of player.
199  *
200  * @return      This function returns zero on success, or negative value with error code.
201  *
202  * @remark
203  * @see
204  * @since
205  */
206 int mm_player_audio_effect_custom_clear_ext_all(MMHandleType hplayer);
207
208 /**
209  * This function is to get the number of equalizer bands.
210  *
211  * @param       hplayer         [in]    Handle of player.
212  * @param       bands           [out]   The number of bands.
213  *
214  * @return      This function returns zero on success, or negative value with error code.
215  *
216  * @remark
217  * @see
218  * @since
219  */
220 int mm_player_audio_effect_custom_get_eq_bands_number(MMHandleType hplayer, int *bands);
221
222 /**
223  * This function is to get width of equalizer band of each index.
224  *
225  * @param       hplayer         [in]    Handle of player.
226  * @param       band_idx        [in]    Index of band.
227  * @param       width           [out]   Value of width.
228  *
229  * @return      This function returns zero on success, or negative value with error code.
230  *
231  * @remark
232  * @see
233  * @since
234  */
235 int mm_player_audio_effect_custom_get_eq_bands_width(MMHandleType hplayer, int band_idx, int *width);
236
237 /**
238  * This function is to get frequency of equalizer band of each index.
239  *
240  * @param       hplayer         [in]    Handle of player.
241  * @param       band_idx        [in]    Index of band.
242  * @param       freq            [out]   Value of frequency.
243  *
244  * @return      This function returns zero on success, or negative value with error code.
245  *
246  * @remark
247  * @see
248  * @since
249  */
250 int mm_player_audio_effect_custom_get_eq_bands_freq(MMHandleType hplayer, int band_idx, int *freq);
251
252 /**
253  * This function is to get the level of the custom effect.
254  *
255  * @param       hplayer         [in]    Handle of player.
256  * @param       type            [in]    Custom type effect.
257  * @param       eq_index        [in]    Equalizer band index. This parameter is available only when the type is MM_AUDIO_EFFECT_CUSTOM_EQ.
258  * @param       level           [out]   The level of the custom effect.
259  *
260  * @return      This function returns zero on success, or negative value with error code.
261  *
262  * @remark
263  * @see         mm_audio_effect_custom_type_e
264  * @since
265  */
266 int mm_player_audio_effect_custom_get_level(MMHandleType hplayer, mm_audio_effect_custom_type_e type, int eq_index, int *level);
267
268 /**
269  * This function is to get range of the level of the custom effect.
270  *
271  * @param       hplayer         [in]    Handle of player.
272  * @param       type            [in]    Custom type effect.
273  * @param       min             [out]   Minimal value of level.
274  * @param       max             [out]   Maximum value of level.
275  *
276  * @return      This function returns zero on success, or negative value with error code.
277  *
278  * @remark
279  * @see         mm_audio_effect_custom_type_e
280  * @since
281  */
282 int mm_player_audio_effect_custom_get_level_range(MMHandleType hplayer, mm_audio_effect_custom_type_e type, int *min, int *max);
283
284 /**
285  * This function is to set the level of the custom effect.
286  *
287  * @param       hplayer         [in]    Handle of player.
288  * @param       type            [in]    Custom type effect.
289  * @param       eq_index        [in]    Equalizer band index. This parameter is available only when the type is MM_AUDIO_EFFECT_CUSTOM_EQ.
290  * @param       level           [in]    The level of the custom effect.
291  *
292  * @return      This function returns zero on success, or negative value with error code.
293  *
294  * @remark
295  * @see         mm_audio_effect_custom_type_e
296  * @since
297  */
298 int mm_player_audio_effect_custom_set_level(MMHandleType hplayer, mm_audio_effect_custom_type_e effect_custom_type, int eq_index, int level);
299
300 /**
301  * This function is to set the bands level of equalizer custom effect using input list.
302  *
303  * @param       hplayer         [in]    Handle of player.
304  * @param       level_list      [in]    list of bands level of equalizer custom audio_effect want to set.
305  * @param       size            [in]    size of level_list.
306  *
307  * @return      This function returns zero on success, or negative value with error code.
308  *
309  * @remark
310  * @see
311  * @since
312  */
313 int mm_player_audio_effect_custom_set_level_eq_from_list(MMHandleType hplayer, int *level_list, int size);
314
315 /**
316  * This function is to check whether the setting preset type effect is available or not
317  */
318 int mm_player_is_available_preset_effect(MMHandleType hplayer, mm_audio_effect_preset_type_e effect, bool *available);
319
320 /**
321  * This function is to check whether the setting custom type effect is available or not
322  */
323 int mm_player_is_available_custom_effect(MMHandleType hplayer, mm_audio_effect_custom_type_e effect, bool *available);
324
325 /**
326         @}
327  */
328
329 #ifdef __cplusplus
330         }
331 #endif
332
333 #endif  /* __MM_PLAYER_AUDIOEFFECT_H__ */