Change directory structure for code integration
[platform/core/multimedia/libmm-wfd.git] / src / include / mm_wfd_sink_ini.h
1 /*
2  * libmm-wfd
3  *
4  * Copyright (c) 2011 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
5  *
6  * Contact: JongHyuk Choi <jhchoi.choi@samsung.com>, ByungWook Jang <bw.jang@samsung.com>,
7  * Manoj Kumar K <manojkumar.k@samsung.com>, Hyunil Park <hyunil46.park@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_WFD_SINK_INI_H__
24 #define __MM_WFD_SINK_INI_H__
25
26 #include <glib.h>
27 #include <tzplatform_config.h>
28 #include "mm_wfd_sink_enum.h"
29
30 #ifdef __cplusplus
31 extern "C" {
32 #endif
33
34
35 enum WFDSinkINIProbeFlags
36 {
37         WFD_SINK_INI_PROBE_DEFAULT = 0,
38         WFD_SINK_INI_PROBE_TIMESTAMP = (1 << 0),
39         WFD_SINK_INI_PROBE_BUFFERSIZE = (1 << 1),
40         WFD_SINK_INI_PROBE_CAPS = (1 << 2),
41         WFD_SINK_INI_PROBE_BUFFER_DURATION = (1 << 3),
42 };
43
44 #define MM_WFD_SINK_INI_DEFAULT_PATH    SYSCONFDIR"/multimedia/mmfw_wfd_sink.ini"
45
46 #define WFD_SINK_INI_MAX_STRLEN 256
47 #define WFD_SINK_INI_MAX_ELEMENT        10
48
49 /* NOTE : MMPlayer has no initalizing API for library itself
50  * so we cannot decide when those ini values to be released.
51  * this is the reason of all string items are static array.
52  * make it do with malloc when MMPlayerInitialize() API created
53  * before that time, we should be careful with size limitation
54  * of each string item.
55  */
56 typedef struct __mm_wfd_sink_ini {
57         /* general */
58         gchar gst_param[5][WFD_SINK_INI_MAX_STRLEN];
59         gboolean generate_dot;
60         gboolean enable_pad_probe;
61         gint state_change_timeout;
62         gboolean set_debug_property;
63         gboolean enable_asm;
64         gint jitter_buffer_latency;
65         gint video_sink_max_lateness;
66         gint sink_ts_offset;
67         gboolean audio_sink_async;
68         gboolean video_sink_async;
69         gboolean enable_retransmission;
70         gboolean enable_reset_basetime;
71         gboolean enable_ts_data_dump;
72         gboolean enable_wfdsrc_pad_probe;
73
74         /* pipeline */
75         gchar name_of_source[WFD_SINK_INI_MAX_STRLEN];
76         gchar name_of_tsdemux[WFD_SINK_INI_MAX_STRLEN];
77         gchar name_of_audio_hdcp[WFD_SINK_INI_MAX_STRLEN];
78         gchar name_of_aac_parser[WFD_SINK_INI_MAX_STRLEN];
79         gchar name_of_aac_decoder[WFD_SINK_INI_MAX_STRLEN];
80         gchar name_of_ac3_parser[WFD_SINK_INI_MAX_STRLEN];
81         gchar name_of_ac3_decoder[WFD_SINK_INI_MAX_STRLEN];
82         gchar name_of_lpcm_converter[WFD_SINK_INI_MAX_STRLEN];
83         gchar name_of_lpcm_filter[WFD_SINK_INI_MAX_STRLEN];
84         gchar name_of_audio_resampler[WFD_SINK_INI_MAX_STRLEN];
85         gchar name_of_audio_volume[WFD_SINK_INI_MAX_STRLEN];
86         gchar name_of_audio_sink[WFD_SINK_INI_MAX_STRLEN];
87
88         gchar name_of_video_hdcp[WFD_SINK_INI_MAX_STRLEN];
89         gchar name_of_video_parser[WFD_SINK_INI_MAX_STRLEN];
90         gchar name_of_video_capssetter[WFD_SINK_INI_MAX_STRLEN];
91         gchar name_of_video_decoder[WFD_SINK_INI_MAX_STRLEN];
92         gchar name_of_video_converter[WFD_SINK_INI_MAX_STRLEN];
93         gchar name_of_video_filter[WFD_SINK_INI_MAX_STRLEN];
94         gchar name_of_video_sink[WFD_SINK_INI_MAX_STRLEN];
95         gchar name_of_video_evas_sink[WFD_SINK_INI_MAX_STRLEN];
96
97         /* audio parameter for reponse of M3 request */
98         guint audio_codec;
99         guint audio_latency;
100         guint audio_channel;
101         guint audio_sampling_frequency;
102
103         /* video parameter for reponse of M3 request */
104         guint video_codec;
105         guint video_native_resolution;
106         guint video_cea_support;
107         guint video_vesa_support;
108         guint video_hh_support;
109         guint video_profile;
110         guint video_level;
111         guint video_latency;
112         gint video_vertical_resolution;
113         gint video_horizontal_resolution;
114         gint video_minimum_slicing;
115         gint video_slice_enc_param;
116         gint video_framerate_control_support;
117
118         /* hdcp parameter for reponse of M3 request */
119         gint hdcp_content_protection;
120         gint hdcp_port_no;
121 } mm_wfd_sink_ini_t;
122
123
124 /*Default sink ini values*/
125 /* General*/
126 #define DEFAULT_GST_PARAM       ""
127 #define DEFAULT_GENERATE_DOT    FALSE
128 #define DEFAULT_ENABLE_PAD_PROBE        FALSE
129 #define DEFAULT_STATE_CHANGE_TIMEOUT 5 /* sec */
130 #define DEFAULT_SET_DEBUG_PROPERTY      TRUE
131 #define DEFAULT_ENABLE_ASM      FALSE
132 #define DEFAULT_JITTER_BUFFER_LATENCY 10 /* msec */
133 #define DEFAULT_ENABLE_RETRANSMISSION   FALSE
134 #define DEFAULT_ENABLE_RESET_BASETIME   TRUE
135 #define DEFAULT_VIDEO_SINK_MAX_LATENESS 20000000 /* nsec */
136 #define DEFAULT_SINK_TS_OFFSET 150000000 /* nsec */
137 #define DEFAULT_AUDIO_SINK_ASYNC FALSE
138 #define DEFAULT_VIDEO_SINK_ASYNC FALSE
139 #define DEFAULT_ENABLE_TS_DATA_DUMP             FALSE
140 #define DEFAULT_ENABLE_WFDRTSPSRC_PAD_PROBE FALSE
141
142 /* Pipeline */
143 #define DEFAULT_NAME_OF_SOURCE "wfdsrc"
144 #define DEFAULT_NAME_OF_TSDEMUX ""
145 #define DEFAULT_NAME_OF_AUDIO_HDCP ""
146 #define DEFAULT_NAME_OF_AAC_PARSER ""
147 #define DEFAULT_NAME_OF_AAC_DECODER ""
148 #define DEFAULT_NAME_OF_AC3_PARSER ""
149 #define DEFAULT_NAME_OF_AC3_DECODER ""
150 #define DEFAULT_NAME_OF_LPCM_CONVERTER ""
151 #define DEFAULT_NAME_OF_LPCM_FILTER ""
152 #define DEFAULT_NAME_OF_AUDIO_RESAMPLER ""
153 #define DEFAULT_NAME_OF_AUDIO_VOLUME ""
154 #define DEFAULT_NAME_OF_AUDIO_SPLITTER ""
155 #define DEFAULT_NAME_OF_AUDIO_SINK ""
156 #define DEFAULT_NAME_OF_VIDEO_HDCP ""
157 #define DEFAULT_NAME_OF_VIDEO_PARSER ""
158 #define DEFAULT_NAME_OF_VIDEO_CAPSSETTER ""
159 #define DEFAULT_NAME_OF_VIDEO_DECODER ""
160 #define DEFAULT_NAME_OF_VIDEO_CONVERTER ""
161 #define DEFAULT_NAME_OF_VIDEO_FILTER ""
162 #define DEFAULT_NAME_OF_VIDEO_SINK ""
163 #define DEFAULT_NAME_OF_EVAS_VIDEO_SINK ""
164
165 /* Audio */
166 #define DEFAULT_AUDIO_CODEC WFD_AUDIO_LPCM | WFD_AUDIO_AAC
167 #define DEFAULT_AUDIO_LATENCY 0x0
168 #define DEFAULT_AUDIO_CHANNELS WFD_CHANNEL_2
169 #define DEFAULT_AUDIO_SAMP_FREQUENCY WFD_FREQ_44100 | WFD_FREQ_48000
170
171 /* Video */
172 #define DEFAULT_VIDEO_CODEC WFD_VIDEO_H264
173 #define DEFAULT_VIDEO_NATIVE_RESOLUTION 0x20
174 /* CEA :  WFD_CEA_640x480P60  | WFD_CEA_720x480P60 |WFD_CEA_720x576P50 |WFD_CEA_1280x720P30 |
175         WFD_CEA_1280x720P25 | WFD_CEA_1280x720P24 */
176 #define DEFAULT_VIDEO_CEA_SUPPORT 0x84ab
177 /* VESA : WFD_VESA_800x600P30 */
178 #define DEFAULT_VIDEO_VESA_SUPPORT 0x1
179 /* HH : WFD_HH_800x480P30 | WFD_HH_854x480P30 | WFD_HH_864x480P30 | WFD_HH_640x360P30 | WFD_HH_960x540P30 | WFD_HH_848x480P30 */
180 #define DEFAULT_VIDEO_HH_SUPPORT 0x555
181 #define DEFAULT_VIDEO_PROFILE WFD_H264_BASE_PROFILE
182 #define DEFAULT_VIDEO_LEVEL WFD_H264_LEVEL_3_2
183 #define DEFAULT_VIDEO_LATENCY 0x0
184 #define DEFAULT_VIDEO_VERTICAL_RESOLUTION 720
185 #define DEFAULT_VIDEO_HORIZONTAL_RESOLUTION 1280
186 #define DEFAULT_VIDEO_MIN_SLICESIZE 0
187 #define DEFAULT_VIDEO_SLICE_ENC_PARAM 200
188 #define DEFAULT_VIDEO_FRAMERATE_CONTROL 11
189
190 /* HDCP */
191 #define DEFAULT_HDCP_CONTENT_PROTECTION 0x0
192 #define DEFAULT_HDCP_PORT_NO 0
193
194
195 #define MM_WFD_SINK_DEFAULT_INI \
196 " \
197 [general]\n\
198 ; parameters for initializing gstreamer\n\
199 ; DEFAULT SET(--gst-debug=2, *wfd*:5)\n\
200 gstparam1 = --gst-debug=2, *wfd*:5, *wfdtsdemux:1, *wfdrtpbuffer:1\n\
201 gstparam2 =\n\
202 gstparam3 =\n\
203 gstparam4 =\n\
204 gstparam5 =\n\
205 \n\
206 ; generating dot file representing pipeline state\n\
207 ; do export GST_DEBUG_DUMP_DOT_DIR=[dot file path] in the shell\n\
208 generate dot = no\n\
209 \n\
210 ; enable pad probe\n\
211 enable pad probe = no\n\
212 \n\
213 ; enable wfdsrc inner pad probe\n\
214 enable wfdsrc pad probe = no\n\
215 \n\
216 ; enable ts data dump(eg. /var/tmp/*.ts)\n\
217 enable ts data dump = no\n\
218 \n\
219 ; allowed timeout for changing pipeline state\n\
220 state change timeout = 5 ; sec\n\
221 \n\
222 ; set debug property to wfdsrc plugin for debugging rtsp message\n\
223 set debug property = yes\n\
224 \n\
225 ; for asm function enable = yes, disable = no\n\
226 enable asm = no\n\
227 \n\
228 ; 0: default value set by wfdsrc element, other: user define value.\n\
229 jitter buffer latency=10\n\
230 \n\
231 ; for retransmission request enable = yes, disable = no\n\
232 enable retransmission = no\n\
233 \n\
234 ; for reset basetime, enable = yes, disable = no\n\
235 enable reset basetime = yes\n\
236 \n\
237 ; Maximum number of nanoseconds that a buffer can be late before it is dropped by videosink(-1 unlimited)\n\
238 video sink max lateness=20000000\n\
239 \n\
240 ; nanoseconds to be added to buffertimestamp by sink elements\n\
241 sink ts offset=150000000\n\
242 \n\
243 ; if no, go asynchronously to PAUSED without preroll \n\
244 audio sink async=no\n\
245 \n\
246 ; if no, go asynchronously to PAUSED without preroll \n\
247 video sink async=no\n\
248 \n\
249 \n\
250 \n\
251 [pipeline]\n\
252 wfdsrc element = wfdsrc\n\
253 \n\
254 tsdemux element = wfdtsdemux\n\
255 \n\
256 aac parser element = aacparse\n\
257 \n\
258 aac decoder element = avdec_aac\n\
259 \n\
260 ac3 parser element = ac3parse\n\
261 \n\
262 ac3 decoder element =\n\
263 \n\
264 lpcm converter element =\n\
265 \n\
266 lpcm filter element = capsfilter\n\
267 \n\
268 audio resampler element = audioconvert\n\
269 \n\
270 audio volume element =\n\
271 \n\
272 audio sink element = pulsesink\n\
273 \n\
274 video parser element = h264parse\n\
275 \n\
276 video capssetter element = capssetter\n\
277 \n\
278 video decoder element = avdec_h264;sprddec_h264;omxh264dec\n\
279 \n\
280 video converter element =\n\
281 \n\
282 video filter element =\n\
283 \n\
284 video sink element = waylandsink;xvimagesink\n\
285 \n\
286 \n\
287 \n\
288 [audio param]\n\
289 ; 0x1: LPCM, 0x2: aac, 0x4: ac3\n\
290 ;default aac and LPCM\n\
291 audio codec=0x3\n\
292 \n\
293 audio latency=0x0\n\
294 \n\
295 ;0x1 : 48000khz, 0x2: 44100khz\n\
296 audio sampling frequency=0x3\n\
297 \n\
298 ; 0x1:2 channels, 0x2:4 channels, 0x4:6channels, 0x8:8channels\n\
299 audio channels=0x1\n\
300 \n\
301 \n\
302 \n\
303 [video param]\n\
304 ; 0: H264CBP 1: H264CHP\n\
305 video codec=0x1\n\
306 \n\
307 video native resolution = 0x20\n\
308 \n\
309 video cea support=0x842b\n\
310 \n\
311 video vesa support=0x1\n\
312 \n\
313 video hh support=0x555\n\
314 \n\
315 ; 0x1:base, 0x2:high\n\
316 video profile=0x1\n\
317 \n\
318 ; 0x1:level_3_1, 0x2:level_3_2, 0x4:level_4, 0x8:level_4_1, 0x10:level_4_2\n\
319 video level=0x2\n\
320 \n\
321 video latency=0x0\n\
322 \n\
323 video vertical resolution=720\n\
324 \n\
325 video horizontal resolution=1280\n\
326 \n\
327 video minimum slicesize=0\n\
328 \n\
329 video slice encoding params=200\n\
330 \n\
331 video framerate control support=11\n\
332 \n\
333 \n\
334 \n\
335 [hdcp param]\n\
336 ;0x0:none, 0x1:HDCP_2.0, 0x2:HDCP_2.1\n\
337 hdcp content protection=0x0\n\
338 \n\
339 hdcp port no=0\n\
340 \n\
341 "
342
343 int
344 mm_wfd_sink_ini_load(mm_wfd_sink_ini_t *ini);
345
346 int
347 mm_wfd_sink_ini_unload(mm_wfd_sink_ini_t *ini);
348
349 #ifdef __cplusplus
350 }
351 #endif
352
353 #endif