[0.6.201] add attribute about media stream input format
[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_NUM
96 } mmplayer_attrs_id_e;
97
98 typedef bool (*mmplayer_commit_func_t)(MMHandleType handle, int attr_idx, const MMAttrsValue *value);
99
100 typedef struct {
101         mmplayer_attrs_id_e attrid;
102         char *name;
103         int value_type;
104         int flags;
105         union {
106                 void *value_void;
107                 char *value_string;
108                 int value_int;
109                 double value_double;
110         } default_value;
111         MMAttrsValidType valid_type;
112         union {
113                 int *int_array;
114                 int int_min;
115                 double *double_array;
116                 double double_min;
117         } validity_value_1;
118         union {
119                 int int_max;
120                 double double_max;
121                 int count;
122         } validity_value_2;
123         mmplayer_commit_func_t attr_commit;  /* called before committing attr */
124 } mmplayer_attrs_spec_t;
125
126 /**
127  * This function set values of attributes.
128  *
129  * @param[in]   handle                  Handle of player.
130  * @param[in]   err_atr_name            Name of attribute that is failed (NULL can be set if it's not require to check. )
131  * @param[in]   attribute_name  Name of the first attribute to set
132  * @param[in]   args_list                       List of attributes and values
133  * @return      This function returns zero on success, or negative value with error code.
134  * @remarks
135  * @see         _mmplayer_get_attribute()
136  *
137  */
138 int _mmplayer_set_attribute(MMHandleType handle,  char **err_atr_name, const char *attribute_name, va_list args_list);
139 /**
140  * This function get values of attributes.
141  *
142  * @param[in]   handle                  Handle of player.
143  * @param[in]   err_atr_name            Name of attribute that is failed (NULL can be set if it's not require to check. )
144  * @param[in]   attribute_name  Name of the first attribute to set
145  * @param[in]   args_list                       List of attributes and values
146  * @return      This function returns zero on success, or negative value with error code.
147  * @remarks
148  * @see         _mmplayer_set_attribute()
149  *
150  */
151 int _mmplayer_get_attribute(MMHandleType handle,  char **err_atr_name, const char *attribute_name, va_list args_list);
152 /**
153  * This function get configuration values of attribute.
154  *
155  * @param[in]   handle                  Handle of player.
156  * @param[in]   attribute_name  Name of the first attribute to set
157  * @param[in]   info                            Configuration values
158  * @return      This function returns zero on success, or negative value with error code.
159  * @remarks
160  * @see
161  *
162  */
163 int _mmplayer_get_attributes_info(MMHandleType handle,  const char *attribute_name, mmplayer_attrs_info_t *info);
164 /**
165  * This function allocates structure of attributes and sets initial values.
166  *
167  * @param[in]   handle          Handle of player.
168  * @return      This function returns allocated structure of attributes.
169  * @remarks
170  * @see         _mmplayer_deconstruct_attribute()
171  *
172  */
173 MMHandleType _mmplayer_construct_attribute(MMHandleType handle);
174 /**
175  * This function release allocated attributes.
176  *
177  * @param[in]   handle          Handle of player.
178  * @return      This function returns true on success or false on failure.
179  * @remarks
180  * @see         _mmplayer_construct_attribute()
181  *
182  */
183 bool _mmplayer_deconstruct_attribute(MMHandleType handle);
184
185 #ifdef __cplusplus
186         }
187 #endif
188
189 #endif /* __MM_PLAYER_ATTRS_H__ */