[0.6.286] Change the property name for setting max-bitrate used in adaptivedemux
[platform/core/multimedia/libmm-player.git] / src / include / mm_player_attrs.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  * 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_ATTRS_H__
24 #define __MM_PLAYER_ATTRS_H__
25
26 #ifdef __cplusplus
27 extern "C" {
28 #endif
29
30 typedef enum {
31         MMPLAYER_ATTRS_PROFILE_URI,              /* 0 */
32         MMPLAYER_ATTRS_PROFILE_USER_PARAM,
33         MMPLAYER_ATTRS_PROFILE_PLAY_COUNT,
34         MMPLAYER_ATTRS_PROFILE_PREPARE_ASYNC,
35         MMPLAYER_ATTRS_STREAMING_USER_AGENT,
36         MMPLAYER_ATTRS_STREAMING_COOKIE,         /* 5 */
37         MMPLAYER_ATTRS_SUBTITLE_URI,
38         MMPLAYER_ATTRS_CONTENT_BITRATE,
39         MMPLAYER_ATTRS_CONTENT_MAX_BITRATE,
40         MMPLAYER_ATTRS_CONTENT_VIDEO_FOUND,
41         MMPLAYER_ATTRS_CONTENT_VIDEO_CODEC,      /* 10 */
42         MMPLAYER_ATTRS_CONTENT_VIDEO_BITRATE,
43         MMPLAYER_ATTRS_CONTENT_VIDEO_FPS,
44         MMPLAYER_ATTRS_CONTENT_VIDEO_WIDTH,
45         MMPLAYER_ATTRS_CONTENT_VIDEO_HEIGHT,
46         MMPLAYER_ATTRS_CONTENT_VIDEO_ORIENTATION,
47         MMPLAYER_ATTRS_CONTENT_VIDEO_IS_SPHERICAL,
48         MMPLAYER_ATTRS_CONTENT_AUDIO_CODEC,
49         MMPLAYER_ATTRS_CONTENT_AUDIO_BITRATE,
50         MMPLAYER_ATTRS_CONTENT_AUDIO_CHANNELS,
51         MMPLAYER_ATTRS_CONTENT_AUDIO_SAMPLERATE, /* 20 */
52         MMPLAYER_ATTRS_CONTENT_AUDIO_FORMAT,
53         MMPLAYER_ATTRS_CONTENT_TEXT_TRACK_NUM,
54         MMPLAYER_ATTRS_CONTENT_TEXT_TRACK_INDEX,
55         MMPLAYER_ATTRS_TAG_ARTIST,
56         MMPLAYER_ATTRS_TAG_TITLE,
57         MMPLAYER_ATTRS_TAG_ALBUM,
58         MMPLAYER_ATTRS_TAG_GENRE,
59         MMPLAYER_ATTRS_TAG_AUTHOR,
60         MMPLAYER_ATTRS_TAG_COPYRIGHT,
61         MMPLAYER_ATTRS_TAG_DATE,                 /* 30 */
62         MMPLAYER_ATTRS_TAG_DESCRIPTION,
63         MMPLAYER_ATTRS_TAG_TRACK_NUM,
64         MMPLAYER_ATTRS_TAG_ALBUM_COVER,
65         MMPLAYER_ATTRS_DISPLAY_ROTATION,
66         MMPLAYER_ATTRS_DISPLAY_VISIBLE,
67         MMPLAYER_ATTRS_DISPLAY_METHOD,
68         MMPLAYER_ATTRS_DISPLAY_OVERLAY,
69         MMPLAYER_ATTRS_DISPLAY_WIN_ROI_X,
70         MMPLAYER_ATTRS_DISPLAY_WIN_ROI_Y,
71         MMPLAYER_ATTRS_DISPLAY_WIN_ROI_WIDTH,    /* 40 */
72         MMPLAYER_ATTRS_DISPLAY_WIN_ROI_HEIGHT,
73         MMPLAYER_ATTRS_DISPLAY_SURFACE_TYPE,
74         MMPLAYER_ATTRS_DISPLAY_EXPORTED_SHELL_HANDLE,
75         MMPLAYER_ATTRS_SOUND_STREAM_TYPE,
76         MMPLAYER_ATTRS_SOUND_STREAM_INDEX,
77         MMPLAYER_ATTRS_SOUND_LATENCY_MODE,
78         MMPLAYER_ATTRS_PCM_EXTRACTION_SAMPLERATE,
79         MMPLAYER_ATTRS_PCM_EXTRACTION_CHANNELS,
80         MMPLAYER_ATTRS_ACCURATE_SEEK,
81         MMPLAYER_ATTRS_PCM_EXTRACTION_FORMAT,    /* 50 */
82         MMPLAYER_ATTRS_DRC_MODE,
83         MMPLAYER_ATTRS_GAPLESS_MODE,
84         MMPLAYER_ATTRS_ENABLE_VIDEO_DECODED_CB,
85         MMPLAYER_ATTRS_VIDEO_CODEC_TYPE,
86         MMPLAYER_ATTRS_AUDIO_CODEC_TYPE,
87         MMPLAYER_ATTRS_VIDEO_BUFFER_TOTAL_SIZE,
88         MMPLAYER_ATTRS_VIDEO_BUFFER_EXTRA_SIZE,
89         MMPLAYER_ATTRS_PREBUFFER_MS,
90         MMPLAYER_ATTRS_REBUFFER_MS,
91         MMPLAYER_ATTRS_PITCH_CONTROL,            /* 60 */
92         MMPLAYER_ATTRS_PITCH_VALUE,
93         MMPLAYER_ATTRS_AUDIO_OFFLOAD,
94         MMPLAYER_ATTRS_AUDIO_OFFLOAD_FORMAT,
95         MMPLAYER_ATTRS_MEDIA_STREAM_INPUT_FORMAT,
96         MMPLAYER_ATTRS_AUDIO_ONLY,
97         MMPLAYER_ATTRS_NUM
98 } mmplayer_attrs_id_e;
99
100 typedef bool (*mmplayer_commit_func_t)(MMHandleType handle, int attr_idx, const MMAttrsValue *value);
101
102 typedef struct {
103         mmplayer_attrs_id_e attrid;
104         char *name;
105         int value_type;
106         int flags;
107         union {
108                 void *value_void;
109                 char *value_string;
110                 int value_int;
111                 double value_double;
112         } default_value;
113         MMAttrsValidType valid_type;
114         union {
115                 int *int_array;
116                 int int_min;
117                 double *double_array;
118                 double double_min;
119         } validity_value_1;
120         union {
121                 int int_max;
122                 double double_max;
123                 int count;
124         } validity_value_2;
125         mmplayer_commit_func_t attr_commit;  /* called before committing attr */
126 } mmplayer_attrs_spec_t;
127
128 /**
129  * This function set values of attributes.
130  *
131  * @param[in]   handle                  Handle of player.
132  * @param[in]   err_atr_name            Name of attribute that is failed (NULL can be set if it's not require to check. )
133  * @param[in]   attribute_name  Name of the first attribute to set
134  * @param[in]   args_list                       List of attributes and values
135  * @return      This function returns zero on success, or negative value with error code.
136  * @remarks
137  * @see         _mmplayer_get_attribute()
138  *
139  */
140 int _mmplayer_set_attribute(MMHandleType handle,  char **err_atr_name, const char *attribute_name, va_list args_list);
141 /**
142  * This function get values of attributes.
143  *
144  * @param[in]   handle                  Handle of player.
145  * @param[in]   err_atr_name            Name of attribute that is failed (NULL can be set if it's not require to check. )
146  * @param[in]   attribute_name  Name of the first attribute to set
147  * @param[in]   args_list                       List of attributes and values
148  * @return      This function returns zero on success, or negative value with error code.
149  * @remarks
150  * @see         _mmplayer_set_attribute()
151  *
152  */
153 int _mmplayer_get_attribute(MMHandleType handle,  char **err_atr_name, const char *attribute_name, va_list args_list);
154 /**
155  * This function get configuration values of attribute.
156  *
157  * @param[in]   handle                  Handle of player.
158  * @param[in]   attribute_name  Name of the first attribute to set
159  * @param[in]   info                            Configuration values
160  * @return      This function returns zero on success, or negative value with error code.
161  * @remarks
162  * @see
163  *
164  */
165 int _mmplayer_get_attributes_info(MMHandleType handle,  const char *attribute_name, mmplayer_attrs_info_t *info);
166 /**
167  * This function allocates structure of attributes and sets initial values.
168  *
169  * @param[in]   handle          Handle of player.
170  * @return      This function returns allocated structure of attributes.
171  * @remarks
172  * @see         _mmplayer_deconstruct_attribute()
173  *
174  */
175 MMHandleType _mmplayer_construct_attribute(MMHandleType handle);
176 /**
177  * This function release allocated attributes.
178  *
179  * @param[in]   handle          Handle of player.
180  * @return      This function returns true on success or false on failure.
181  * @remarks
182  * @see         _mmplayer_construct_attribute()
183  *
184  */
185 bool _mmplayer_deconstruct_attribute(MMHandleType handle);
186
187 #ifdef __cplusplus
188         }
189 #endif
190
191 #endif /* __MM_PLAYER_ATTRS_H__ */