Change way to make default ini file 54/165954/1
authorSeokHoon Lee <andy.shlee@samsung.com>
Fri, 5 Jan 2018 02:02:12 +0000 (11:02 +0900)
committerSeokHoon Lee <andy.shlee@samsung.com>
Fri, 5 Jan 2018 02:02:35 +0000 (11:02 +0900)
- delete make a default ini file, and
  just use a default value.

Signed-off-by: SeokHoon Lee <andy.shlee@samsung.com>
Change-Id: I5bc4bd9223e242ae91cbf928195b4e4894c05893

packaging/libmm-wfd.spec
src/include/mm_wfd_sink_ini.h
src/mm_wfd_sink_ini.c

index c214dff..b103e70 100644 (file)
@@ -1,6 +1,6 @@
 Name:       libmm-wfd
 Summary:    Multimedia Framework Wifi-Display Library
-Version:    0.2.234
+Version:    0.2.235
 Release:    0
 Group:      System/Libraries
 License:    Apache-2.0
index c7298e3..53273bb 100644 (file)
@@ -166,166 +166,6 @@ typedef struct __mm_wfd_sink_ini {
        WFD2VideoCodecSpec wfd2_video_h265_info;
 } mm_wfd_sink_ini_t;
 
-#define MM_WFD_SINK_DEFAULT_INI \
-" \
-[general]\n\
-; parameters for initializing gstreamer\n\
-; DEFAULT SET(--gst-debug=2, *wfd*:5)\n\
-gstparam1 = --gst-debug=2, *wfd*:5, *wfdtsdemux:1, *wfdrtpbuffer:1\n\
-gstparam2 =\n\
-gstparam3 =\n\
-gstparam4 =\n\
-gstparam5 =\n\
-\n\
-; generating dot file representing pipeline state\n\
-; do export GST_DEBUG_DUMP_DOT_DIR=[dot file path] in the shell\n\
-generate dot = no\n\
-\n\
-; enable pad probe\n\
-enable pad probe = no\n\
-\n\
-; enable wfdsrc inner pad probe\n\
-enable wfdsrc pad probe = no\n\
-\n\
-; enable ts data dump(eg. /var/tmp/*.ts)\n\
-enable ts data dump = no\n\
-\n\
-; allowed timeout for changing pipeline state\n\
-state change timeout = 5 ; sec\n\
-\n\
-; set debug property to wfdsrc plugin for debugging rtsp message\n\
-set debug property = yes\n\
-\n\
-; for asm function enable = yes, disable = no\n\
-enable rm = no\n\
-\n\
-; 0: default value set by wfdsrc element, other: user define value.\n\
-jitter buffer latency=10\n\
-\n\
-; for retransmission request enable = yes, disable = no\n\
-enable retransmission = no\n\
-\n\
-; for reset basetime, enable = yes, disable = no\n\
-enable reset basetime = yes\n\
-\n\
-; Maximum number of nanoseconds that a buffer can be late before it is dropped by videosink(-1 unlimited)\n\
-video sink max lateness=20000000\n\
-\n\
-; nanoseconds to be added to buffertimestamp by sink elements\n\
-sink ts offset=150000000\n\
-\n\
-; if no, go asynchronously to PAUSED without preroll \n\
-audio sink async=no\n\
-\n\
-; if no, go asynchronously to PAUSED without preroll \n\
-video sink async=no\n\
-\n\
-; user agent\n\
-user agent = TIZEN3_0/WFD-SINK\n\
-\n\
-\n\
-\n\
-\n\
-[pipeline]\n\
-wfdsrc element = wfdsrc\n\
-\n\
-tsdemux element = wfdtsdemux\n\
-\n\
-audio hdcp element = \n\
-\n\
-aac parser element = aacparse\n\
-\n\
-aac decoder element = avdec_aac\n\
-\n\
-ac3 parser element = ac3parse\n\
-\n\
-ac3 decoder element =\n\
-\n\
-lpcm converter element =\n\
-\n\
-lpcm filter element = capsfilter\n\
-\n\
-audio resampler element = audioconvert\n\
-\n\
-audio volume element =\n\
-\n\
-audio sinkbin queue element = queue\n\
-\n\
-audio sink element = pulsesink\n\
-\n\
-video hdcp element =\n\
-\n\
-video h264 parser element = h264parse\n\
-\n\
-video h265 parser element = \n\
-\n\
-video h264 decoder element = avdec_h264\n\
-\n\
-video h265 decoder element = \n\
-\n\
-video converter element =\n\
-\n\
-video filter element =\n\
-\n\
-video sink element = waylandsink\n\
-\n\
-\n\
-\n\
-[wfd audio codecs]\n\
-; 0x1: LPCM, 0x2: aac, 0x4: ac3\n\
-;default aac and LPCM\n\
-audio codec=0x3\n\
-\n\
-audio latency=0x0\n\
-\n\
-;0x1 : 48000khz, 0x2: 44100khz\n\
-audio sampling frequency=0x3\n\
-\n\
-; 0x1:2 channels, 0x2:4 channels, 0x4:6channels, 0x8:8channels\n\
-audio channels=0x1\n\
-\n\
-\n\
-\n\
-[wfd video formats]\n\
-; 0: H264CBP 1: H264CHP\n\
-video codec=0x1\n\
-\n\
-video native resolution = 0x20\n\
-\n\
-video cea support=0x842b\n\
-\n\
-video vesa support=0x1\n\
-\n\
-video hh support=0x555\n\
-\n\
-; 0x1:base, 0x2:high\n\
-video profile=0x1\n\
-\n\
-; 0x1:level_3_1, 0x2:level_3_2, 0x4:level_4, 0x8:level_4_1, 0x10:level_4_2\n\
-video level=0x2\n\
-\n\
-video latency=0x0\n\
-\n\
-video vertical resolution=720\n\
-\n\
-video horizontal resolution=1280\n\
-\n\
-video minimum slicesize=0\n\
-\n\
-video slice encoding params=200\n\
-\n\
-video framerate control support=11\n\
-\n\
-\n\
-\n\
-[wfd hdcp content protection]\n\
-;0x0:none, 0x1:HDCP_2.0, 0x2:HDCP_2.1\n\
-hdcp content protection=0x0\n\
-\n\
-hdcp port no=0\n\
-\n\
-"
-
 int
 mm_wfd_sink_ini_load(mm_wfd_sink_ini_t *ini, const char *path);
 
