[0.6.241] apply select-stream event for audio only
[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_SOUND_STREAM_TYPE,
75         MMPLAYER_ATTRS_SOUND_STREAM_INDEX,
76         MMPLAYER_ATTRS_SOUND_LATENCY_MODE,
77         MMPLAYER_ATTRS_PCM_EXTRACTION_SAMPLERATE,
78         MMPLAYER_ATTRS_PCM_EXTRACTION_CHANNELS,
79         MMPLAYER_ATTRS_ACCURATE_SEEK,
80         MMPLAYER_ATTRS_PCM_EXTRACTION_FORMAT,
81         MMPLAYER_ATTRS_DRC_MODE,                 /* 50 */
82         MMPLAYER_ATTRS_GAPLESS_MODE,
83         MMPLAYER_ATTRS_ENABLE_VIDEO_DECODED_CB,
84         MMPLAYER_ATTRS_VIDEO_CODEC_TYPE,
85         MMPLAYER_ATTRS_AUDIO_CODEC_TYPE,
86         MMPLAYER_ATTRS_VIDEO_BUFFER_TOTAL_SIZE,
87         MMPLAYER_ATTRS_VIDEO_BUFFER_EXTRA_SIZE,
88         MMPLAYER_ATTRS_PREBUFFER_MS,
89         MMPLAYER_ATTRS_REBUFFER_MS,
90         MMPLAYER_ATTRS_PITCH_CONTROL,
91         MMPLAYER_ATTRS_PITCH_VALUE,             /* 60 */
92         MMPLAYER_ATTRS_AUDIO_OFFLOAD,
93         MMPLAYER_ATTRS_AUDIO_OFFLOAD_FORMAT,
94         MMPLAYER_ATTRS_MEDIA_STREAM_INPUT_FORMAT,
95         MMPLAYER_ATTRS_AUDIO_ONLY,
96         MMPLAYER_ATTRS_NUM
97 } mmplayer_attrs_id_e;
98
99 typedef bool (*mmplayer_commit_func_t)(MMHandleType handle, int attr_idx, const MMAttrsValue *value);
100
101 typedef struct {
102         mmplayer_attrs_id_e attrid;
103         char *name;
104         int value_type;
105         int flags;
106         union {
107                 void *value_void;
108                 char *value_string;
109                 int value_int;
110                 double value_double;
111         } default_value;
112         MMAttrsValidType valid_type;
113         union {
114                 int *int_array;
115                 int int_min;
116                 double *double_array;
117                 double double_min;
118         } validity_value_1;
119         union {
120                 int int_max;
121                 double double_max;
122                 int count;
123         } validity_value_2;
124         mmplayer_commit_func_t attr_commit;  /* called before committing attr */
125 } mmplayer_attrs_spec_t;
126
127 /**
128  * This function set values of attributes.
129  *
130  * @param[in]   handle                  Handle of player.
131  * @param[in]   err_atr_name            Name of attribute that is failed (NULL can be set if it's not require to check. )
132  * @param[in]   attribute_name  Name of the first attribute to set
133  * @param[in]   args_list                       List of attributes and values
134  * @return      This function returns zero on success, or negative value with error code.
135  * @remarks
136  * @see         _mmplayer_get_attribute()
137  *
138  */
139 int _mmplayer_set_attribute(MMHandleType handle,  char **err_atr_name, const char *attribute_name, va_list args_list);
140 /**
141  * This function get values of attributes.
142  *
143  * @param[in]   handle                  Handle of player.
144  * @param[in]   err_atr_name            Name of attribute that is failed (NULL can be set if it's not require to check. )
145  * @param[in]   attribute_name  Name of the first attribute to set
146  * @param[in]   args_list                       List of attributes and values
147  * @return      This function returns zero on success, or negative value with error code.
148  * @remarks
149  * @see         _mmplayer_set_attribute()
150  *
151  */
152 int _mmplayer_get_attribute(MMHandleType handle,  char **err_atr_name, const char *attribute_name, va_list args_list);
153 /**
154  * This function get configuration values of attribute.
155  *
156  * @param[in]   handle                  Handle of player.
157  * @param[in]   attribute_name  Name of the first attribute to set
158  * @param[in]   info                            Configuration values
159  * @return      This function returns zero on success, or negative value with error code.
160  * @remarks
161  * @see
162  *
163  */
164 int _mmplayer_get_attributes_info(MMHandleType handle,  const char *attribute_name, mmplayer_attrs_info_t *info);
165 /**
166  * This function allocates structure of attributes and sets initial values.
167  *
168  * @param[in]   handle          Handle of player.
169  * @return      This function returns allocated structure of attributes.
170  * @remarks
171  * @see         _mmplayer_deconstruct_attribute()
172  *
173  */
174 MMHandleType _mmplayer_construct_attribute(MMHandleType handle);
175 /**
176  * This function release allocated attributes.
177  *
178  * @param[in]   handle          Handle of player.
179  * @return      This function returns true on success or false on failure.
180  * @remarks
181  * @see         _mmplayer_construct_attribute()
182  *
183  */
184 bool _mmplayer_deconstruct_attribute(MMHandleType handle);
185
186 #ifdef __cplusplus
187         }
188 #endif
189
190 #endif /* __MM_PLAYER_ATTRS_H__ */