4 * Copyright (c) 2011 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
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>
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
13 * http://www.apache.org/licenses/LICENSE-2.0
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.
24 #include <glib/gstdio.h>
26 #include <iniparser.h>
29 #include "mm_wfd_sink_dlog.h"
30 #include "mm_wfd_sink_enum.h"
31 #include "mm_wfd_sink_ini.h"
33 /*Default sink ini values*/
35 #define DEFAULT_GST_PARAM ""
36 #define DEFAULT_STATE_CHANGE_TIMEOUT 5 /* sec */
37 #define DEFAULT_ENABLE_RM TRUE
38 #define DEFAULT_JITTER_BUFFER_LATENCY 10 /* msec */
39 #define DEFAULT_ENABLE_RETRANSMISSION FALSE
40 #define DEFAULT_ENABLE_RESET_BASETIME TRUE
41 #define DEFAULT_VIDEO_SINK_MAX_LATENESS 20000000 /* nsec */
42 #define DEFAULT_SINK_TS_OFFSET 150000000 /* nsec */
43 #define DEFAULT_AUDIO_SINK_ASYNC FALSE
44 #define DEFAULT_VIDEO_SINK_ASYNC FALSE
45 #define DEFAULT_USER_AGENT "TIZEN3_0/WFD-SINK"
48 #define DEFAULT_GENERATE_DOT FALSE
49 #define DEFAULT_DUMP_RTSP_MESSAGE TRUE
50 #define DEFAULT_TRACE_BUFFERS FALSE
51 #define DEFAULT_TRACE_FIRST_BUFFER TRUE
52 #define DEFAULT_TRACE_BUFFERS_OF_WFDSRC FALSE
53 #define DEFAULT_DUMP_TS_DATA FALSE
54 #define DEFAULT_DUMP_RTP_DATA FALSE
57 #define DEFAULT_NAME_OF_SOURCE "wfdsrc"
58 #define DEFAULT_NAME_OF_TSDEMUX ""
59 #define DEFAULT_NAME_OF_AUDIO_HDCP ""
60 #define DEFAULT_NAME_OF_AAC_PARSER ""
61 #define DEFAULT_NAME_OF_AAC_DECODER ""
62 #define DEFAULT_NAME_OF_AC3_PARSER ""
63 #define DEFAULT_NAME_OF_AC3_DECODER ""
64 #define DEFAULT_NAME_OF_LPCM_CONVERTER ""
65 #define DEFAULT_NAME_OF_LPCM_FILTER ""
66 #define DEFAULT_NAME_OF_AUDIO_RESAMPLER ""
67 #define DEFAULT_NAME_OF_AUDIO_VOLUME ""
68 #define DEFAULT_NAME_OF_AUDIO_SINKBIN_QUEUE ""
69 #define DEFAULT_NAME_OF_AUDIO_SINK ""
70 #define DEFAULT_NAME_OF_VIDEO_HDCP ""
71 #define DEFAULT_NAME_OF_VIDEO_H264_PARSER ""
72 #define DEFAULT_NAME_OF_VIDEO_H264_DECODER ""
73 #define DEFAULT_NAME_OF_VIDEO_H265_PARSER ""
74 #define DEFAULT_NAME_OF_VIDEO_H265_DECODER ""
75 #define DEFAULT_NAME_OF_VIDEO_CONVERTER ""
76 #define DEFAULT_NAME_OF_VIDEO_FILTER ""
77 #define DEFAULT_NAME_OF_VIDEO_SINK ""
78 #define DEFAULT_NAME_OF_EVAS_VIDEO_SINK ""
81 #define DEFAULT_WFD_AUDIO_CODECS_CODEC WFD_AUDIO_LPCM | WFD_AUDIO_AAC
82 #define DEFAULT_WFD_AUDIO_CODECS_LATENCY 0x0
83 #define DEFAULT_WFD_AUDIO_CODECS_CHANNELS WFD_CHANNEL_2
84 #define DEFAULT_WFD_AUDIO_CODECS_SAMP_FREQUENCY WFD_FREQ_44100 | WFD_FREQ_48000
87 #define DEFAULT_WFD_VIDEO_FORMATS_CODEC WFD_VIDEO_H264
88 #define DEFAULT_WFD_VIDEO_FORMATS_NATIVE_RESOLUTION 0x20
89 /* CEA : WFD_CEA_640x480P60 | WFD_CEA_720x480P60 |WFD_CEA_720x576P50 |WFD_CEA_1280x720P30 |
90 WFD_CEA_1280x720P25 | WFD_CEA_1280x720P24 */
91 #define DEFAULT_WFD_VIDEO_FORMATS_CEA_SUPPORT "0x84ab"
92 /* VESA : WFD_VESA_800x600P30 */
93 #define DEFAULT_WFD_VIDEO_FORMATS_VESA_SUPPORT "0x1"
94 /* HH : WFD_HH_800x480P30 | WFD_HH_854x480P30 | WFD_HH_864x480P30 | WFD_HH_640x360P30 | WFD_HH_960x540P30 | WFD_HH_848x480P30 */
95 #define DEFAULT_WFD_VIDEO_FORMATS_HH_SUPPORT "0x555"
96 #define DEFAULT_WFD_VIDEO_FORMATS_PROFILE WFD_H264_BASE_PROFILE
97 #define DEFAULT_WFD_VIDEO_FORMATS_LEVEL WFD_H264_LEVEL_3_2
98 #define DEFAULT_WFD_VIDEO_FORMATS_LATENCY 0x0
99 #define DEFAULT_WFD_VIDEO_FORMATS_VERTICAL_RESOLUTION 720
100 #define DEFAULT_WFD_VIDEO_FORMATS_HORIZONTAL_RESOLUTION 1280
101 #define DEFAULT_WFD_VIDEO_FORMATS_MIN_SLICESIZE 0
102 #define DEFAULT_WFD_VIDEO_FORMATS_SLICE_ENC_PARAM 200
103 #define DEFAULT_WFD_VIDEO_FORMATS_FRAMERATE_CONTROL 11
106 #define DEFAULT_WFD2_VIDEO_FORMATS_CODEC WFD_VIDEO_H265 | WFD_VIDEO_H264
107 #define DEFAULT_WFD2_VIDEO_FORMATS_NATIVE_RESOLUTION 0x20
108 #define DEFAULT_WFD2_VIDEO_FORMATS_NON_TRANSCODING_SUPPORT 0
111 #define DEFAULT_WFD2_VIDEO_H264_CEA_SUPPORT "0x84ab"
112 #define DEFAULT_WFD2_VIDEO_H264_VESA_SUPPORT "0x1"
113 #define DEFAULT_WFD2_VIDEO_H264_HH_SUPPORT "0x555"
114 #define DEFAULT_WFD2_VIDEO_H264_PROFILE WFD_H264_BASE_PROFILE
115 #define DEFAULT_WFD2_VIDEO_H264_LEVEL WFD_H264_LEVEL_3_2
116 #define DEFAULT_WFD2_VIDEO_H264_LATENCY 0x0
117 #define DEFAULT_WFD2_VIDEO_H264_VERTICAL_RESOLUTION 720
118 #define DEFAULT_WFD2_VIDEO_H264_HORIZONTAL_RESOLUTION 1280
119 #define DEFAULT_WFD2_VIDEO_H264_MIN_SLICESIZE 0
120 #define DEFAULT_WFD2_VIDEO_H264_SLICE_ENC_PARAM 200
121 #define DEFAULT_WFD2_VIDEO_H264_FRAMERATE_CONTROL 11
124 #define DEFAULT_WFD2_VIDEO_H265_CEA_SUPPORT "0x84ab"
125 #define DEFAULT_WFD2_VIDEO_H265_VESA_SUPPORT "0x1"
126 #define DEFAULT_WFD2_VIDEO_H265_HH_SUPPORT "0x555"
127 #define DEFAULT_WFD2_VIDEO_H265_PROFILE WFD_H265_MAIN_PROFILE
128 #define DEFAULT_WFD2_VIDEO_H265_LEVEL WFD_H265_LEVEL_3_1
129 #define DEFAULT_WFD2_VIDEO_H265_LATENCY 0x0
130 #define DEFAULT_WFD2_VIDEO_H265_VERTICAL_RESOLUTION 720
131 #define DEFAULT_WFD2_VIDEO_H265_HORIZONTAL_RESOLUTION 1280
132 #define DEFAULT_WFD2_VIDEO_H265_MIN_SLICESIZE 0
133 #define DEFAULT_WFD2_VIDEO_H265_SLICE_ENC_PARAM 200
134 #define DEFAULT_WFD2_VIDEO_H265_FRAMERATE_CONTROL 11
137 #define DEFAULT_WFD2_AUDIO_CODECS_CODEC WFD_AUDIO_LPCM | WFD_AUDIO_AAC
138 #define DEFAULT_WFD2_AUDIO_CODECS_LPCM_MODE GST_LPCM_441KH_16B_2C | GST_LPCM_48KH_16B_2C
139 #define DEFAULT_WFD2_AUDIO_CODECS_AAC_MODE GST_AAC_48KH_16B_2C
140 #define DEFAULT_WFD2_AUDIO_CODECS_AC3_MODE GST_AC3_48KH_16B_2C
143 #define DEFAULT_ENABLE_HDCP FALSE
144 #define DEFAULT_WFD_HDCP_CONTENT_PROTECTION 0x0
145 #define DEFAULT_WFD_HDCP_PORT_NO 0
148 static gboolean loaded = FALSE;
150 /* global variables here */
151 #ifdef MM_WFD_SINK_DEFAULT_INI
152 static gboolean __generate_sink_default_ini(void);
155 static void __mm_wfd_sink_ini_check_status(const char *path);
158 #define MM_WFD_SINK_INI_GET_STRING(x_dict, x_item, x_ini, x_default) \
163 str = iniparser_getstring(x_dict, x_ini, (char *)x_default); \
165 length = strlen(str); \
166 if ((length > 1) && (length < WFD_SINK_INI_MAX_STRLEN)) \
167 strncpy(x_item, str, WFD_SINK_INI_MAX_STRLEN-1); \
169 strncpy(x_item, x_default, WFD_SINK_INI_MAX_STRLEN-1); \
171 strncpy(x_item, x_default, WFD_SINK_INI_MAX_STRLEN-1); \
175 #ifdef MM_WFD_SINK_DEFAULT_INI
177 gboolean __generate_sink_default_ini(void)
180 const gchar *default_ini = MM_WFD_SINK_DEFAULT_INI;
183 /* create new file */
184 fp = fopen(MM_WFD_SINK_INI_DEFAULT_PATH, "wt");
189 /* writing default ini file */
190 if (strlen(default_ini) != fwrite(default_ini, 1, strlen(default_ini), fp)) {
201 mm_wfd_sink_ini_load(mm_wfd_sink_ini_t *ini, const char *path)
203 dictionary *dict = NULL;
204 char tempstr[WFD_SINK_INI_MAX_STRLEN] = {0,};
206 wfd_sink_debug_fenter();
208 __mm_wfd_sink_ini_check_status(path);
210 wfd_sink_debug("ini path : %s", path);
212 /* first, try to load existing ini file */
213 dict = iniparser_load(path);
215 /* if no file exists. create one with set of default values */
217 #ifdef MM_WFD_SINK_DEFAULT_INI
218 wfd_sink_debug("No inifile found. create default ini file.");
219 if (FALSE == __generate_sink_default_ini()) {
220 wfd_sink_error("Creating default ini file failed. Use default values.");
222 /* load default ini */
223 dict = iniparser_load(MM_WFD_SINK_INI_DEFAULT_PATH);
226 wfd_sink_error("No ini file found. ");
228 return MM_ERROR_FILE_NOT_FOUND;
233 memset(ini, 0, sizeof(mm_wfd_sink_ini_t));
235 if (dict) { /* if dict is available */
237 MM_WFD_SINK_INI_GET_STRING(dict, ini->gst_param[0], "general:gstparam1", DEFAULT_GST_PARAM);
238 MM_WFD_SINK_INI_GET_STRING(dict, ini->gst_param[1], "general:gstparam2", DEFAULT_GST_PARAM);
239 MM_WFD_SINK_INI_GET_STRING(dict, ini->gst_param[2], "general:gstparam3", DEFAULT_GST_PARAM);
240 MM_WFD_SINK_INI_GET_STRING(dict, ini->gst_param[3], "general:gstparam4", DEFAULT_GST_PARAM);
241 MM_WFD_SINK_INI_GET_STRING(dict, ini->gst_param[4], "general:gstparam5", DEFAULT_GST_PARAM);
242 ini->state_change_timeout = iniparser_getint(dict, "general:state change timeout", DEFAULT_STATE_CHANGE_TIMEOUT);
243 ini->enable_rm = iniparser_getboolean(dict, "general:enable rm", DEFAULT_ENABLE_RM);
244 ini->jitter_buffer_latency = iniparser_getint(dict, "general:jitter buffer latency", DEFAULT_JITTER_BUFFER_LATENCY);
245 ini->enable_retransmission = iniparser_getboolean(dict, "general:enable retransmission", DEFAULT_ENABLE_RETRANSMISSION);
246 ini->enable_reset_basetime = iniparser_getboolean(dict, "general:enable reset basetime", DEFAULT_ENABLE_RESET_BASETIME);
247 ini->video_sink_max_lateness = iniparser_getint(dict, "general:video sink max lateness", DEFAULT_VIDEO_SINK_MAX_LATENESS);
248 ini->sink_ts_offset = iniparser_getint(dict, "general:sink ts offset", DEFAULT_SINK_TS_OFFSET);
249 ini->audio_sink_async = iniparser_getboolean(dict, "general:audio sink async", DEFAULT_AUDIO_SINK_ASYNC);
250 ini->video_sink_async = iniparser_getboolean(dict, "general:video sink async", DEFAULT_VIDEO_SINK_ASYNC);
251 MM_WFD_SINK_INI_GET_STRING(dict, ini->user_agent, "general:user agent", DEFAULT_USER_AGENT);
254 ini->generate_dot = iniparser_getboolean(dict, "debug:generate dot", DEFAULT_GENERATE_DOT);
255 ini->dump_rtsp_message = iniparser_getboolean(dict, "debug:dump rtsp message", DEFAULT_DUMP_RTSP_MESSAGE);
256 ini->trace_buffers = iniparser_getboolean(dict, "debug:trace buffers", DEFAULT_TRACE_BUFFERS);
257 ini->trace_first_buffer = iniparser_getboolean(dict, "debug:trace first buffer", DEFAULT_TRACE_FIRST_BUFFER);
258 ini->trace_buffers_of_wfdsrc = iniparser_getboolean(dict, "debug:trace buffers of wfdsrc", DEFAULT_TRACE_BUFFERS_OF_WFDSRC);
259 ini->dump_ts_data = iniparser_getboolean(dict, "debug:dump ts data", DEFAULT_DUMP_TS_DATA);
260 ini->dump_rtp_data = iniparser_getboolean(dict, "debug:dump rtp data", DEFAULT_DUMP_RTP_DATA);
263 MM_WFD_SINK_INI_GET_STRING(dict, ini->name_of_source, "pipeline:wfdsrc element", DEFAULT_NAME_OF_SOURCE);
264 MM_WFD_SINK_INI_GET_STRING(dict, ini->name_of_tsdemux, "pipeline:tsdemux element", DEFAULT_NAME_OF_TSDEMUX);
265 MM_WFD_SINK_INI_GET_STRING(dict, ini->name_of_audio_hdcp, "pipeline:audio hdcp element", DEFAULT_NAME_OF_AUDIO_HDCP);
266 MM_WFD_SINK_INI_GET_STRING(dict, ini->name_of_aac_parser, "pipeline:aac parser element", DEFAULT_NAME_OF_AAC_PARSER);
267 MM_WFD_SINK_INI_GET_STRING(dict, ini->name_of_aac_decoder, "pipeline:aac decoder element", DEFAULT_NAME_OF_AAC_DECODER);
268 MM_WFD_SINK_INI_GET_STRING(dict, ini->name_of_ac3_parser, "pipeline:ac3 parser element", DEFAULT_NAME_OF_AC3_PARSER);
269 MM_WFD_SINK_INI_GET_STRING(dict, ini->name_of_ac3_decoder, "pipeline:ac3 decoder element", DEFAULT_NAME_OF_AC3_DECODER);
270 MM_WFD_SINK_INI_GET_STRING(dict, ini->name_of_lpcm_converter, "pipeline:lpcm converter element", DEFAULT_NAME_OF_LPCM_CONVERTER);
271 MM_WFD_SINK_INI_GET_STRING(dict, ini->name_of_lpcm_filter, "pipeline:lpcm filter element", DEFAULT_NAME_OF_LPCM_FILTER);
272 MM_WFD_SINK_INI_GET_STRING(dict, ini->name_of_audio_resampler, "pipeline:audio resampler element", DEFAULT_NAME_OF_AUDIO_RESAMPLER);
273 MM_WFD_SINK_INI_GET_STRING(dict, ini->name_of_audio_volume, "pipeline:audio volume element", DEFAULT_NAME_OF_AUDIO_VOLUME);
274 MM_WFD_SINK_INI_GET_STRING(dict, ini->name_of_audio_sinkbin_queue, "pipeline:audio sinkbin queue element", DEFAULT_NAME_OF_AUDIO_SINKBIN_QUEUE);
275 MM_WFD_SINK_INI_GET_STRING(dict, ini->name_of_audio_sink, "pipeline:audio sink element", DEFAULT_NAME_OF_AUDIO_SINK);
276 MM_WFD_SINK_INI_GET_STRING(dict, ini->name_of_video_hdcp, "pipeline:video hdcp element", DEFAULT_NAME_OF_VIDEO_HDCP);
277 MM_WFD_SINK_INI_GET_STRING(dict, ini->name_of_video_h264_parser, "pipeline:video h264 parser element", DEFAULT_NAME_OF_VIDEO_H264_PARSER);
278 MM_WFD_SINK_INI_GET_STRING(dict, ini->name_of_video_h264_decoder, "pipeline:video h264 decoder element", DEFAULT_NAME_OF_VIDEO_H264_DECODER);
279 MM_WFD_SINK_INI_GET_STRING(dict, ini->name_of_video_h265_parser, "pipeline:video h265 parser element", DEFAULT_NAME_OF_VIDEO_H265_PARSER);
280 MM_WFD_SINK_INI_GET_STRING(dict, ini->name_of_video_h265_decoder, "pipeline:video h265 decoder element", DEFAULT_NAME_OF_VIDEO_H265_DECODER);
281 MM_WFD_SINK_INI_GET_STRING(dict, ini->name_of_video_converter, "pipeline:video converter element", DEFAULT_NAME_OF_VIDEO_CONVERTER);
282 MM_WFD_SINK_INI_GET_STRING(dict, ini->name_of_video_filter, "pipeline:video filter element", DEFAULT_NAME_OF_VIDEO_FILTER);
283 MM_WFD_SINK_INI_GET_STRING(dict, ini->name_of_video_sink, "pipeline:video sink element", DEFAULT_NAME_OF_VIDEO_SINK);
284 MM_WFD_SINK_INI_GET_STRING(dict, ini->name_of_video_evas_sink, "pipeline:video evas sink element", DEFAULT_NAME_OF_EVAS_VIDEO_SINK);
287 ini->wfd_audio_codecs.audio_codec = iniparser_getint(dict, "wfd audio codecs:audio codec", DEFAULT_WFD_AUDIO_CODECS_CODEC);
288 ini->wfd_audio_codecs.audio_latency = iniparser_getint(dict, "wfd audio codecs:audio latency", DEFAULT_WFD_AUDIO_CODECS_LATENCY);
289 ini->wfd_audio_codecs.audio_channel = iniparser_getint(dict, "wfd audio codecs:audio channels", DEFAULT_WFD_AUDIO_CODECS_CHANNELS);
290 ini->wfd_audio_codecs.audio_sampling_frequency = iniparser_getint(dict, "wfd audio codecs:audio sampling frequency", DEFAULT_WFD_AUDIO_CODECS_SAMP_FREQUENCY);
293 ini->wfd_video_formats.video_codec = iniparser_getint(dict, "wfd video formats:video codec", DEFAULT_WFD_VIDEO_FORMATS_CODEC);
294 ini->wfd_video_formats.video_native_resolution = iniparser_getint(dict, "wfd video formats:video native resolution", DEFAULT_WFD_VIDEO_FORMATS_NATIVE_RESOLUTION);
295 memset(tempstr, 0x00, WFD_SINK_INI_MAX_STRLEN);
296 MM_WFD_SINK_INI_GET_STRING(dict, tempstr, "wfd video formats:video cea support", DEFAULT_WFD_VIDEO_FORMATS_CEA_SUPPORT);
297 ini->wfd_video_formats.video_cea_support = strtoul(tempstr, NULL, 16);
298 memset(tempstr, 0x00, WFD_SINK_INI_MAX_STRLEN);
299 MM_WFD_SINK_INI_GET_STRING(dict, tempstr, "wfd video formats:video vesa support", DEFAULT_WFD_VIDEO_FORMATS_VESA_SUPPORT);
300 ini->wfd_video_formats.video_vesa_support = strtoul(tempstr, NULL, 16);
301 memset(tempstr, 0x00, WFD_SINK_INI_MAX_STRLEN);
302 MM_WFD_SINK_INI_GET_STRING(dict, tempstr, "wfd video formats:video hh support", DEFAULT_WFD_VIDEO_FORMATS_HH_SUPPORT);
303 ini->wfd_video_formats.video_hh_support = strtoul(tempstr, NULL, 16);
304 ini->wfd_video_formats.video_profile = iniparser_getint(dict, "wfd video formats:video profile", DEFAULT_WFD_VIDEO_FORMATS_PROFILE);
305 ini->wfd_video_formats.video_level = iniparser_getint(dict, "wfd video formats:video level", DEFAULT_WFD_VIDEO_FORMATS_LEVEL);
306 ini->wfd_video_formats.video_latency = iniparser_getint(dict, "wfd video formats:video latency", DEFAULT_WFD_VIDEO_FORMATS_LATENCY);
307 ini->wfd_video_formats.video_vertical_resolution = iniparser_getint(dict, "wfd video formats:video vertical resolution", DEFAULT_WFD_VIDEO_FORMATS_VERTICAL_RESOLUTION);
308 ini->wfd_video_formats.video_horizontal_resolution = iniparser_getint(dict, "wfd video formats:video horizontal resolution", DEFAULT_WFD_VIDEO_FORMATS_HORIZONTAL_RESOLUTION);
309 ini->wfd_video_formats.video_minimum_slicing = iniparser_getint(dict, "wfd video formats:video minimum slicesize", DEFAULT_WFD_VIDEO_FORMATS_MIN_SLICESIZE);
310 ini->wfd_video_formats.video_slice_enc_param = iniparser_getint(dict, "wfd video formats:video slice encoding params", DEFAULT_WFD_VIDEO_FORMATS_SLICE_ENC_PARAM);
311 ini->wfd_video_formats.video_framerate_control_support = iniparser_getint(dict, "wfd video formats:video framerate control support", DEFAULT_WFD_VIDEO_FORMATS_FRAMERATE_CONTROL);
314 ini->wfd_content_protection.enable_hdcp = iniparser_getboolean(dict, "wfd hdcp content protection:enable hdcp", DEFAULT_ENABLE_HDCP);
315 ini->wfd_content_protection.hdcp_content_protection = iniparser_getint(dict, "wfd hdcp content protection:hdcp content protection", DEFAULT_WFD_HDCP_CONTENT_PROTECTION);
316 ini->wfd_content_protection.hdcp_port_no = iniparser_getint(dict, "wfd hdcp content protection:hdcp port no", DEFAULT_WFD_HDCP_PORT_NO);
318 /* video r2 parameter*/
319 ini->wfd2_video_formats.video_codec = iniparser_getint(dict, "wfd2 video formats:video codec", DEFAULT_WFD2_VIDEO_FORMATS_CODEC);
320 ini->wfd2_video_formats.video_native_resolution = iniparser_getint(dict, "wfd2 video formats:video native resolution", DEFAULT_WFD2_VIDEO_FORMATS_NATIVE_RESOLUTION);
321 ini->wfd2_video_formats.video_non_transcoding_support = iniparser_getint(dict, "wfd2 video formats:video non transcoding support", DEFAULT_WFD2_VIDEO_FORMATS_NON_TRANSCODING_SUPPORT);
323 /* video h264 info */
324 memset(tempstr, 0x00, WFD_SINK_INI_MAX_STRLEN);
325 MM_WFD_SINK_INI_GET_STRING(dict, tempstr, "wfd2 h264 video format:video cea support", DEFAULT_WFD2_VIDEO_H264_CEA_SUPPORT);
326 ini->wfd2_video_h264_info.video_cea_support = strtoul(tempstr, NULL, 16);
327 memset(tempstr, 0x00, WFD_SINK_INI_MAX_STRLEN);
328 MM_WFD_SINK_INI_GET_STRING(dict, tempstr, "wfd2 h264 video format:video vesa support", DEFAULT_WFD2_VIDEO_H264_VESA_SUPPORT);
329 ini->wfd2_video_h264_info.video_vesa_support = strtoul(tempstr, NULL, 16);
330 memset(tempstr, 0x00, WFD_SINK_INI_MAX_STRLEN);
331 MM_WFD_SINK_INI_GET_STRING(dict, tempstr, "wfd2 h264 video format:video hh support", DEFAULT_WFD2_VIDEO_H264_HH_SUPPORT);
332 ini->wfd2_video_h264_info.video_hh_support = strtoul(tempstr, NULL, 16);
333 ini->wfd2_video_h264_info.video_profile = iniparser_getint(dict, "wfd2 h264 video format:video profile", DEFAULT_WFD2_VIDEO_H264_PROFILE);
334 ini->wfd2_video_h264_info.video_level = iniparser_getint(dict, "wfd2 h264 video format:video level", DEFAULT_WFD2_VIDEO_H264_LEVEL);
335 ini->wfd2_video_h264_info.video_latency = iniparser_getint(dict, "wfd2 h264 video format:video latency", DEFAULT_WFD2_VIDEO_H264_LATENCY);
336 ini->wfd2_video_h264_info.video_vertical_resolution = iniparser_getint(dict, "wfd2 h264 video format:video vertical resolution", DEFAULT_WFD2_VIDEO_H264_VERTICAL_RESOLUTION);
337 ini->wfd2_video_h264_info.video_horizontal_resolution = iniparser_getint(dict, "wfd2 h264 video format:video horizontal resolution", DEFAULT_WFD2_VIDEO_H264_HORIZONTAL_RESOLUTION);
338 ini->wfd2_video_h264_info.video_minimum_slicing = iniparser_getint(dict, "wfd2 h264 video format:video minimum slicesize", DEFAULT_WFD2_VIDEO_H264_MIN_SLICESIZE);
339 ini->wfd2_video_h264_info.video_slice_enc_param = iniparser_getint(dict, "wfd2 h264 video format:video slice encoding params", DEFAULT_WFD2_VIDEO_H264_SLICE_ENC_PARAM);
340 ini->wfd2_video_h264_info.video_framerate_control_support = iniparser_getint(dict, "wfd2 h264 video format:video framerate control support", DEFAULT_WFD2_VIDEO_H264_FRAMERATE_CONTROL);
342 /* video h265 info */
343 memset(tempstr, 0x00, WFD_SINK_INI_MAX_STRLEN);
344 MM_WFD_SINK_INI_GET_STRING(dict, tempstr, "wfd2 h265 video format:video cea support", DEFAULT_WFD2_VIDEO_H265_CEA_SUPPORT);
345 ini->wfd2_video_h265_info.video_cea_support = strtoul(tempstr, NULL, 16);
346 memset(tempstr, 0x00, WFD_SINK_INI_MAX_STRLEN);
347 MM_WFD_SINK_INI_GET_STRING(dict, tempstr, "wfd2 h265 video format:video vesa support", DEFAULT_WFD2_VIDEO_H265_VESA_SUPPORT);
348 ini->wfd2_video_h265_info.video_vesa_support = strtoul(tempstr, NULL, 16);
349 memset(tempstr, 0x00, WFD_SINK_INI_MAX_STRLEN);
350 MM_WFD_SINK_INI_GET_STRING(dict, tempstr, "wfd2 h265 video format:video hh support", DEFAULT_WFD2_VIDEO_H265_HH_SUPPORT);
351 ini->wfd2_video_h265_info.video_hh_support = strtoul(tempstr, NULL, 16);
352 ini->wfd2_video_h265_info.video_profile = iniparser_getint(dict, "wfd2 h265 video format:video profile", DEFAULT_WFD2_VIDEO_H265_PROFILE);
353 ini->wfd2_video_h265_info.video_level = iniparser_getint(dict, "wfd2 h265 video format:video level", DEFAULT_WFD2_VIDEO_H265_LEVEL);
354 ini->wfd2_video_h265_info.video_latency = iniparser_getint(dict, "wfd2 h265 video format:video latency", DEFAULT_WFD2_VIDEO_H265_LATENCY);
355 ini->wfd2_video_h265_info.video_vertical_resolution = iniparser_getint(dict, "wfd2 h265 video format:video vertical resolution", DEFAULT_WFD2_VIDEO_H265_VERTICAL_RESOLUTION);
356 ini->wfd2_video_h265_info.video_horizontal_resolution = iniparser_getint(dict, "wfd2 h265 video format:video horizontal resolution", DEFAULT_WFD2_VIDEO_H265_HORIZONTAL_RESOLUTION);
357 ini->wfd2_video_h265_info.video_minimum_slicing = iniparser_getint(dict, "wfd2 h265 video format:video minimum slicesize", DEFAULT_WFD2_VIDEO_H265_MIN_SLICESIZE);
358 ini->wfd2_video_h265_info.video_slice_enc_param = iniparser_getint(dict, "wfd2 h265 video format:video slice encoding params", DEFAULT_WFD2_VIDEO_H265_SLICE_ENC_PARAM);
359 ini->wfd2_video_h265_info.video_framerate_control_support = iniparser_getint(dict, "wfd2 h265 video format:video framerate control support", DEFAULT_WFD2_VIDEO_H265_FRAMERATE_CONTROL);
361 /* audio r2 parameter*/
362 ini->wfd2_audio_codecs.audio_codec = iniparser_getint(dict, "wfd2 audio codecs:audio codec", DEFAULT_WFD2_AUDIO_CODECS_CODEC);
363 ini->wfd2_audio_codecs.audio_lpcm_mode = iniparser_getint(dict, "wfd2 audio codecs:audio lpcm mode", DEFAULT_WFD2_AUDIO_CODECS_LPCM_MODE);
364 ini->wfd2_audio_codecs.audio_aac_mode = iniparser_getint(dict, "wfd2 audio codecs:audio aac mode", DEFAULT_WFD2_AUDIO_CODECS_AAC_MODE);
365 ini->wfd2_audio_codecs.audio_ac3_mode = iniparser_getint(dict, "wfd2 audio codecs:audio ac3 mode", DEFAULT_WFD2_AUDIO_CODECS_AC3_MODE);
366 } else { /* if dict is not available just fill the structure with default value */
367 wfd_sink_error("failed to load ini. using hardcoded default");
370 strncpy(ini->gst_param[0], DEFAULT_GST_PARAM, WFD_SINK_INI_MAX_STRLEN - 1);
371 strncpy(ini->gst_param[1], DEFAULT_GST_PARAM, WFD_SINK_INI_MAX_STRLEN - 1);
372 strncpy(ini->gst_param[2], DEFAULT_GST_PARAM, WFD_SINK_INI_MAX_STRLEN - 1);
373 strncpy(ini->gst_param[3], DEFAULT_GST_PARAM, WFD_SINK_INI_MAX_STRLEN - 1);
374 strncpy(ini->gst_param[4], DEFAULT_GST_PARAM, WFD_SINK_INI_MAX_STRLEN - 1);
375 ini->state_change_timeout = DEFAULT_STATE_CHANGE_TIMEOUT;
376 ini->enable_rm = DEFAULT_ENABLE_RM;
377 ini->jitter_buffer_latency = DEFAULT_JITTER_BUFFER_LATENCY;
378 ini->enable_retransmission = DEFAULT_ENABLE_RETRANSMISSION;
379 ini->enable_reset_basetime = DEFAULT_ENABLE_RESET_BASETIME;
380 ini->video_sink_max_lateness = DEFAULT_VIDEO_SINK_MAX_LATENESS;
381 ini->sink_ts_offset = DEFAULT_SINK_TS_OFFSET;
382 strncpy(ini->user_agent, DEFAULT_USER_AGENT, WFD_SINK_INI_MAX_STRLEN - 1);
385 ini->generate_dot = DEFAULT_GENERATE_DOT;
386 ini->dump_rtsp_message = DEFAULT_DUMP_RTSP_MESSAGE;
387 ini->trace_buffers = DEFAULT_TRACE_BUFFERS;
388 ini->trace_first_buffer = DEFAULT_TRACE_FIRST_BUFFER;
389 ini->trace_buffers_of_wfdsrc = DEFAULT_TRACE_BUFFERS_OF_WFDSRC;
390 ini->dump_ts_data = DEFAULT_DUMP_TS_DATA;
391 ini->dump_rtp_data = DEFAULT_DUMP_RTP_DATA;
394 strncpy(ini->name_of_source, DEFAULT_NAME_OF_SOURCE, WFD_SINK_INI_MAX_STRLEN - 1);
395 strncpy(ini->name_of_tsdemux, DEFAULT_NAME_OF_TSDEMUX, WFD_SINK_INI_MAX_STRLEN - 1);
396 strncpy(ini->name_of_audio_hdcp, DEFAULT_NAME_OF_AUDIO_HDCP, WFD_SINK_INI_MAX_STRLEN - 1);
397 strncpy(ini->name_of_aac_parser, DEFAULT_NAME_OF_AAC_PARSER, WFD_SINK_INI_MAX_STRLEN - 1);
398 strncpy(ini->name_of_aac_decoder, DEFAULT_NAME_OF_AAC_DECODER, WFD_SINK_INI_MAX_STRLEN - 1);
399 strncpy(ini->name_of_ac3_parser, DEFAULT_NAME_OF_AC3_PARSER, WFD_SINK_INI_MAX_STRLEN - 1);
400 strncpy(ini->name_of_ac3_decoder, DEFAULT_NAME_OF_AC3_DECODER, WFD_SINK_INI_MAX_STRLEN - 1);
401 strncpy(ini->name_of_lpcm_converter, DEFAULT_NAME_OF_LPCM_CONVERTER, WFD_SINK_INI_MAX_STRLEN - 1);
402 strncpy(ini->name_of_lpcm_filter, DEFAULT_NAME_OF_LPCM_FILTER, WFD_SINK_INI_MAX_STRLEN - 1);
403 strncpy(ini->name_of_audio_resampler, DEFAULT_NAME_OF_AUDIO_RESAMPLER, WFD_SINK_INI_MAX_STRLEN - 1);
404 strncpy(ini->name_of_audio_volume, DEFAULT_NAME_OF_AUDIO_VOLUME, WFD_SINK_INI_MAX_STRLEN - 1);
405 strncpy(ini->name_of_audio_sinkbin_queue, DEFAULT_NAME_OF_AUDIO_SINKBIN_QUEUE, WFD_SINK_INI_MAX_STRLEN - 1);
406 strncpy(ini->name_of_audio_sink, DEFAULT_NAME_OF_AUDIO_SINK, WFD_SINK_INI_MAX_STRLEN - 1);
407 strncpy(ini->name_of_video_hdcp, DEFAULT_NAME_OF_VIDEO_HDCP, WFD_SINK_INI_MAX_STRLEN - 1);
408 strncpy(ini->name_of_video_h264_parser, DEFAULT_NAME_OF_VIDEO_H264_PARSER, WFD_SINK_INI_MAX_STRLEN - 1);
409 strncpy(ini->name_of_video_h264_decoder, DEFAULT_NAME_OF_VIDEO_H264_DECODER, WFD_SINK_INI_MAX_STRLEN - 1);
410 strncpy(ini->name_of_video_h265_parser, DEFAULT_NAME_OF_VIDEO_H265_PARSER, WFD_SINK_INI_MAX_STRLEN - 1);
411 strncpy(ini->name_of_video_h265_decoder, DEFAULT_NAME_OF_VIDEO_H265_DECODER, WFD_SINK_INI_MAX_STRLEN - 1);
412 strncpy(ini->name_of_video_converter, DEFAULT_NAME_OF_VIDEO_CONVERTER, WFD_SINK_INI_MAX_STRLEN - 1);
413 strncpy(ini->name_of_video_filter, DEFAULT_NAME_OF_VIDEO_FILTER, WFD_SINK_INI_MAX_STRLEN - 1);
414 strncpy(ini->name_of_video_sink, DEFAULT_NAME_OF_VIDEO_SINK, WFD_SINK_INI_MAX_STRLEN - 1);
415 strncpy(ini->name_of_video_evas_sink, DEFAULT_NAME_OF_EVAS_VIDEO_SINK, WFD_SINK_INI_MAX_STRLEN - 1);
418 ini->wfd_audio_codecs.audio_codec = DEFAULT_WFD_AUDIO_CODECS_CODEC;
419 ini->wfd_audio_codecs.audio_latency = DEFAULT_WFD_AUDIO_CODECS_LATENCY;
420 ini->wfd_audio_codecs.audio_channel = DEFAULT_WFD_AUDIO_CODECS_CHANNELS;
421 ini->wfd_audio_codecs.audio_sampling_frequency = DEFAULT_WFD_AUDIO_CODECS_SAMP_FREQUENCY;
424 ini->wfd_video_formats.video_codec = DEFAULT_WFD_VIDEO_FORMATS_CODEC;
425 ini->wfd_video_formats.video_native_resolution = DEFAULT_WFD_VIDEO_FORMATS_NATIVE_RESOLUTION;
426 ini->wfd_video_formats.video_cea_support = strtoul(DEFAULT_WFD_VIDEO_FORMATS_CEA_SUPPORT, NULL, 16);
427 ini->wfd_video_formats.video_vesa_support = strtoul(DEFAULT_WFD_VIDEO_FORMATS_VESA_SUPPORT, NULL, 16);
428 ini->wfd_video_formats.video_hh_support = strtoul(DEFAULT_WFD_VIDEO_FORMATS_HH_SUPPORT, NULL, 16);
429 ini->wfd_video_formats.video_profile = DEFAULT_WFD_VIDEO_FORMATS_PROFILE;
430 ini->wfd_video_formats.video_level = DEFAULT_WFD_VIDEO_FORMATS_LEVEL;
431 ini->wfd_video_formats.video_latency = DEFAULT_WFD_VIDEO_FORMATS_LATENCY;
432 ini->wfd_video_formats.video_vertical_resolution = DEFAULT_WFD_VIDEO_FORMATS_VERTICAL_RESOLUTION;
433 ini->wfd_video_formats.video_horizontal_resolution = DEFAULT_WFD_VIDEO_FORMATS_HORIZONTAL_RESOLUTION;
434 ini->wfd_video_formats.video_minimum_slicing = DEFAULT_WFD_VIDEO_FORMATS_MIN_SLICESIZE;
435 ini->wfd_video_formats.video_slice_enc_param = DEFAULT_WFD_VIDEO_FORMATS_SLICE_ENC_PARAM;
436 ini->wfd_video_formats.video_framerate_control_support = DEFAULT_WFD_VIDEO_FORMATS_FRAMERATE_CONTROL;
439 ini->wfd_content_protection.enable_hdcp = DEFAULT_ENABLE_HDCP;
440 ini->wfd_content_protection.hdcp_content_protection = DEFAULT_WFD_HDCP_CONTENT_PROTECTION;
441 ini->wfd_content_protection.hdcp_port_no = DEFAULT_WFD_HDCP_PORT_NO;
443 /* video r2 parameter*/
444 ini->wfd2_video_formats.video_codec = DEFAULT_WFD2_VIDEO_FORMATS_CODEC;
445 ini->wfd2_video_formats.video_native_resolution = DEFAULT_WFD2_VIDEO_FORMATS_NATIVE_RESOLUTION;
446 ini->wfd2_video_formats.video_non_transcoding_support = DEFAULT_WFD2_VIDEO_FORMATS_NON_TRANSCODING_SUPPORT;
448 /* video h264 info */
449 ini->wfd2_video_h264_info.video_cea_support = strtoul(DEFAULT_WFD2_VIDEO_H264_CEA_SUPPORT, NULL, 16);
450 ini->wfd2_video_h264_info.video_vesa_support = strtoul(DEFAULT_WFD2_VIDEO_H264_VESA_SUPPORT, NULL, 16);
451 ini->wfd2_video_h264_info.video_hh_support = strtoul(DEFAULT_WFD2_VIDEO_H264_HH_SUPPORT, NULL, 16);
452 ini->wfd2_video_h264_info.video_profile = DEFAULT_WFD2_VIDEO_H264_PROFILE;
453 ini->wfd2_video_h264_info.video_level = DEFAULT_WFD2_VIDEO_H264_LEVEL;
454 ini->wfd2_video_h264_info.video_latency = DEFAULT_WFD2_VIDEO_H264_LATENCY;
455 ini->wfd2_video_h264_info.video_vertical_resolution = DEFAULT_WFD2_VIDEO_H264_VERTICAL_RESOLUTION;
456 ini->wfd2_video_h264_info.video_horizontal_resolution = DEFAULT_WFD2_VIDEO_H264_HORIZONTAL_RESOLUTION;
457 ini->wfd2_video_h264_info.video_minimum_slicing = DEFAULT_WFD2_VIDEO_H264_MIN_SLICESIZE;
458 ini->wfd2_video_h264_info.video_slice_enc_param = DEFAULT_WFD2_VIDEO_H264_SLICE_ENC_PARAM;
459 ini->wfd2_video_h264_info.video_framerate_control_support = DEFAULT_WFD2_VIDEO_H264_FRAMERATE_CONTROL;
461 /* video h265 info */
462 ini->wfd2_video_h265_info.video_cea_support = strtoul(DEFAULT_WFD2_VIDEO_H265_CEA_SUPPORT, NULL, 16);
463 ini->wfd2_video_h265_info.video_vesa_support = strtoul(DEFAULT_WFD2_VIDEO_H265_VESA_SUPPORT, NULL, 16);
464 ini->wfd2_video_h265_info.video_hh_support = strtoul(DEFAULT_WFD2_VIDEO_H265_HH_SUPPORT, NULL, 16);
465 ini->wfd2_video_h265_info.video_profile = DEFAULT_WFD2_VIDEO_H265_PROFILE;
466 ini->wfd2_video_h265_info.video_level = DEFAULT_WFD2_VIDEO_H265_LEVEL;
467 ini->wfd2_video_h265_info.video_latency = DEFAULT_WFD2_VIDEO_H265_LATENCY;
468 ini->wfd2_video_h265_info.video_vertical_resolution = DEFAULT_WFD2_VIDEO_H265_VERTICAL_RESOLUTION;
469 ini->wfd2_video_h265_info.video_horizontal_resolution = DEFAULT_WFD2_VIDEO_H265_HORIZONTAL_RESOLUTION;
470 ini->wfd2_video_h265_info.video_minimum_slicing = DEFAULT_WFD2_VIDEO_H265_MIN_SLICESIZE;
471 ini->wfd2_video_h265_info.video_slice_enc_param = DEFAULT_WFD2_VIDEO_H265_SLICE_ENC_PARAM;
472 ini->wfd2_video_h265_info.video_framerate_control_support = DEFAULT_WFD2_VIDEO_H265_FRAMERATE_CONTROL;
474 /* audio r2 parameter*/
475 ini->wfd2_audio_codecs.audio_codec = DEFAULT_WFD2_AUDIO_CODECS_CODEC;
476 ini->wfd2_audio_codecs.audio_lpcm_mode = DEFAULT_WFD2_AUDIO_CODECS_LPCM_MODE;
477 ini->wfd2_audio_codecs.audio_aac_mode = DEFAULT_WFD2_AUDIO_CODECS_AAC_MODE;
478 ini->wfd2_audio_codecs.audio_ac3_mode = DEFAULT_WFD2_AUDIO_CODECS_AC3_MODE;
481 /* free dict as we got our own structure */
482 iniparser_freedict(dict);
486 wfd_sink_debug("Wi-Fi Display Sink Initial Settings-----------------------------------");
489 wfd_sink_debug("gst_param1 : %s", ini->gst_param[0]);
490 wfd_sink_debug("gst_param2 : %s", ini->gst_param[1]);
491 wfd_sink_debug("gst_param3 : %s", ini->gst_param[2]);
492 wfd_sink_debug("gst_param4 : %s", ini->gst_param[3]);
493 wfd_sink_debug("gst_param5 : %s", ini->gst_param[4]);
494 wfd_sink_debug("state_change_timeout(sec) : %d", ini->state_change_timeout);
495 wfd_sink_debug("enable_rm : %d", ini->enable_rm);
496 wfd_sink_debug("jitter_buffer_latency(msec) : %d", ini->jitter_buffer_latency);
497 wfd_sink_debug("enable_retransmission : %d", ini->enable_retransmission);
498 wfd_sink_debug("enable_reset_basetime : %d", ini->enable_reset_basetime);
499 wfd_sink_debug("video_sink_max_lateness(nsec) : %d", ini->video_sink_max_lateness);
500 wfd_sink_debug("sink_ts_offset(nsec) : %d", ini->sink_ts_offset);
501 wfd_sink_debug("audio_sink_async : %d", ini->audio_sink_async);
502 wfd_sink_debug("video_sink_async : %d", ini->video_sink_async);
503 wfd_sink_debug("user_agent : %s\n", ini->user_agent);
506 wfd_sink_debug("generate_dot : %d", ini->generate_dot);
507 if (ini->generate_dot == TRUE) {
508 wfd_sink_debug("generate_dot is TRUE, dot file will be stored into /tmp/");
509 g_setenv("GST_DEBUG_DUMP_DOT_DIR", "/tmp/", FALSE);
511 wfd_sink_debug("dump_rtsp_message : %d", ini->dump_rtsp_message);
512 wfd_sink_debug("trace_buffers : %d", ini->trace_buffers);
513 wfd_sink_debug("trace_first_buffer : %d", ini->trace_first_buffer);
514 wfd_sink_debug("trace_buffers_of_wfdsrc : %d", ini->trace_buffers_of_wfdsrc);
515 wfd_sink_debug("dump_ts_data : %d", ini->dump_ts_data);
516 wfd_sink_debug("dump_rtp_data : %d", ini->dump_rtp_data);
520 wfd_sink_debug("name_of_source : %s", ini->name_of_source);
521 wfd_sink_debug("name_of_tsdemux : %s", ini->name_of_tsdemux);
522 wfd_sink_debug("name_of_audio_hdcp : %s", ini->name_of_audio_hdcp);
523 wfd_sink_debug("name_of_aac_parser : %s", ini->name_of_aac_parser);
524 wfd_sink_debug("name_of_aac_decoder : %s", ini->name_of_aac_decoder);
525 wfd_sink_debug("name_of_ac3_parser : %s", ini->name_of_ac3_parser);
526 wfd_sink_debug("name_of_ac3_decoder : %s", ini->name_of_ac3_decoder);
527 wfd_sink_debug("name_of_lpcm_converter : %s", ini->name_of_lpcm_converter);
528 wfd_sink_debug("name_of_lpcm_filter : %s", ini->name_of_lpcm_filter);
529 wfd_sink_debug("name_of_audio_resampler : %s", ini->name_of_audio_resampler);
530 wfd_sink_debug("name_of_audio_volume : %s", ini->name_of_audio_volume);
531 wfd_sink_debug("name_of_audio_sink : %s", ini->name_of_audio_sink);
532 wfd_sink_debug("name_of_video_hdcp : %s", ini->name_of_video_hdcp);
533 wfd_sink_debug("name_of_video_h264_parser : %s", ini->name_of_video_h264_parser);
534 wfd_sink_debug("name_of_video_h264_decoder : %s", ini->name_of_video_h264_decoder);
535 wfd_sink_debug("name_of_video_h265_parser : %s", ini->name_of_video_h265_parser);
536 wfd_sink_debug("name_of_video_h265_decoder : %s", ini->name_of_video_h265_decoder);
537 wfd_sink_debug("name_of_video_converter : %s", ini->name_of_video_converter);
538 wfd_sink_debug("name_of_video_filter : %s", ini->name_of_video_filter);
539 wfd_sink_debug("name_of_video_sink : %s", ini->name_of_video_sink);
540 wfd_sink_debug("name_of_video_evas_sink : %s", ini->name_of_video_evas_sink);
543 wfd_sink_debug("wfd_audio_codecs.audio_codec : %x", ini->wfd_audio_codecs.audio_codec);
544 wfd_sink_debug("wfd_audio_codecs.audio_latency : %d", ini->wfd_audio_codecs.audio_latency);
545 wfd_sink_debug("wfd_audio_codecs.audio_channel : %x", ini->wfd_audio_codecs.audio_channel);
546 wfd_sink_debug("wfd_audio_codecs.audio_sampling_frequency : %x", ini->wfd_audio_codecs.audio_sampling_frequency);
549 wfd_sink_debug("wfd_video_formats.video_codec : %x\n", ini->wfd_video_formats.video_codec);
550 wfd_sink_debug("wfd_video_formats.video_native_resolution : %x\n", ini->wfd_video_formats.video_native_resolution);
551 wfd_sink_debug("wfd_video_formats.video_cea_support : %llx\n", ini->wfd_video_formats.video_cea_support);
552 wfd_sink_debug("wfd_video_formats.video_vesa_support : %llx\n", ini->wfd_video_formats.video_vesa_support);
553 wfd_sink_debug("wfd_video_formats.video_hh_support : %llx\n", ini->wfd_video_formats.video_hh_support);
554 wfd_sink_debug("wfd_video_formats.video_profile : %x\n", ini->wfd_video_formats.video_profile);
555 wfd_sink_debug("wfd_video_formats.video_level : %x\n", ini->wfd_video_formats.video_level);
556 wfd_sink_debug("wfd_video_formats.video_latency : %d\n", ini->wfd_video_formats.video_latency);
557 wfd_sink_debug("wfd_video_formats.video_vertical_resolution : %d\n", ini->wfd_video_formats.video_vertical_resolution);
558 wfd_sink_debug("wfd_video_formats.video_horizontal_resolution : %d\n", ini->wfd_video_formats.video_horizontal_resolution);
559 wfd_sink_debug("wfd_video_formats.video_minimum_slicing : %d\n", ini->wfd_video_formats.video_minimum_slicing);
560 wfd_sink_debug("wfd_video_formats.video_slice_enc_param : %d\n", ini->wfd_video_formats.video_slice_enc_param);
561 wfd_sink_debug("wfd_video_formats.video_framerate_control_support : %d\n", ini->wfd_video_formats.video_framerate_control_support);
564 wfd_sink_debug("wfd_content_protection.enable_hdcp : %d", ini->wfd_content_protection.enable_hdcp);
565 wfd_sink_debug("wfd_content_protection.hdcp_content_protection : %x", ini->wfd_content_protection.hdcp_content_protection);
566 wfd_sink_debug("wfd_content_protection.hdcp_port_no : %d", ini->wfd_content_protection.hdcp_port_no);
568 /* video r2 parameter*/
569 wfd_sink_debug("wfd2_video_formats.video_codec : %x\n", ini->wfd2_video_formats.video_codec);
570 wfd_sink_debug("wfd2_video_formats.video_native_resolution : %x\n", ini->wfd2_video_formats.video_native_resolution);
571 wfd_sink_debug("wfd2_video_formats.video_non_transcoding_support : %d\n", ini->wfd2_video_formats.video_non_transcoding_support);
574 wfd_sink_debug("wfd2_video_h264_info.video_cea_support : %llx\n", ini->wfd2_video_h264_info.video_cea_support);
575 wfd_sink_debug("wfd2_video_h264_info.video_vesa_support : %llx\n", ini->wfd2_video_h264_info.video_vesa_support);
576 wfd_sink_debug("wfd2_video_h264_info.video_hh_support : %llx\n", ini->wfd2_video_h264_info.video_hh_support);
577 wfd_sink_debug("wfd2_video_h264_info.video_profile : %x\n", ini->wfd2_video_h264_info.video_profile);
578 wfd_sink_debug("wfd2_video_h264_info.video_level : %x\n", ini->wfd2_video_h264_info.video_level);
579 wfd_sink_debug("wfd2_video_h264_info.video_latency : %d\n", ini->wfd2_video_h264_info.video_latency);
580 wfd_sink_debug("wfd2_video_h264_info.video_vertical_resolution : %d\n", ini->wfd2_video_h264_info.video_vertical_resolution);
581 wfd_sink_debug("wfd2_video_h264_info.video_horizontal_resolution : %d\n", ini->wfd2_video_h264_info.video_horizontal_resolution);
582 wfd_sink_debug("wfd2_video_h264_info.video_minimum_slicing : %d\n", ini->wfd2_video_h264_info.video_minimum_slicing);
583 wfd_sink_debug("wfd2_video_h264_info.video_slice_enc_param : %d\n", ini->wfd2_video_h264_info.video_slice_enc_param);
584 wfd_sink_debug("wfd2_video_h264_info.video_framerate_control_support : %d\n", ini->wfd2_video_h264_info.video_framerate_control_support);
587 wfd_sink_debug("wfd2_video_h265_info.video_cea_support : %llx\n", ini->wfd2_video_h265_info.video_cea_support);
588 wfd_sink_debug("wfd2_video_h265_info.video_vesa_support : %llx\n", ini->wfd2_video_h265_info.video_vesa_support);
589 wfd_sink_debug("wfd2_video_h265_info.video_hh_support : %llx\n", ini->wfd2_video_h265_info.video_hh_support);
590 wfd_sink_debug("wfd2_video_h265_info.video_profile : %x\n", ini->wfd2_video_h265_info.video_profile);
591 wfd_sink_debug("wfd2_video_h265_info.video_level : %x\n", ini->wfd2_video_h265_info.video_level);
592 wfd_sink_debug("wfd2_video_h265_info.video_latency : %d\n", ini->wfd2_video_h265_info.video_latency);
593 wfd_sink_debug("wfd2_video_h265_info.video_vertical_resolution : %d\n", ini->wfd2_video_h265_info.video_vertical_resolution);
594 wfd_sink_debug("wfd2_video_h265_info.video_horizontal_resolution : %d\n", ini->wfd2_video_h265_info.video_horizontal_resolution);
595 wfd_sink_debug("wfd2_video_h265_info.video_minimum_slicing : %d\n", ini->wfd2_video_h265_info.video_minimum_slicing);
596 wfd_sink_debug("wfd2_video_h265_info.video_slice_enc_param : %d\n", ini->wfd2_video_h265_info.video_slice_enc_param);
597 wfd_sink_debug("wfd2_video_h265_info.video_framerate_control_support : %d\n", ini->wfd2_video_h265_info.video_framerate_control_support);
599 /* audio r2 parameter*/
600 wfd_sink_debug("wfd2_audio_codecs.audio_codec : %x\n", ini->wfd2_audio_codecs.audio_codec);
601 wfd_sink_debug("wfd2_audio_codecs.audio_lpcm_mode : %x\n", ini->wfd2_audio_codecs.audio_lpcm_mode);
602 wfd_sink_debug("wfd2_audio_codecs.audio_aac_mode : %x\n", ini->wfd2_audio_codecs.audio_aac_mode);
603 wfd_sink_debug("wfd2_audio_codecs.audio_ac3_mode : %x\n", ini->wfd2_audio_codecs.audio_ac3_mode);
605 wfd_sink_debug("---------------------------------------------------");
609 wfd_sink_debug_fleave();
611 return MM_ERROR_NONE;
616 void __mm_wfd_sink_ini_check_status(const char *path)
618 struct stat ini_buff;
620 wfd_sink_return_if_fail(path);
622 wfd_sink_debug_fenter();
624 if (g_stat(path, &ini_buff) < 0) {
625 wfd_sink_error("failed to get [%s] ini status", path);
627 if (ini_buff.st_size < 5) {
628 wfd_sink_error("%s file size=%d, Corrupted! So, Removed", path, (int)ini_buff.st_size);
633 wfd_sink_debug_fleave();
637 mm_wfd_sink_ini_unload(mm_wfd_sink_ini_t *ini)
639 wfd_sink_debug_fenter();
643 wfd_sink_debug_fleave();
645 return MM_ERROR_NONE;