6a19e04e3781f0f4ea366e03c4484e53bcad28b5
[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
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
31
32 /* NOTE : Wi-Fi Display Sink has no initalizing API for library itself
33  * so we cannot decide when those ini values to be released.
34  * this is the reason of all string items are static array.
35  * make it do with malloc when MMWFDSinkCreate() API created
36  * before that time, we should be careful with size limitation
37  * of each string item.
38  */
39
40 #define MM_WFD_SINK_INI_DEFAULT_PATH    SYSCONFDIR"/multimedia/mmfw_wfd_sink.ini"
41
42 #define WFD_SINK_INI_MAX_STRLEN 256
43 #define WFD_SINK_INI_MAX_ELEMENT        10
44
45
46 typedef struct {
47         guint video_codec;
48         guint video_native_resolution;
49         guint64 video_cea_support;
50         guint64 video_vesa_support;
51         guint64 video_hh_support;
52         guint video_profile;
53         guint video_level;
54         guint video_latency;
55         gint video_vertical_resolution;
56         gint video_horizontal_resolution;
57         gint video_minimum_slicing;
58         gint video_slice_enc_param;
59         gint video_framerate_control_support;
60         gint video_non_transcoding_support;
61 } WFDVideoFormats;
62
63 typedef struct {
64         guint audio_codec;
65         guint audio_latency;
66         guint audio_channel;
67         guint audio_sampling_frequency;
68 } WFDAudioCodecs;
69
70 typedef struct {
71         guint audio_codec;
72         guint audio_lpcm_mode;
73         guint audio_aac_mode;
74         guint audio_ac3_mode;
75 } WFD2AudioCodecs;
76
77 typedef struct {
78         guint video_codec;
79         guint video_native_resolution;
80         gint video_non_transcoding_support;
81 } WFD2VideoFormats;
82
83 typedef struct {
84         guint64 video_cea_support;
85         guint64 video_vesa_support;
86         guint64 video_hh_support;
87         guint video_profile;
88         guint video_level;
89         guint video_latency;
90         gint video_vertical_resolution;
91         gint video_horizontal_resolution;
92         gint video_minimum_slicing;
93         gint video_slice_enc_param;
94         gint video_framerate_control_support;
95 } WFD2VideoCodecSpec;
96
97 typedef struct {
98         gboolean enable_hdcp;
99         gint hdcp_content_protection;
100         gint hdcp_port_no;
101 } WFDHDCPContentProtection;
102
103 typedef struct __mm_wfd_sink_ini {
104         /* general */
105         gchar gst_param[5][WFD_SINK_INI_MAX_STRLEN];
106         gint state_change_timeout;
107         gboolean enable_rm;
108         gint jitter_buffer_latency;
109         gint video_sink_max_lateness;
110         gint sink_ts_offset;
111         gboolean audio_sink_async;
112         gboolean video_sink_async;
113         gboolean enable_retransmission;
114         gboolean enable_reset_basetime;
115         gchar user_agent[WFD_SINK_INI_MAX_STRLEN];
116
117         /* debug */
118         gboolean generate_dot;
119         gboolean dump_rtsp_message;
120         gboolean trace_buffers;
121         gboolean trace_first_buffer;
122         gboolean trace_buffers_of_wfdsrc;
123         gboolean dump_ts_data;
124         gboolean dump_rtp_data;
125
126         /* pipeline */
127         gchar name_of_source[WFD_SINK_INI_MAX_STRLEN];
128         gchar name_of_tsdemux[WFD_SINK_INI_MAX_STRLEN];
129         gchar name_of_audio_hdcp[WFD_SINK_INI_MAX_STRLEN];
130         gchar name_of_aac_parser[WFD_SINK_INI_MAX_STRLEN];
131         gchar name_of_aac_decoder[WFD_SINK_INI_MAX_STRLEN];
132         gchar name_of_ac3_parser[WFD_SINK_INI_MAX_STRLEN];
133         gchar name_of_ac3_decoder[WFD_SINK_INI_MAX_STRLEN];
134         gchar name_of_lpcm_converter[WFD_SINK_INI_MAX_STRLEN];
135         gchar name_of_lpcm_filter[WFD_SINK_INI_MAX_STRLEN];
136         gchar name_of_audio_resampler[WFD_SINK_INI_MAX_STRLEN];
137         gchar name_of_audio_volume[WFD_SINK_INI_MAX_STRLEN];
138         gchar name_of_audio_sinkbin_queue[WFD_SINK_INI_MAX_STRLEN];
139         gchar name_of_audio_sink[WFD_SINK_INI_MAX_STRLEN];
140         gchar name_of_video_hdcp[WFD_SINK_INI_MAX_STRLEN];
141         gchar name_of_video_h264_parser[WFD_SINK_INI_MAX_STRLEN];
142         gchar name_of_video_h264_decoder[WFD_SINK_INI_MAX_STRLEN];
143         gchar name_of_video_h265_parser[WFD_SINK_INI_MAX_STRLEN];
144         gchar name_of_video_h265_decoder[WFD_SINK_INI_MAX_STRLEN];
145         gchar name_of_video_converter[WFD_SINK_INI_MAX_STRLEN];
146         gchar name_of_video_filter[WFD_SINK_INI_MAX_STRLEN];
147         gchar name_of_video_sink[WFD_SINK_INI_MAX_STRLEN];
148         gchar name_of_video_evas_sink[WFD_SINK_INI_MAX_STRLEN];
149
150         /* audio parameter for reponse of M3 request */
151         WFDAudioCodecs wfd_audio_codecs;
152
153         /* video parameter for reponse of M3 request */
154         WFDVideoFormats wfd_video_formats;
155
156         /* hdcp parameter for reponse of M3 request */
157         WFDHDCPContentProtection wfd_content_protection;
158
159         /* audio parameter for reponse of R2 M3 request */
160         WFD2AudioCodecs wfd2_audio_codecs;
161
162         /* video parameter for reponse of R2 M3 request */
163         WFD2VideoFormats wfd2_video_formats;
164         WFD2VideoCodecSpec wfd2_video_h264_info;
165         WFD2VideoCodecSpec wfd2_video_h265_info;
166 } mm_wfd_sink_ini_t;
167
168 #define MM_WFD_SINK_DEFAULT_INI \
169 " \
170 [general]\n\
171 ; parameters for initializing gstreamer\n\
172 ; DEFAULT SET(--gst-debug=2, *wfd*:5)\n\
173 gstparam1 = --gst-debug=2, *wfd*:5, *wfdtsdemux:1, *wfdrtpbuffer:1\n\
174 gstparam2 =\n\
175 gstparam3 =\n\
176 gstparam4 =\n\
177 gstparam5 =\n\
178 \n\
179 ; generating dot file representing pipeline state\n\
180 ; do export GST_DEBUG_DUMP_DOT_DIR=[dot file path] in the shell\n\
181 generate dot = no\n\
182 \n\
183 ; enable pad probe\n\
184 enable pad probe = no\n\
185 \n\
186 ; enable wfdsrc inner pad probe\n\
187 enable wfdsrc pad probe = no\n\
188 \n\
189 ; enable ts data dump(eg. /var/tmp/*.ts)\n\
190 enable ts data dump = no\n\
191 \n\
192 ; allowed timeout for changing pipeline state\n\
193 state change timeout = 5 ; sec\n\
194 \n\
195 ; set debug property to wfdsrc plugin for debugging rtsp message\n\
196 set debug property = yes\n\
197 \n\
198 ; for asm function enable = yes, disable = no\n\
199 enable rm = no\n\
200 \n\
201 ; 0: default value set by wfdsrc element, other: user define value.\n\
202 jitter buffer latency=10\n\
203 \n\
204 ; for retransmission request enable = yes, disable = no\n\
205 enable retransmission = no\n\
206 \n\
207 ; for reset basetime, enable = yes, disable = no\n\
208 enable reset basetime = yes\n\
209 \n\
210 ; Maximum number of nanoseconds that a buffer can be late before it is dropped by videosink(-1 unlimited)\n\
211 video sink max lateness=20000000\n\
212 \n\
213 ; nanoseconds to be added to buffertimestamp by sink elements\n\
214 sink ts offset=150000000\n\
215 \n\
216 ; if no, go asynchronously to PAUSED without preroll \n\
217 audio sink async=no\n\
218 \n\
219 ; if no, go asynchronously to PAUSED without preroll \n\
220 video sink async=no\n\
221 \n\
222 ; user agent\n\
223 user agent = TIZEN3_0/WFD-SINK\n\
224 \n\
225 \n\
226 \n\
227 \n\
228 [pipeline]\n\
229 wfdsrc element = wfdsrc\n\
230 \n\
231 tsdemux element = wfdtsdemux\n\
232 \n\
233 audio hdcp element = \n\
234 \n\
235 aac parser element = aacparse\n\
236 \n\
237 aac decoder element = avdec_aac\n\
238 \n\
239 ac3 parser element = ac3parse\n\
240 \n\
241 ac3 decoder element =\n\
242 \n\
243 lpcm converter element =\n\
244 \n\
245 lpcm filter element = capsfilter\n\
246 \n\
247 audio resampler element = audioconvert\n\
248 \n\
249 audio volume element =\n\
250 \n\
251 audio sinkbin queue element = queue\n\
252 \n\
253 audio sink element = pulsesink\n\
254 \n\
255 video hdcp element =\n\
256 \n\
257 video h264 parser element = h264parse\n\
258 \n\
259 video h265 parser element = \n\
260 \n\
261 video h264 decoder element = avdec_h264\n\
262 \n\
263 video h265 decoder element = \n\
264 \n\
265 video converter element =\n\
266 \n\
267 video filter element =\n\
268 \n\
269 video sink element = waylandsink\n\
270 \n\
271 \n\
272 \n\
273 [wfd audio codecs]\n\
274 ; 0x1: LPCM, 0x2: aac, 0x4: ac3\n\
275 ;default aac and LPCM\n\
276 audio codec=0x3\n\
277 \n\
278 audio latency=0x0\n\
279 \n\
280 ;0x1 : 48000khz, 0x2: 44100khz\n\
281 audio sampling frequency=0x3\n\
282 \n\
283 ; 0x1:2 channels, 0x2:4 channels, 0x4:6channels, 0x8:8channels\n\
284 audio channels=0x1\n\
285 \n\
286 \n\
287 \n\
288 [wfd video formats]\n\
289 ; 0: H264CBP 1: H264CHP\n\
290 video codec=0x1\n\
291 \n\
292 video native resolution = 0x20\n\
293 \n\
294 video cea support=0x842b\n\
295 \n\
296 video vesa support=0x1\n\
297 \n\
298 video hh support=0x555\n\
299 \n\
300 ; 0x1:base, 0x2:high\n\
301 video profile=0x1\n\
302 \n\
303 ; 0x1:level_3_1, 0x2:level_3_2, 0x4:level_4, 0x8:level_4_1, 0x10:level_4_2\n\
304 video level=0x2\n\
305 \n\
306 video latency=0x0\n\
307 \n\
308 video vertical resolution=720\n\
309 \n\
310 video horizontal resolution=1280\n\
311 \n\
312 video minimum slicesize=0\n\
313 \n\
314 video slice encoding params=200\n\
315 \n\
316 video framerate control support=11\n\
317 \n\
318 \n\
319 \n\
320 [wfd hdcp content protection]\n\
321 ;0x0:none, 0x1:HDCP_2.0, 0x2:HDCP_2.1\n\
322 hdcp content protection=0x0\n\
323 \n\
324 hdcp port no=0\n\
325 \n\
326 "
327
328 int
329 mm_wfd_sink_ini_load(mm_wfd_sink_ini_t *ini, const char *path);
330
331 int
332 mm_wfd_sink_ini_unload(mm_wfd_sink_ini_t *ini);
333
334 #ifdef __cplusplus
335 }
336 #endif
337
338 #endif