1. Use wfdtsdemux instead of tsdemux.
[platform/core/multimedia/libmm-wfd.git] / common / mm_wfd_sink_ini.c
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 #include <glib.h>
24 #include <glib/gstdio.h>
25 #include <stdlib.h>
26 #include <iniparser.h>
27 #include <mm_error.h>
28 #include "mm_wfd_sink_ini.h"
29 #include "mm_wfd_sink_dlog.h"
30
31 static gboolean loaded = FALSE;
32
33 /* global variables here */
34 #ifdef MM_WFD_SINK_DEFAULT_INI
35 static gboolean __generate_sink_default_ini(void);
36 #endif
37
38 static void __mm_wfd_sink_ini_check_status(void);
39
40 /* macro */
41 #define MM_WFD_SINK_INI_GET_STRING(x_dict, x_item, x_ini, x_default) \
42         do { \
43                 gchar *str = NULL; \
44                 gint length = 0; \
45                 \
46                 str = iniparser_getstring(x_dict, x_ini, x_default); \
47                 if (str) { \
48                         length = strlen(str); \
49                         if ((length > 1) && (length < WFD_SINK_INI_MAX_STRLEN)) \
50                                 strncpy(x_item, str, length+1); \
51                         else \
52                                 strncpy(x_item, x_default, WFD_SINK_INI_MAX_STRLEN-1); \
53                 } else { \
54                         strncpy(x_item, x_default, WFD_SINK_INI_MAX_STRLEN-1); \
55                 } \
56         } while (0);
57
58 #ifdef MM_WFD_SINK_DEFAULT_INI
59 static
60 gboolean __generate_sink_default_ini(void)
61 {
62         FILE *fp = NULL;
63         gchar *default_ini = MM_WFD_SINK_DEFAULT_INI;
64
65
66         /* create new file */
67         fp = fopen(MM_WFD_SINK_INI_DEFAULT_PATH, "wt");
68
69         if (!fp) {
70                 return FALSE;
71         }
72
73         /* writing default ini file */
74         if (strlen(default_ini) != fwrite(default_ini, 1, strlen(default_ini), fp)) {
75                 fclose(fp);
76                 return FALSE;
77         }
78
79         fclose(fp);
80         return TRUE;
81 }
82 #endif
83
84 int
85 mm_wfd_sink_ini_load(mm_wfd_sink_ini_t *ini)
86 {
87         dictionary *dict = NULL;
88
89         wfd_sink_debug_fenter();
90
91
92         __mm_wfd_sink_ini_check_status();
93
94         /* first, try to load existing ini file */
95         dict = iniparser_load(MM_WFD_SINK_INI_DEFAULT_PATH);
96
97         /* if no file exists. create one with set of default values */
98         if (!dict) {
99 #ifdef MM_WFD_SINK_DEFAULT_INI
100                 wfd_sink_debug("No inifile found. create default ini file.\n");
101                 if (FALSE == __generate_sink_default_ini()) {
102                         wfd_sink_error("Creating default ini file failed. Use default values.\n");
103                 } else {
104                         /* load default ini */
105                         dict = iniparser_load(MM_WFD_SINK_INI_DEFAULT_PATH);
106                 }
107 #else
108                 wfd_sink_error("No ini file found. \n");
109
110                 return MM_ERROR_FILE_NOT_FOUND;
111 #endif
112         }
113
114         /* get ini values */
115         memset(ini, 0, sizeof(mm_wfd_sink_ini_t));
116
117         if (dict) { /* if dict is available */
118                 /* general */
119                 MM_WFD_SINK_INI_GET_STRING(dict, ini->gst_param[0], "general:gstparam1", DEFAULT_GST_PARAM);
120                 MM_WFD_SINK_INI_GET_STRING(dict, ini->gst_param[1], "general:gstparam2", DEFAULT_GST_PARAM);
121                 MM_WFD_SINK_INI_GET_STRING(dict, ini->gst_param[2], "general:gstparam3", DEFAULT_GST_PARAM);
122                 MM_WFD_SINK_INI_GET_STRING(dict, ini->gst_param[3], "general:gstparam4", DEFAULT_GST_PARAM);
123                 MM_WFD_SINK_INI_GET_STRING(dict, ini->gst_param[4], "general:gstparam5", DEFAULT_GST_PARAM);
124                 ini->generate_dot = iniparser_getboolean(dict, "general:generate dot", DEFAULT_GENERATE_DOT);
125                 ini->enable_pad_probe = iniparser_getboolean(dict, "general:enable pad probe", DEFAULT_ENABLE_PAD_PROBE);
126                 ini->state_change_timeout = iniparser_getint(dict, "general:state change timeout", DEFAULT_STATE_CHANGE_TIMEOUT);
127                 ini->set_debug_property = iniparser_getboolean(dict, "general:set debug property", DEFAULT_SET_DEBUG_PROPERTY);
128                 ini->enable_asm = iniparser_getboolean(dict, "general:enable asm", DEFAULT_ENABLE_ASM);
129                 ini->jitter_buffer_latency = iniparser_getint(dict, "general:jitter buffer latency", DEFAULT_JITTER_BUFFER_LATENCY);
130                 ini->enable_retransmission = iniparser_getboolean(dict, "general:enable retransmission", DEFAULT_ENABLE_RETRANSMISSION);
131                 ini->enable_reset_basetime = iniparser_getboolean(dict, "general:enable reset basetime", DEFAULT_ENABLE_RESET_BASETIME);
132                 ini->video_sink_max_lateness = iniparser_getint(dict, "general:video sink max lateness", DEFAULT_VIDEO_SINK_MAX_LATENESS);
133                 ini->sink_ts_offset = iniparser_getint(dict, "general:sink ts offset", DEFAULT_SINK_TS_OFFSET);
134                 ini->audio_sink_async = iniparser_getboolean(dict, "general:audio sink async", DEFAULT_AUDIO_SINK_ASYNC);
135                 ini->video_sink_async = iniparser_getboolean(dict, "general:video sink async", DEFAULT_VIDEO_SINK_ASYNC);
136                 ini->enable_ts_data_dump = iniparser_getboolean(dict, "general:enable ts data dump", DEFAULT_ENABLE_TS_DATA_DUMP);
137                 ini->enable_wfdrtspsrc_pad_probe = iniparser_getboolean(dict, "general:enable wfdrtspsrc pad probe", DEFAULT_ENABLE_WFDRTSPSRC_PAD_PROBE);
138
139
140                 /* pipeline */
141                 MM_WFD_SINK_INI_GET_STRING(dict, ini->name_of_tsdemux, "pipeline:tsdemux element", DEFAULT_NAME_OF_TSDEMUX);
142                 MM_WFD_SINK_INI_GET_STRING(dict, ini->name_of_audio_hdcp, "pipeline:audio hdcp element", DEFAULT_NAME_OF_AUDIO_HDCP);
143                 MM_WFD_SINK_INI_GET_STRING(dict, ini->name_of_aac_parser, "pipeline:aac parser element", DEFAULT_NAME_OF_AAC_PARSER);
144                 MM_WFD_SINK_INI_GET_STRING(dict, ini->name_of_aac_decoder, "pipeline:aac decoder element", DEFAULT_NAME_OF_AAC_DECODER);
145                 MM_WFD_SINK_INI_GET_STRING(dict, ini->name_of_ac3_parser, "pipeline:ac3 parser element", DEFAULT_NAME_OF_AC3_PARSER);
146                 MM_WFD_SINK_INI_GET_STRING(dict, ini->name_of_ac3_decoder, "pipeline:ac3 decoder element", DEFAULT_NAME_OF_AC3_DECODER);
147                 MM_WFD_SINK_INI_GET_STRING(dict, ini->name_of_lpcm_converter, "pipeline:lpcm converter element", DEFAULT_NAME_OF_LPCM_CONVERTER);
148                 MM_WFD_SINK_INI_GET_STRING(dict, ini->name_of_lpcm_filter, "pipeline:lpcm filter element", DEFAULT_NAME_OF_LPCM_FILTER);
149                 MM_WFD_SINK_INI_GET_STRING(dict, ini->name_of_audio_resampler, "pipeline:audio resampler element", DEFAULT_NAME_OF_AUDIO_RESAMPLER);
150                 MM_WFD_SINK_INI_GET_STRING(dict, ini->name_of_audio_volume, "pipeline:audio volume element", DEFAULT_NAME_OF_AUDIO_VOLUME);
151                 MM_WFD_SINK_INI_GET_STRING(dict, ini->name_of_audio_sink, "pipeline:audio sink element", DEFAULT_NAME_OF_AUDIO_SINK);
152                 MM_WFD_SINK_INI_GET_STRING(dict, ini->name_of_video_hdcp, "pipeline:video hdcp element", DEFAULT_NAME_OF_VIDEO_HDCP);
153                 MM_WFD_SINK_INI_GET_STRING(dict, ini->name_of_video_parser, "pipeline:video parser element", DEFAULT_NAME_OF_VIDEO_PARSER);
154                 MM_WFD_SINK_INI_GET_STRING(dict, ini->name_of_video_decoder, "pipeline:video decoder element", DEFAULT_NAME_OF_VIDEO_DECODER);
155                 MM_WFD_SINK_INI_GET_STRING(dict, ini->name_of_video_sink, "pipeline:video sink element", DEFAULT_NAME_OF_VIDEO_SINK);
156
157                 /* audio parameter*/
158                 ini->audio_codec = iniparser_getint(dict, "audio param:audio codec", DEFAULT_AUDIO_CODEC);
159                 ini->audio_latency = iniparser_getint(dict, "audio param:audio latency", DEFAULT_AUDIO_LATENCY);
160                 ini->audio_channel = iniparser_getint(dict, "audio param:audio channels", DEFAULT_AUDIO_CHANNELS);
161                 ini->audio_sampling_frequency = iniparser_getint(dict, "audio param:audio sampling frequency", DEFAULT_AUDIO_SAMP_FREQUENCY);
162
163                 /* video parameter*/
164                 ini->video_codec = iniparser_getint(dict, "video param:video codec", DEFAULT_VIDEO_CODEC);
165                 ini->video_native_resolution = iniparser_getint(dict, "video param:video native resolution", DEFAULT_VIDEO_NATIVE_RESOLUTION);
166                 ini->video_cea_support = iniparser_getint(dict, "video param:video cea support", DEFAULT_VIDEO_CEA_SUPPORT);
167                 ini->video_vesa_support = iniparser_getint(dict, "video param:video vesa support", DEFAULT_VIDEO_VESA_SUPPORT);
168                 ini->video_hh_support = iniparser_getint(dict, "video param:video hh support", DEFAULT_VIDEO_HH_SUPPORT);
169                 ini->video_profile = iniparser_getint(dict, "video param:video profile", DEFAULT_VIDEO_PROFILE);
170                 ini->video_level = iniparser_getint(dict, "video param:video level", DEFAULT_VIDEO_LEVEL);
171                 ini->video_latency = iniparser_getint(dict, "video param:video latency", DEFAULT_VIDEO_LATENCY);
172                 ini->video_vertical_resolution = iniparser_getint(dict, "video param:video vertical resolution", DEFAULT_VIDEO_VERTICAL_RESOLUTION);
173                 ini->video_horizontal_resolution = iniparser_getint(dict, "video param:video horizontal resolution", DEFAULT_VIDEO_HORIZONTAL_RESOLUTION);
174                 ini->video_minimum_slicing = iniparser_getint(dict, "video param:video minimum slicesize", DEFAULT_VIDEO_MIN_SLICESIZE);
175                 ini->video_slice_enc_param = iniparser_getint(dict, "video param:video slice encoding params", DEFAULT_VIDEO_SLICE_ENC_PARAM);
176                 ini->video_framerate_control_support = iniparser_getint(dict, "video param:video framerate control support", DEFAULT_VIDEO_FRAMERATE_CONTROL);
177
178                 /* hdcp parameter*/
179                 ini->hdcp_content_protection = iniparser_getint(dict, "hdcp param:hdcp content protection", DEFAULT_HDCP_CONTENT_PROTECTION);
180                 ini->hdcp_port_no = iniparser_getint(dict, "hdcp param:hdcp port no", DEFAULT_HDCP_PORT_NO);
181         } else { /* if dict is not available just fill the structure with default value */
182                 wfd_sink_error("failed to load ini. using hardcoded default\n");
183
184                 /* general */
185                 strncpy(ini->gst_param[0], DEFAULT_GST_PARAM, WFD_SINK_INI_MAX_STRLEN - 1);
186                 strncpy(ini->gst_param[1], DEFAULT_GST_PARAM, WFD_SINK_INI_MAX_STRLEN - 1);
187                 strncpy(ini->gst_param[2], DEFAULT_GST_PARAM, WFD_SINK_INI_MAX_STRLEN - 1);
188                 strncpy(ini->gst_param[3], DEFAULT_GST_PARAM, WFD_SINK_INI_MAX_STRLEN - 1);
189                 strncpy(ini->gst_param[4], DEFAULT_GST_PARAM, WFD_SINK_INI_MAX_STRLEN - 1);
190                 ini->generate_dot =  DEFAULT_GENERATE_DOT;
191                 ini->enable_pad_probe = DEFAULT_ENABLE_PAD_PROBE;
192                 ini->state_change_timeout = DEFAULT_STATE_CHANGE_TIMEOUT;
193                 ini->set_debug_property =  DEFAULT_SET_DEBUG_PROPERTY;
194                 ini->enable_asm =  DEFAULT_ENABLE_ASM;
195                 ini->jitter_buffer_latency = DEFAULT_JITTER_BUFFER_LATENCY;
196                 ini->enable_retransmission =  DEFAULT_ENABLE_RETRANSMISSION;
197                 ini->enable_reset_basetime =  DEFAULT_ENABLE_RESET_BASETIME;
198                 ini->video_sink_max_lateness = DEFAULT_VIDEO_SINK_MAX_LATENESS;
199                 ini->sink_ts_offset = DEFAULT_SINK_TS_OFFSET;
200                 ini->enable_ts_data_dump = DEFAULT_ENABLE_TS_DATA_DUMP;
201                 ini->enable_wfdrtspsrc_pad_probe = DEFAULT_ENABLE_WFDRTSPSRC_PAD_PROBE;
202
203                 /* pipeline */
204                 strncpy(ini->name_of_tsdemux, DEFAULT_NAME_OF_TSDEMUX, WFD_SINK_INI_MAX_STRLEN - 1);
205                 strncpy(ini->name_of_audio_hdcp, DEFAULT_NAME_OF_AUDIO_HDCP, WFD_SINK_INI_MAX_STRLEN - 1);
206                 strncpy(ini->name_of_aac_parser, DEFAULT_NAME_OF_AAC_PARSER, WFD_SINK_INI_MAX_STRLEN - 1);
207                 strncpy(ini->name_of_aac_decoder, DEFAULT_NAME_OF_AAC_DECODER, WFD_SINK_INI_MAX_STRLEN - 1);
208                 strncpy(ini->name_of_ac3_parser, DEFAULT_NAME_OF_AC3_PARSER, WFD_SINK_INI_MAX_STRLEN - 1);
209                 strncpy(ini->name_of_ac3_decoder, DEFAULT_NAME_OF_AC3_DECODER, WFD_SINK_INI_MAX_STRLEN - 1);
210                 strncpy(ini->name_of_lpcm_converter, DEFAULT_NAME_OF_LPCM_CONVERTER, WFD_SINK_INI_MAX_STRLEN - 1);
211                 strncpy(ini->name_of_lpcm_filter, DEFAULT_NAME_OF_LPCM_FILTER, WFD_SINK_INI_MAX_STRLEN - 1);
212                 strncpy(ini->name_of_audio_resampler, DEFAULT_NAME_OF_AUDIO_RESAMPLER, WFD_SINK_INI_MAX_STRLEN - 1);
213                 strncpy(ini->name_of_audio_volume, DEFAULT_NAME_OF_AUDIO_VOLUME, WFD_SINK_INI_MAX_STRLEN - 1);
214                 strncpy(ini->name_of_audio_sink, DEFAULT_NAME_OF_AUDIO_SINK, WFD_SINK_INI_MAX_STRLEN - 1);
215                 strncpy(ini->name_of_video_hdcp, DEFAULT_NAME_OF_VIDEO_HDCP, WFD_SINK_INI_MAX_STRLEN - 1);
216                 strncpy(ini->name_of_video_parser, DEFAULT_NAME_OF_VIDEO_PARSER, WFD_SINK_INI_MAX_STRLEN - 1);
217                 strncpy(ini->name_of_video_decoder, DEFAULT_NAME_OF_VIDEO_DECODER, WFD_SINK_INI_MAX_STRLEN - 1);
218                 strncpy(ini->name_of_video_sink, DEFAULT_NAME_OF_VIDEO_SINK, WFD_SINK_INI_MAX_STRLEN - 1);
219
220                 /* audio parameter*/
221                 ini->audio_codec = DEFAULT_AUDIO_CODEC;
222                 ini->audio_latency = DEFAULT_AUDIO_LATENCY;
223                 ini->audio_channel = DEFAULT_AUDIO_CHANNELS;
224                 ini->audio_sampling_frequency = DEFAULT_AUDIO_SAMP_FREQUENCY;
225
226                 /* video parameter*/
227                 ini->video_codec = DEFAULT_VIDEO_CODEC;
228                 ini->video_native_resolution = DEFAULT_VIDEO_NATIVE_RESOLUTION;
229                 ini->video_cea_support = DEFAULT_VIDEO_CEA_SUPPORT;
230                 ini->video_vesa_support = DEFAULT_VIDEO_VESA_SUPPORT;
231                 ini->video_hh_support = DEFAULT_VIDEO_HH_SUPPORT;
232                 ini->video_profile = DEFAULT_VIDEO_PROFILE;
233                 ini->video_level = DEFAULT_VIDEO_LEVEL;
234                 ini->video_latency = DEFAULT_VIDEO_LATENCY;
235                 ini->video_vertical_resolution = DEFAULT_VIDEO_VERTICAL_RESOLUTION;
236                 ini->video_horizontal_resolution = DEFAULT_VIDEO_HORIZONTAL_RESOLUTION;
237                 ini->video_minimum_slicing = DEFAULT_VIDEO_MIN_SLICESIZE;
238                 ini->video_slice_enc_param = DEFAULT_VIDEO_SLICE_ENC_PARAM;
239                 ini->video_framerate_control_support = DEFAULT_VIDEO_FRAMERATE_CONTROL;
240
241                 /* hdcp parameter*/
242                 ini->hdcp_content_protection = DEFAULT_HDCP_CONTENT_PROTECTION;
243                 ini->hdcp_port_no = DEFAULT_HDCP_PORT_NO;
244         }
245
246         /* free dict as we got our own structure */
247         iniparser_freedict(dict);
248
249
250         /* dump structure */
251         wfd_sink_debug("W-Fi Display Sink Initial Settings-----------------------------------\n");
252
253         /* general */
254         wfd_sink_debug("gst_param1 : %s\n", ini->gst_param[0]);
255         wfd_sink_debug("gst_param2 : %s\n", ini->gst_param[1]);
256         wfd_sink_debug("gst_param3 : %s\n", ini->gst_param[2]);
257         wfd_sink_debug("gst_param4 : %s\n", ini->gst_param[3]);
258         wfd_sink_debug("gst_param5 : %s\n", ini->gst_param[4]);
259         wfd_sink_debug("generate_dot : %d\n", ini->generate_dot);
260         if (ini->generate_dot == TRUE) {
261                 wfd_sink_debug("generate_dot is TRUE, dot file will be stored into /tmp/\n");
262                 g_setenv("GST_DEBUG_DUMP_DOT_DIR", "/tmp/", FALSE);
263         }
264         wfd_sink_debug("enable_pad_probe : %d\n", ini->enable_pad_probe);
265         wfd_sink_debug("state_change_timeout(sec) : %d\n", ini->state_change_timeout);
266         wfd_sink_debug("set_debug_property : %d\n", ini->set_debug_property);
267         wfd_sink_debug("enable_asm : %d\n", ini->enable_asm);
268         wfd_sink_debug("jitter_buffer_latency(msec) : %d\n", ini->jitter_buffer_latency);
269         wfd_sink_debug("enable_retransmission : %d\n", ini->enable_retransmission);
270         wfd_sink_debug("enable_reset_basetime : %d\n", ini->enable_reset_basetime);
271         wfd_sink_debug("video_sink_max_lateness(nsec) : %d\n", ini->video_sink_max_lateness);
272         wfd_sink_debug("sink_ts_offset(nsec) : %d\n", ini->sink_ts_offset);
273         wfd_sink_debug("audio_sink_async : %d\n", ini->audio_sink_async);
274         wfd_sink_debug("video_sink_async : %d\n", ini->video_sink_async);
275         wfd_sink_debug("enable_ts_data_dump : %d\n", ini->enable_ts_data_dump);
276         wfd_sink_debug("enable_wfdrtspsrc_pad_probe : %d\n", ini->enable_wfdrtspsrc_pad_probe);
277
278         /* pipeline */
279         wfd_sink_debug("name_of_tsdemux : %s\n", ini->name_of_tsdemux);
280         wfd_sink_debug("name_of_audio_hdcp : %s\n", ini->name_of_audio_hdcp);
281         wfd_sink_debug("name_of_aac_parser : %s\n", ini->name_of_aac_parser);
282         wfd_sink_debug("name_of_aac_decoder : %s\n", ini->name_of_aac_decoder);
283         wfd_sink_debug("name_of_ac3_parser : %s\n", ini->name_of_ac3_parser);
284         wfd_sink_debug("name_of_ac3_decoder : %s\n", ini->name_of_ac3_decoder);
285         wfd_sink_debug("name_of_lpcm_converter : %s\n", ini->name_of_lpcm_converter);
286         wfd_sink_debug("name_of_lpcm_filter : %s\n", ini->name_of_lpcm_filter);
287         wfd_sink_debug("name_of_audio_resampler : %s\n", ini->name_of_audio_resampler);
288         wfd_sink_debug("name_of_audio_volume : %s\n", ini->name_of_audio_volume);
289 #ifdef ENABLE_WFD_VD_FEATURES
290         wfd_sink_debug("name_of_audio_splitter : %s\n", ini->name_of_audio_splitter);
291 #endif
292         wfd_sink_debug("name_of_audio_sink : %s\n", ini->name_of_audio_sink);
293         wfd_sink_debug("name_of_video_hdcp : %s\n", ini->name_of_video_hdcp);
294         wfd_sink_debug("name_of_video_parser : %s\n", ini->name_of_video_parser);
295         wfd_sink_debug("name_of_video_decoder : %s\n", ini->name_of_video_decoder);
296         wfd_sink_debug("name_of_video_sink : %s\n", ini->name_of_video_sink);
297
298         /* audio parameter*/
299         wfd_sink_debug("audio_codec : %x\n", ini->audio_codec);
300         wfd_sink_debug("audio_latency : %d\n", ini->audio_latency);
301         wfd_sink_debug("audio_channel : %x\n", ini->audio_channel);
302         wfd_sink_debug("audio_sampling_frequency : %x\n", ini->audio_sampling_frequency);
303
304         /* video parameter*/
305         wfd_sink_debug("video_codec : %x\n", ini->video_codec);
306         wfd_sink_debug("video_native_resolution : %x\n", ini->video_native_resolution);
307         wfd_sink_debug("video_cea_support : %x\n", ini->video_cea_support);
308         wfd_sink_debug("video_vesa_support : %x\n", ini->video_vesa_support);
309         wfd_sink_debug("video_hh_support : %x\n", ini->video_hh_support);
310         wfd_sink_debug("video_profile : %x\n", ini->video_profile);
311         wfd_sink_debug("video_level : %x\n", ini->video_level);
312         wfd_sink_debug("video_latency : %d\n", ini->video_latency);
313         wfd_sink_debug("video_vertical_resolution : %d\n", ini->video_vertical_resolution);
314         wfd_sink_debug("video_horizontal_resolution : %d\n", ini->video_horizontal_resolution);
315         wfd_sink_debug("video_minimum_slicing : %d\n", ini->video_minimum_slicing);
316         wfd_sink_debug("video_slice_enc_param : %d\n", ini->video_slice_enc_param);
317         wfd_sink_debug("video_framerate_control_support : %d\n", ini->video_framerate_control_support);
318
319         /* hdcp parameter*/
320         wfd_sink_debug("hdcp_content_protection : %x\n", ini->hdcp_content_protection);
321         wfd_sink_debug("hdcp_port_no : %d\n", ini->hdcp_port_no);
322
323         wfd_sink_debug("---------------------------------------------------\n");
324
325         loaded = TRUE;
326
327         wfd_sink_debug_fleave();
328
329         return MM_ERROR_NONE;
330 }
331
332
333 static
334 void __mm_wfd_sink_ini_check_status(void)
335 {
336         struct stat ini_buff;
337
338         wfd_sink_debug_fenter();
339
340         if (g_stat(MM_WFD_SINK_INI_DEFAULT_PATH, &ini_buff) < 0) {
341                 wfd_sink_error("failed to get mmfw_wfd_sink ini status\n");
342         } else {
343                 if (ini_buff.st_size < 5) {
344                         wfd_sink_error("mmfw_wfd_sink.ini file size=%d, Corrupted! So, Removed\n", (int)ini_buff.st_size);
345                         g_remove(MM_WFD_SINK_INI_DEFAULT_PATH);
346                 }
347         }
348
349         wfd_sink_debug_fleave();
350 }
351
352 int
353 mm_wfd_sink_ini_unload(mm_wfd_sink_ini_t *ini)
354 {
355         wfd_sink_debug_fenter();
356
357         loaded = FALSE;
358
359         wfd_sink_debug_fleave();
360
361         return MM_ERROR_NONE;
362 }