index 4e63ebb..09b3153 100644 (file)
 static gboolean loaded = FALSE;
 
 /* global variables here */
-#ifdef MM_WFD_SINK_DEFAULT_INI
-static gboolean        __generate_sink_default_ini(void);
-#endif
-
 static void __mm_wfd_sink_ini_check_status(const char *path);
 
 /* macro */
@@ -175,28 +171,6 @@ static void __mm_wfd_sink_ini_check_status(const char *path);
                } \
        } while (0);
 
-#ifdef MM_WFD_SINK_DEFAULT_INI
-static
-gboolean __generate_sink_default_ini(void)
-{
-       int fd = 0;
-       int length = 0;
-       const gchar *default_ini = MM_WFD_SINK_DEFAULT_INI;
-
-       fd = open(MM_WFD_SINK_INI_DEFAULT_PATH, O_CREAT | O_EXCL, 644);
-       if (fd < 0)
-               return FALSE;
-
-       length = strlen(default_ini);
-       if (length != write(fd, default_ini, strlen(default_ini))) {
-               close(fd);
-               return FALSE;
-       }
-       close(fd);
-
-       return TRUE;
-}
-#endif
 
 int
 mm_wfd_sink_ini_load(mm_wfd_sink_ini_t *ini, const char *path)
@@ -210,26 +184,9 @@ mm_wfd_sink_ini_load(mm_wfd_sink_ini_t *ini, const char *path)
 
        wfd_sink_debug("ini path : %s", path);
 
-       /* first, try to load existing ini file */
+       /* load ini file */
        dict = iniparser_load(path);
 
-       /* if no file exists. create one with set of default values */
-       if (!dict) {
-#ifdef MM_WFD_SINK_DEFAULT_INI
-               wfd_sink_debug("No inifile found. create default ini file.");
-               if (FALSE == __generate_sink_default_ini()) {
-                       wfd_sink_error("Creating default ini file failed. Use default values.");
-               } else {
-                       /* load default ini */
-                       dict = iniparser_load(MM_WFD_SINK_INI_DEFAULT_PATH);
-               }
-#else
-               wfd_sink_error("No ini file found. ");
-
-               return MM_ERROR_FILE_NOT_FOUND;
-#endif
-       }
-
        /* get ini values */
        memset(ini, 0, sizeof(mm_wfd_sink_ini_t));