1. Fix some pipeline for supporting Tizen2.4 reference target 79/43779/2 accepted/tizen/mobile/20150715.003439 accepted/tizen/tv/20150715.003451 accepted/tizen/wearable/20150715.003455 submit/tizen/20150714.101420
authorSangkyu Park <sk1122.park@samsung.com>
Tue, 14 Jul 2015 01:43:07 +0000 (10:43 +0900)
committerSangkyu Park <sk1122.park@samsung.com>
Tue, 14 Jul 2015 01:52:12 +0000 (10:52 +0900)
2. Remove unused property setting
3. Fix video resolution in .ini for supporting Tizen2.4 refernece target.
4. Fix a prevent defect.
5. Enable build error option and fix build errors.
6. Implement getting negotiated stream information feature.
7. Change caps of LPCM capsfilter from S16LE to S16BE for supporting Wi-Fi Display LPCM
8. Fix to handle exception of functions that get negotiated audio and video info.
- These functions don't unlock mutex when it is invalid state.
9. Fix to not support 1920x1280 resolution.
- The resolution is not supported by decoder of Tizen2.4 reference target.

* This patch has dependency with screen-mirroring.

Change-Id: I20d7edbbcc1d8533acdc98a4bf2f6215c52b387a
Signed-off-by: Sangkyu Park <sk1122.park@samsung.com>
common/include/mm_wfd_sink_ini.h
common/mm_wfd_attrs.c
common/mm_wfd_sink_ini.c
config/mmfw_wfd_sink.ini
packaging/libmm-wfd.spec
sink/include/mm_wfd_sink.h
sink/include/mm_wfd_sink_priv.h
sink/include/mm_wfd_sink_util.h
sink/mm_wfd_sink.c
sink/mm_wfd_sink_manager.c
sink/mm_wfd_sink_priv.c

index 9115949..06cc9b6 100755 (executable)
@@ -85,7 +85,10 @@ typedef struct __mm_wfd_sink_ini {
 
        gchar name_of_video_hdcp[WFD_SINK_INI_MAX_STRLEN];
        gchar name_of_video_parser[WFD_SINK_INI_MAX_STRLEN];
+       gchar name_of_video_capssetter[WFD_SINK_INI_MAX_STRLEN];
        gchar name_of_video_decoder[WFD_SINK_INI_MAX_STRLEN];
+       gchar name_of_video_converter[WFD_SINK_INI_MAX_STRLEN];
+       gchar name_of_video_filter[WFD_SINK_INI_MAX_STRLEN];
        gchar name_of_video_sink[WFD_SINK_INI_MAX_STRLEN];
 
        /* audio parameter for reponse of M3 request */
@@ -124,7 +127,7 @@ typedef struct __mm_wfd_sink_ini {
 #define DEFAULT_SET_DEBUG_PROPERTY     TRUE
 #define DEFAULT_ENABLE_ASM     FALSE
 #define DEFAULT_JITTER_BUFFER_LATENCY 10 /* msec */
-#define DEFAULT_ENABLE_RETRANSMISSION  TRUE
+#define DEFAULT_ENABLE_RETRANSMISSION  FALSE
 #define DEFAULT_ENABLE_RESET_BASETIME  TRUE
 #define DEFAULT_VIDEO_SINK_MAX_LATENESS 20000000 /* nsec */
 #define DEFAULT_SINK_TS_OFFSET 150000000 /* nsec */
@@ -148,7 +151,10 @@ typedef struct __mm_wfd_sink_ini {
 #define DEFAULT_NAME_OF_AUDIO_SINK ""
 #define DEFAULT_NAME_OF_VIDEO_HDCP ""
 #define DEFAULT_NAME_OF_VIDEO_PARSER ""
+#define DEFAULT_NAME_OF_VIDEO_CAPSSETTER ""
 #define DEFAULT_NAME_OF_VIDEO_DECODER ""
+#define DEFAULT_NAME_OF_VIDEO_CONVERTER ""
+#define DEFAULT_NAME_OF_VIDEO_FILTER ""
 #define DEFAULT_NAME_OF_VIDEO_SINK ""
 
 /* Audio */
@@ -160,20 +166,18 @@ typedef struct __mm_wfd_sink_ini {
 /* Video */
 #define DEFAULT_VIDEO_CODEC WFD_VIDEO_H264
 #define DEFAULT_VIDEO_NATIVE_RESOLUTION 0x20
-/* CEA :  WFD_CEA_640x480P60  | WFD_CEA_720x480P60 |WFD_CEA_720x576P50 |WFD_CEA_1280x720P30 |WFD_CEA_1920x1080P30 |
-       WFD_CEA_1280x720P25 |WFD_CEA_1920x1080P25 |WFD_CEA_1280x720P24 | WFD_CEA_1920x1080P24 */
-#define DEFAULT_VIDEO_CEA_SUPPORT 0x194ab
-/* VESA : WFD_VESA_800x600P30  |WFD_VESA_1024x768P30 |WFD_VESA_1152x864P30 | WFD_VESA_1280x768P30       | WFD_VESA_1280x800P30 |
-       WFD_VESA_1360x768P30 | WFD_VESA_1366x768P30 | WFD_VESA_1280x1024P30 |WFD_VESA_1400x1050P30       | WFD_VESA_1440x900P30 |
-       WFD_VESA_1600x900P30 | FD_VESA_1600x1200P30 | WFD_VESA_1680x1024P30 | WFD_VESA_1680x1050P30      | WFD_VESA_1920x1200P30 | */
-#define DEFAULT_VIDEO_VESA_SUPPORT 0x55555555
+/* CEA :  WFD_CEA_640x480P60  | WFD_CEA_720x480P60 |WFD_CEA_720x576P50 |WFD_CEA_1280x720P30 |
+       WFD_CEA_1280x720P25 | WFD_CEA_1280x720P24 */
+#define DEFAULT_VIDEO_CEA_SUPPORT 0x842b
+/* VESA : WFD_VESA_800x600P30 */
+#define DEFAULT_VIDEO_VESA_SUPPORT 0x1
 /* HH : WFD_HH_800x480P30 | WFD_HH_854x480P30 | WFD_HH_864x480P30 | WFD_HH_640x360P30 | WFD_HH_960x540P30 | WFD_HH_848x480P30 */
 #define DEFAULT_VIDEO_HH_SUPPORT 0x555
 #define DEFAULT_VIDEO_PROFILE WFD_H264_BASE_PROFILE
 #define DEFAULT_VIDEO_LEVEL WFD_H264_LEVEL_3_2
 #define DEFAULT_VIDEO_LATENCY 0x0
-#define DEFAULT_VIDEO_VERTICAL_RESOLUTION 1080
-#define DEFAULT_VIDEO_HORIZONTAL_RESOLUTION 1920
+#define DEFAULT_VIDEO_VERTICAL_RESOLUTION 720
+#define DEFAULT_VIDEO_HORIZONTAL_RESOLUTION 1280
 #define DEFAULT_VIDEO_MIN_SLICESIZE 0
 #define DEFAULT_VIDEO_SLICE_ENC_PARAM 200
 #define DEFAULT_VIDEO_FRAMERATE_CONTROL 11
@@ -220,7 +224,7 @@ enable asm = no\n\
 jitter buffer latency=10\n\
 \n\
 ; for retransmission request enable = yes, disable = no\n\
-enable retransmission = yes\n\
+enable retransmission = no\n\
 \n\
 ; for reset basetime, enable = yes, disable = no\n\
 enable reset basetime = yes\n\
@@ -250,7 +254,7 @@ ac3 parser element = ac3parse\n\
 \n\
 ac3 decoder element =\n\
 \n\
-lpcm converter element = audioconvert\n\
+lpcm converter element =\n\
 \n\
 lpcm filter element = capsfilter\n\
 \n\
@@ -260,9 +264,15 @@ audio volume element =\n\
 \n\
 audio sink element = pulsesink\n\
 \n\
-video parser element = h264parse\n\
+video parser element = ;h264parse\n\
 \n\
-video decoder element = omxh264dec\n\
+video capssetter element = capssetter\n\
+\n\
+video decoder element = sprddec_h264;omxh264dec;avdec_h264\n\
+\n\
+video converter element =\n\
+\n\
+video filter element =\n\
 \n\
 video sink element = xvimagesink\n\
 \n\
@@ -289,9 +299,9 @@ video codec=0x1\n\
 \n\
 video native resolution = 0x20\n\
 \n\
-video cea support=0x194ab\n\
+video cea support=0x842b\n\
 \n\
-video vesa support=0x5555555\n\
+video vesa support=0x1\n\
 \n\
 video hh support=0x555\n\
 \n\
@@ -303,9 +313,9 @@ video level=0x2\n\
 \n\
 video latency=0x0\n\
 \n\
-video vertical resolution=1080\n\
+video vertical resolution=720\n\
 \n\
-video horizontal resolution=1920\n\
+video horizontal resolution=1280\n\
 \n\
 video minimum slicesize=0\n\
 \n\
index 142bc7a..2de2253 100755 (executable)
@@ -48,7 +48,7 @@ _mmwfd_construct_attribute(MMHandleType handle)
 
        MMWfdAttrsSpec wfd_attrs[] = {
                {
-                       "server_ip",
+                       (char *)"server_ip",
                        MM_ATTRS_TYPE_STRING,
                        MM_ATTRS_FLAG_RW,
                        (void *)"127.0.0.1",
@@ -58,7 +58,7 @@ _mmwfd_construct_attribute(MMHandleType handle)
                },
 
                {
-                       "server_port",
+                       (char *)"server_port",
                        MM_ATTRS_TYPE_STRING,
                        MM_ATTRS_FLAG_RW,
                        (void *)"8554",
@@ -68,7 +68,7 @@ _mmwfd_construct_attribute(MMHandleType handle)
                },
 
                {
-                       "max_client_count",
+                       (char *)"max_client_count",
                        MM_ATTRS_TYPE_INT,
                        MM_ATTRS_FLAG_RW,
                        (void *)1,
@@ -78,7 +78,7 @@ _mmwfd_construct_attribute(MMHandleType handle)
                },
                /* Initialized with invalid native type, if a valid value is set then only this atribute will be considered */
                {
-                       "native_resolution",
+                       (char *)"native_resolution",
                        MM_ATTRS_TYPE_INT,
                        MM_ATTRS_FLAG_RW,
                        (void *)0,
@@ -88,7 +88,7 @@ _mmwfd_construct_attribute(MMHandleType handle)
                },
                /* Initialized with invalid resolution, if a valid value is set then only this atribute will be considered */
                {
-                       "prefered_resolutions",
+                       (char *)"prefered_resolutions",
                        MM_ATTRS_TYPE_INT,
                        MM_ATTRS_FLAG_RW,
                        (void *)2147483647,
@@ -98,7 +98,7 @@ _mmwfd_construct_attribute(MMHandleType handle)
                },
                /* Initialized with invalid uibc option, if a valid value is set then only this atribute will be considered */
                {
-                       "set_hdcp",
+                       (char *)"set_hdcp",
                        MM_ATTRS_TYPE_INT,
                        MM_ATTRS_FLAG_RW,
                        (void *)2,
@@ -107,7 +107,7 @@ _mmwfd_construct_attribute(MMHandleType handle)
                        2
                },
                {
-                       "display_rotate",
+                       (char *)"display_rotate",
                        MM_ATTRS_TYPE_INT,
                        MM_ATTRS_FLAG_RW,
                        (void *)0,
@@ -116,7 +116,7 @@ _mmwfd_construct_attribute(MMHandleType handle)
                        3
                },
                {
-                       "display_src_crop_x",
+                       (char *)"display_src_crop_x",
                        MM_ATTRS_TYPE_INT,
                        MM_ATTRS_FLAG_RW,
                        (void *) 0,
@@ -125,7 +125,7 @@ _mmwfd_construct_attribute(MMHandleType handle)
                        4096
                },
                {
-                       "display_src_crop_y",
+                       (char *)"display_src_crop_y",
                        MM_ATTRS_TYPE_INT,
                        MM_ATTRS_FLAG_RW,
                        (void *) 0,
@@ -134,7 +134,7 @@ _mmwfd_construct_attribute(MMHandleType handle)
                        4096
                },
                {
-                       "display_src_crop_width",
+                       (char *)"display_src_crop_width",
                        MM_ATTRS_TYPE_INT,
                        MM_ATTRS_FLAG_RW,
                        (void *) 0,
@@ -143,7 +143,7 @@ _mmwfd_construct_attribute(MMHandleType handle)
                        4096
                },
                {
-                       "display_src_crop_height",
+                       (char *)"display_src_crop_height",
                        MM_ATTRS_TYPE_INT,
                        MM_ATTRS_FLAG_RW,
                        (void *) 0,
@@ -152,7 +152,7 @@ _mmwfd_construct_attribute(MMHandleType handle)
                        4096
                },
                {
-                       "display_roi_x",
+                       (char *)"display_roi_x",
                        MM_ATTRS_TYPE_INT,
                        MM_ATTRS_FLAG_RW,
                        (void *) 0,
@@ -161,7 +161,7 @@ _mmwfd_construct_attribute(MMHandleType handle)
                        4096
                },
                {
-                       "display_roi_y",
+                       (char *)"display_roi_y",
                        MM_ATTRS_TYPE_INT,
                        MM_ATTRS_FLAG_RW,
                        (void *) 0,
@@ -170,7 +170,7 @@ _mmwfd_construct_attribute(MMHandleType handle)
                        4096
                },
                {
-                       "display_roi_width",
+                       (char *)"display_roi_width",
                        MM_ATTRS_TYPE_INT,
                        MM_ATTRS_FLAG_RW,
                        (void *) 480,
@@ -179,7 +179,7 @@ _mmwfd_construct_attribute(MMHandleType handle)
                        4096
                },
                {
-                       "display_roi_height",
+                       (char *)"display_roi_height",
                        MM_ATTRS_TYPE_INT,
                        MM_ATTRS_FLAG_RW,
                        (void *) 800,
@@ -188,7 +188,7 @@ _mmwfd_construct_attribute(MMHandleType handle)
                        4096
                },
                {
-                       "display_roi_mode",
+                       (char *)"display_roi_mode",
                        MM_ATTRS_TYPE_INT,
                        MM_ATTRS_FLAG_RW,
                        (void *) MM_DISPLAY_METHOD_CUSTOM_ROI_FULL_SCREEN,
@@ -197,7 +197,7 @@ _mmwfd_construct_attribute(MMHandleType handle)
                        MM_DISPLAY_METHOD_CUSTOM_ROI_LETER_BOX
                },
                {
-                       "display_rotation",
+                       (char *)"display_rotation",
                        MM_ATTRS_TYPE_INT,
                        MM_ATTRS_FLAG_RW,
                        (void *) MM_DISPLAY_ROTATION_NONE,
@@ -206,7 +206,7 @@ _mmwfd_construct_attribute(MMHandleType handle)
                        MM_DISPLAY_ROTATION_270
                },
                {
-                       "display_visible",
+                       (char *)"display_visible",
                        MM_ATTRS_TYPE_INT,
                        MM_ATTRS_FLAG_RW,
                        (void *) TRUE,
@@ -215,7 +215,7 @@ _mmwfd_construct_attribute(MMHandleType handle)
                        1
                },
                {
-                       "display_method",
+                       (char *)"display_method",
                        MM_ATTRS_TYPE_INT,
                        MM_ATTRS_FLAG_RW,
                        (void *) MM_DISPLAY_METHOD_LETTER_BOX,
@@ -224,7 +224,7 @@ _mmwfd_construct_attribute(MMHandleType handle)
                        MM_DISPLAY_METHOD_CUSTOM_ROI
                },
                {
-                       "display_overlay",
+                       (char *)"display_overlay",
                        MM_ATTRS_TYPE_DATA,
                        MM_ATTRS_FLAG_RW,
                        (void *) NULL,
@@ -233,7 +233,7 @@ _mmwfd_construct_attribute(MMHandleType handle)
                        0
                },
                {
-                       "display_overlay_user_data",
+                       (char *)"display_overlay_user_data",
                        MM_ATTRS_TYPE_DATA,
                        MM_ATTRS_FLAG_RW,
                        (void *) NULL,
@@ -242,7 +242,7 @@ _mmwfd_construct_attribute(MMHandleType handle)
                        0
                },
                {
-                       "display_zoom",
+                       (char *)"display_zoom",
                        MM_ATTRS_TYPE_DOUBLE,
                        MM_ATTRS_FLAG_RW,
                        (void *) 1,
@@ -251,7 +251,7 @@ _mmwfd_construct_attribute(MMHandleType handle)
                        9.0
                },
                {
-                       "display_surface_type",
+                       (char *)"display_surface_type",
                        MM_ATTRS_TYPE_INT,
                        MM_ATTRS_FLAG_RW,
                        (void *) MM_DISPLAY_SURFACE_NULL,
@@ -260,7 +260,7 @@ _mmwfd_construct_attribute(MMHandleType handle)
                        MM_DISPLAY_SURFACE_X_EXT
                },
                {
-                       "display_width",   /* dest width of fimcconvert ouput */
+                       (char *)"display_width",   /* dest width of fimcconvert ouput */
                        MM_ATTRS_TYPE_INT,
                        MM_ATTRS_FLAG_RW,
                        (void *) 0,
@@ -269,7 +269,7 @@ _mmwfd_construct_attribute(MMHandleType handle)
                        4096
                },
                {
-                       "display_height",   /* dest height of fimcconvert ouput */
+                       (char *)"display_height",   /* dest height of fimcconvert ouput */
                        MM_ATTRS_TYPE_INT,
                        MM_ATTRS_FLAG_RW,
                        (void *) 0,
@@ -278,7 +278,7 @@ _mmwfd_construct_attribute(MMHandleType handle)
                        4096
                },
                {
-                       "display_evas_do_scaling",
+                       (char *)"display_evas_do_scaling",
                        MM_ATTRS_TYPE_INT,
                        MM_ATTRS_FLAG_RW,
                        (void *) TRUE,
@@ -287,7 +287,7 @@ _mmwfd_construct_attribute(MMHandleType handle)
                        TRUE
                },
                {
-                       "display_x",
+                       (char *)"display_x",
                        MM_ATTRS_TYPE_INT,
                        MM_ATTRS_FLAG_RW,
                        (void *) 0,
@@ -296,7 +296,7 @@ _mmwfd_construct_attribute(MMHandleType handle)
                        4096
                },
                {
-                       "display_y",
+                       (char *)"display_y",
                        MM_ATTRS_TYPE_INT,
                        MM_ATTRS_FLAG_RW,
                        (void *) 0,
@@ -305,7 +305,7 @@ _mmwfd_construct_attribute(MMHandleType handle)
                        4096
                },
                {
-                       "hdcp_handle",
+                       (char *)"hdcp_handle",
                        MM_ATTRS_TYPE_DATA,
                        MM_ATTRS_FLAG_RW,
                        (void *) NULL,
@@ -314,7 +314,7 @@ _mmwfd_construct_attribute(MMHandleType handle)
                        0
                },
                {
-                       "hdcp_version",
+                       (char *)"hdcp_version",
                        MM_ATTRS_TYPE_INT,
                        MM_ATTRS_FLAG_RW,
                        (void *) 0,
@@ -323,7 +323,7 @@ _mmwfd_construct_attribute(MMHandleType handle)
                        2
                },
                {
-                       "hdcp_port",
+                       (char *)"hdcp_port",
                        MM_ATTRS_TYPE_INT,
                        MM_ATTRS_FLAG_RW,
                        (void *) 0,
index 6fc8acb..c0951f1 100755 (executable)
@@ -43,7 +43,7 @@ static void __mm_wfd_sink_ini_check_status(void);
                gchar *str = NULL; \
                gint length = 0; \
                \
-               str = iniparser_getstring(x_dict, x_ini, x_default); \
+               str = iniparser_getstring(x_dict, x_ini, (char *)x_default); \
                if (str) { \
                        length = strlen(str); \
                        if ((length > 1) && (length < WFD_SINK_INI_MAX_STRLEN)) \
@@ -60,7 +60,7 @@ static
 gboolean __generate_sink_default_ini(void)
 {
        FILE *fp = NULL;
-       gchar *default_ini = MM_WFD_SINK_DEFAULT_INI;
+       const gchar *default_ini = MM_WFD_SINK_DEFAULT_INI;
 
 
        /* create new file */
@@ -151,7 +151,10 @@ mm_wfd_sink_ini_load(mm_wfd_sink_ini_t *ini)
                MM_WFD_SINK_INI_GET_STRING(dict, ini->name_of_audio_sink, "pipeline:audio sink element", DEFAULT_NAME_OF_AUDIO_SINK);
                MM_WFD_SINK_INI_GET_STRING(dict, ini->name_of_video_hdcp, "pipeline:video hdcp element", DEFAULT_NAME_OF_VIDEO_HDCP);
                MM_WFD_SINK_INI_GET_STRING(dict, ini->name_of_video_parser, "pipeline:video parser element", DEFAULT_NAME_OF_VIDEO_PARSER);
+               MM_WFD_SINK_INI_GET_STRING(dict, ini->name_of_video_capssetter, "pipeline:video capssetter element", DEFAULT_NAME_OF_VIDEO_CAPSSETTER);
                MM_WFD_SINK_INI_GET_STRING(dict, ini->name_of_video_decoder, "pipeline:video decoder element", DEFAULT_NAME_OF_VIDEO_DECODER);
+               MM_WFD_SINK_INI_GET_STRING(dict, ini->name_of_video_converter, "pipeline:video converter element", DEFAULT_NAME_OF_VIDEO_CONVERTER);
+               MM_WFD_SINK_INI_GET_STRING(dict, ini->name_of_video_filter, "pipeline:video filter element", DEFAULT_NAME_OF_VIDEO_FILTER);
                MM_WFD_SINK_INI_GET_STRING(dict, ini->name_of_video_sink, "pipeline:video sink element", DEFAULT_NAME_OF_VIDEO_SINK);
 
                /* audio parameter*/
@@ -214,7 +217,10 @@ mm_wfd_sink_ini_load(mm_wfd_sink_ini_t *ini)
                strncpy(ini->name_of_audio_sink, DEFAULT_NAME_OF_AUDIO_SINK, WFD_SINK_INI_MAX_STRLEN - 1);
                strncpy(ini->name_of_video_hdcp, DEFAULT_NAME_OF_VIDEO_HDCP, WFD_SINK_INI_MAX_STRLEN - 1);
                strncpy(ini->name_of_video_parser, DEFAULT_NAME_OF_VIDEO_PARSER, WFD_SINK_INI_MAX_STRLEN - 1);
+               strncpy(ini->name_of_video_capssetter, DEFAULT_NAME_OF_VIDEO_CAPSSETTER, WFD_SINK_INI_MAX_STRLEN - 1);
                strncpy(ini->name_of_video_decoder, DEFAULT_NAME_OF_VIDEO_DECODER, WFD_SINK_INI_MAX_STRLEN - 1);
+               strncpy(ini->name_of_video_converter, DEFAULT_NAME_OF_VIDEO_CONVERTER, WFD_SINK_INI_MAX_STRLEN - 1);
+               strncpy(ini->name_of_video_filter, DEFAULT_NAME_OF_VIDEO_FILTER, WFD_SINK_INI_MAX_STRLEN - 1);
                strncpy(ini->name_of_video_sink, DEFAULT_NAME_OF_VIDEO_SINK, WFD_SINK_INI_MAX_STRLEN - 1);
 
                /* audio parameter*/
@@ -286,13 +292,13 @@ mm_wfd_sink_ini_load(mm_wfd_sink_ini_t *ini)
        wfd_sink_debug("name_of_lpcm_filter : %s\n", ini->name_of_lpcm_filter);
        wfd_sink_debug("name_of_audio_resampler : %s\n", ini->name_of_audio_resampler);
        wfd_sink_debug("name_of_audio_volume : %s\n", ini->name_of_audio_volume);
-#ifdef ENABLE_WFD_VD_FEATURES
-       wfd_sink_debug("name_of_audio_splitter : %s\n", ini->name_of_audio_splitter);
-#endif
        wfd_sink_debug("name_of_audio_sink : %s\n", ini->name_of_audio_sink);
        wfd_sink_debug("name_of_video_hdcp : %s\n", ini->name_of_video_hdcp);
        wfd_sink_debug("name_of_video_parser : %s\n", ini->name_of_video_parser);
+       wfd_sink_debug("name_of_video_capssetter : %s\n", ini->name_of_video_capssetter);
        wfd_sink_debug("name_of_video_decoder : %s\n", ini->name_of_video_decoder);
+       wfd_sink_debug("name_of_video_converter : %s\n", ini->name_of_video_converter);
+       wfd_sink_debug("name_of_video_filter : %s\n", ini->name_of_video_filter);
        wfd_sink_debug("name_of_video_sink : %s\n", ini->name_of_video_sink);
 
        /* audio parameter*/
index c1102ad..1bdd75b 100755 (executable)
@@ -33,7 +33,7 @@ enable asm = no
 jitter buffer latency=10
 
 ; for retransmission request enable = yes, disable = no
-enable retransmission = yes
+enable retransmission = no
 
 ; for reset basetime, enable = yes, disable = no
 enable reset basetime = yes
@@ -62,7 +62,7 @@ ac3 parser element = ac3parse
 
 ac3 decoder element = 
 
-lpcm converter element = audioconvert
+lpcm converter element =
 
 lpcm filter element = capsfilter
 
@@ -72,9 +72,15 @@ audio volume element =
 
 audio sink element = pulsesink
 
-video parser element = h264parse
+video parser element = ;h264parse
 
-video decoder element = omxh264dec;avdec_h264
+video capssetter element = capssetter
+
+video decoder element = sprddec_h264;omxh264dec;avdec_h264
+
+video converter element =
+
+video filter element =
 
 video sink element = xvimagesink
 
@@ -101,9 +107,9 @@ video codec=0x1
 
 video native resolution = 0x20
 
-video cea support=0x194ab
+video cea support=0x842b;0x194ab
 
-video vesa support=0x5555555
+video vesa support=0x1;0x5555555
 
 video hh support=0x555
 
@@ -115,9 +121,9 @@ video level=0x2
 
 video latency=0x0
 
-video vertical resolution=1080
+video vertical resolution=720
 
-video horizontal resolution=1920
+video horizontal resolution=1280
 
 video minimum slicesize=0
 
index 1e53f04..f636cbd 100755 (executable)
@@ -1,6 +1,6 @@
 Name:       libmm-wfd
 Summary:    Multimedia Framework Wifi-Display Library
-Version:    0.2.171
+Version:    0.2.178
 Release:    0
 Group:      System/Libraries
 License:    Apache License 2.0
@@ -39,6 +39,9 @@ Requires:   %{name} = %{version}-%{release}
 %setup -q
 
 %build
+export CFLAGS+=" -Wextra -Wno-array-bounds"
+export CFLAGS+=" -Wno-ignored-qualifiers -Wno-unused-parameter -Wshadow"
+export CFLAGS+=" -Wwrite-strings -Wswitch-default"
 
 ./autogen.sh
 
index c94122d..620324f 100755 (executable)
@@ -43,6 +43,20 @@ typedef enum {
        MM_WFD_SINK_STATE_NUM,                          /**< Number of wifi-display states */
 } MMWFDSinkStateType;
 
+/* audio codec : AAC, AC3, LPCM  */
+typedef enum {
+       MM_WFD_SINK_AUDIO_CODEC_NONE,
+       MM_WFD_SINK_AUDIO_CODEC_AAC = 0x0F,
+       MM_WFD_SINK_AUDIO_CODEC_AC3 = 0x81,
+       MM_WFD_SINK_AUDIO_CODEC_LPCM = 0x83
+} MMWFDSinkAudioCodec;
+
+/* video codec : H264  */
+typedef enum {
+       MM_WFD_SINK_VIDEO_CODEC_NONE,
+       MM_WFD_SINK_VIDEO_CODEC_H264 = 0x1b
+} MMWFDSinkVideoCodec;
+
 typedef void(*MMWFDMessageCallback)(int error_type, MMWFDSinkStateType state_type, void *user_data);
 
 /**
@@ -460,4 +474,11 @@ int mm_wfd_sink_get_video_framerate(MMHandleType wfd_sink,  gint *framerate);
  */
 int mm_wfd_sink_set_resolution(MMHandleType wfd_sink,  gint resolution);
 
+int mm_wfd_sink_get_negotiated_video_codec(MMHandleType wfd_sink,  gint *codec);
+int mm_wfd_sink_get_negotiated_video_resolution(MMHandleType wfd_sink,  gint *width, gint *height);
+int mm_wfd_sink_get_negotiated_video_frame_rate(MMHandleType wfd_sink,  gint *frame_rate);
+int mm_wfd_sink_get_negotiated_audio_codec(MMHandleType wfd_sink,  gint *codec);
+int mm_wfd_sink_get_negotiated_audio_channel(MMHandleType wfd_sink,  gint *channel);
+int mm_wfd_sink_get_negotiated_audio_sample_rate(MMHandleType wfd_sink,  gint *sample_rate);
+int mm_wfd_sink_get_negotiated_audio_bitwidth(MMHandleType wfd_sink,  gint *bitwidth);
 #endif
index fb16fbc..5be6d31 100755 (executable)
@@ -70,26 +70,14 @@ enum WFDSinkVideoElementID {
        WFD_SINK_V_QUEUE,
        WFD_SINK_V_HDCP,
        WFD_SINK_V_PARSE,
+       WFD_SINK_V_CAPSSETTER,
        WFD_SINK_V_DEC,
        WFD_SINK_V_CONVERT,
+       WFD_SINK_V_CAPSFILTER,
        WFD_SINK_V_SINK,
        WFD_SINK_V_NUM
 };
 
-/* audio codec : AAC, AC3, LPCM  */
-enum WFDSinkAudioCodec {
-       WFD_SINK_AUDIO_CODEC_NONE,
-       WFD_SINK_AUDIO_CODEC_AAC = 0x0F,
-       WFD_SINK_AUDIO_CODEC_AC3 = 0x81,
-       WFD_SINK_AUDIO_CODEC_LPCM = 0x83
-};
-
-/* video codec : H264  */
-enum WFDSinkVideoCodec {
-       WFD_SINK_VIDEO_CODEC_NONE,
-       WFD_SINK_VIDEO_CODEC_H264 = 0x1b
-};
-
 /**
  *  * Enumerations of wifi-display command.
  *   */
@@ -242,8 +230,11 @@ int _mm_wfd_sink_get_resource(mm_wfd_sink_t *wfd_sink);
 int _mm_wfd_sink_set_resolution(mm_wfd_sink_t *wfd_sink, MMWFDSinkResolution resolution);
 
 int __mm_wfd_sink_link_audiobin(mm_wfd_sink_t *wfd_sink);
+int __mm_wfd_sink_link_videobin(mm_wfd_sink_t *wfd_sink);
 int __mm_wfd_sink_prepare_videobin(mm_wfd_sink_t *wfd_sink);
 int __mm_wfd_sink_prepare_audiobin(mm_wfd_sink_t *wfd_sink);
 
+const gchar *_mm_wfds_sink_get_state_name(MMWFDSinkStateType state);
+
 #endif
 
index 20e46ad..870982a 100755 (executable)
@@ -82,7 +82,7 @@
 #define MMWFDSINK_CURRENT_STATE(x_wfd_sink) ((mm_wfd_sink_t *)x_wfd_sink)->state.state
 #define MMWFDSINK_PREVIOUS_STATE(x_wfd_sink) ((mm_wfd_sink_t *)x_wfd_sink)->state.prev_state
 #define MMWFDSINK_PENDING_STATE(x_wfd_sink) ((mm_wfd_sink_t *)x_wfd_sink)->state.pending_state
-#define MMWFDSINK_STATE_GET_NAME(x_state) __mm_wfds_sink_get_state_name(x_state)
+#define MMWFDSINK_STATE_GET_NAME(x_state) _mm_wfds_sink_get_state_name(x_state)
 
 #define MMWFDSINK_PRINT_STATE(x_wfd_sink) \
        wfd_sink_debug("--prev %s, current %s, pending %s--\n", \
index c7f6131..cfa0dfc 100755 (executable)
@@ -233,4 +233,218 @@ int mm_wfd_sink_set_resolution(MMHandleType wfd_sink,  gint resolution)
        return result;
 }
 
+int mm_wfd_sink_get_negotiated_video_codec(MMHandleType wfd_sink,  gint *codec)
+{
+       int result = MM_ERROR_NONE;
+       mm_wfd_sink_t *wfd = (mm_wfd_sink_t *)wfd_sink;
+       MMWFDSinkStateType cur_state = MM_WFD_SINK_STATE_NONE;
+
+       wfd_sink_return_val_if_fail(wfd, MM_ERROR_WFD_NOT_INITIALIZED);
+       wfd_sink_return_val_if_fail(codec, MM_ERROR_WFD_INVALID_ARGUMENT);
+
+       MMWFDSINK_CMD_LOCK(wfd);
+
+       MMWFDSINK_PRINT_STATE(wfd);
+       cur_state = MMWFDSINK_CURRENT_STATE(wfd);
+       if (cur_state != MM_WFD_SINK_STATE_CONNECTED &&
+        cur_state != MM_WFD_SINK_STATE_PLAYING &&
+        cur_state != MM_WFD_SINK_STATE_PAUSED) {
+
+               wfd_sink_error("This function must be called after MM_WFD_SINK_STATE_CONNECTED");
+               result = MM_ERROR_WFD_INVALID_STATE;
+       } else {
+               *codec = wfd->stream_info.video_stream_info.codec;
+       }
+
+       MMWFDSINK_CMD_UNLOCK(wfd);
+
+       wfd_sink_debug_fleave();
+
+       return result;
+}
+
+int mm_wfd_sink_get_negotiated_video_resolution(MMHandleType wfd_sink,  gint *width, gint *height)
+{
+       int result = MM_ERROR_NONE;
+       mm_wfd_sink_t *wfd = (mm_wfd_sink_t *)wfd_sink;
+       MMWFDSinkStateType cur_state = MM_WFD_SINK_STATE_NONE;
+
+       wfd_sink_return_val_if_fail(wfd, MM_ERROR_WFD_NOT_INITIALIZED);
+       wfd_sink_return_val_if_fail(width, MM_ERROR_WFD_INVALID_ARGUMENT);
+       wfd_sink_return_val_if_fail(height, MM_ERROR_WFD_INVALID_ARGUMENT);
+
+       MMWFDSINK_CMD_LOCK(wfd);
+
+       MMWFDSINK_PRINT_STATE(wfd);
+       cur_state = MMWFDSINK_CURRENT_STATE(wfd);
+       if (cur_state != MM_WFD_SINK_STATE_CONNECTED &&
+        cur_state != MM_WFD_SINK_STATE_PLAYING &&
+        cur_state != MM_WFD_SINK_STATE_PAUSED) {
+
+               wfd_sink_error("This function must be called after MM_WFD_SINK_STATE_CONNECTED");
+               result = MM_ERROR_WFD_INVALID_STATE;
+       } else {
+               *width = wfd->stream_info.video_stream_info.width;
+               *height = wfd->stream_info.video_stream_info.height;
+       }
+
+       MMWFDSINK_CMD_UNLOCK(wfd);
+
+       wfd_sink_debug_fleave();
 
+       return result;
+}
+
+int mm_wfd_sink_get_negotiated_video_frame_rate(MMHandleType wfd_sink,  gint *frame_rate)
+{
+       int result = MM_ERROR_NONE;
+       mm_wfd_sink_t *wfd = (mm_wfd_sink_t *)wfd_sink;
+       MMWFDSinkStateType cur_state = MM_WFD_SINK_STATE_NONE;
+
+       wfd_sink_return_val_if_fail(wfd, MM_ERROR_WFD_NOT_INITIALIZED);
+       wfd_sink_return_val_if_fail(frame_rate, MM_ERROR_WFD_INVALID_ARGUMENT);
+
+       MMWFDSINK_CMD_LOCK(wfd);
+
+       MMWFDSINK_PRINT_STATE(wfd);
+       cur_state = MMWFDSINK_CURRENT_STATE(wfd);
+       if (cur_state != MM_WFD_SINK_STATE_CONNECTED &&
+        cur_state != MM_WFD_SINK_STATE_PLAYING &&
+        cur_state != MM_WFD_SINK_STATE_PAUSED) {
+
+               wfd_sink_error("This function must be called after MM_WFD_SINK_STATE_CONNECTED");
+               result = MM_ERROR_WFD_INVALID_STATE;
+       } else {
+               *frame_rate = wfd->stream_info.video_stream_info.frame_rate;
+       }
+
+       MMWFDSINK_CMD_UNLOCK(wfd);
+
+       wfd_sink_debug_fleave();
+
+       return result;
+}
+
+int mm_wfd_sink_get_negotiated_audio_codec(MMHandleType wfd_sink,  gint *codec)
+{
+       int result = MM_ERROR_NONE;
+       mm_wfd_sink_t *wfd = (mm_wfd_sink_t *)wfd_sink;
+       MMWFDSinkStateType cur_state = MM_WFD_SINK_STATE_NONE;
+
+       wfd_sink_return_val_if_fail(wfd, MM_ERROR_WFD_NOT_INITIALIZED);
+       wfd_sink_return_val_if_fail(codec, MM_ERROR_WFD_INVALID_ARGUMENT);
+
+       MMWFDSINK_CMD_LOCK(wfd);
+
+       MMWFDSINK_PRINT_STATE(wfd);
+       cur_state = MMWFDSINK_CURRENT_STATE(wfd);
+       if (cur_state != MM_WFD_SINK_STATE_CONNECTED &&
+        cur_state != MM_WFD_SINK_STATE_PLAYING &&
+        cur_state != MM_WFD_SINK_STATE_PAUSED) {
+
+               wfd_sink_error("This function must be called after MM_WFD_SINK_STATE_CONNECTED");
+               result = MM_ERROR_WFD_INVALID_STATE;
+       } else {
+               *codec = wfd->stream_info.audio_stream_info.codec;
+       }
+
+       MMWFDSINK_CMD_UNLOCK(wfd);
+
+       wfd_sink_debug_fleave();
+
+       return result;
+}
+
+int mm_wfd_sink_get_negotiated_audio_channel(MMHandleType wfd_sink,  gint *channel)
+{
+       int result = MM_ERROR_NONE;
+       mm_wfd_sink_t *wfd = (mm_wfd_sink_t *)wfd_sink;
+       MMWFDSinkStateType cur_state = MM_WFD_SINK_STATE_NONE;
+
+       wfd_sink_return_val_if_fail(wfd, MM_ERROR_WFD_NOT_INITIALIZED);
+       wfd_sink_return_val_if_fail(channel, MM_ERROR_WFD_INVALID_ARGUMENT);
+
+       MMWFDSINK_CMD_LOCK(wfd);
+
+       MMWFDSINK_PRINT_STATE(wfd);
+       cur_state = MMWFDSINK_CURRENT_STATE(wfd);
+       if (cur_state != MM_WFD_SINK_STATE_CONNECTED &&
+        cur_state != MM_WFD_SINK_STATE_PLAYING &&
+        cur_state != MM_WFD_SINK_STATE_PAUSED) {
+
+               wfd_sink_error("This function must be called after MM_WFD_SINK_STATE_CONNECTED");
+               result = MM_ERROR_WFD_INVALID_STATE;
+       } else {
+               *channel = wfd->stream_info.audio_stream_info.channels;
+       }
+
+       MMWFDSINK_CMD_UNLOCK(wfd);
+
+       wfd_sink_debug_fleave();
+
+       return result;
+}
+
+int mm_wfd_sink_get_negotiated_audio_sample_rate(MMHandleType wfd_sink,  gint *sample_rate)
+{
+       int result = MM_ERROR_NONE;
+       mm_wfd_sink_t *wfd = (mm_wfd_sink_t *)wfd_sink;
+       MMWFDSinkStateType cur_state = MM_WFD_SINK_STATE_NONE;
+
+       wfd_sink_debug_fenter();
+
+       wfd_sink_return_val_if_fail(wfd, MM_ERROR_WFD_NOT_INITIALIZED);
+       wfd_sink_return_val_if_fail(sample_rate, MM_ERROR_WFD_INVALID_ARGUMENT);
+
+       MMWFDSINK_CMD_LOCK(wfd);
+
+       MMWFDSINK_PRINT_STATE(wfd);
+       cur_state = MMWFDSINK_CURRENT_STATE(wfd);
+       if (cur_state != MM_WFD_SINK_STATE_CONNECTED &&
+        cur_state != MM_WFD_SINK_STATE_PLAYING &&
+        cur_state != MM_WFD_SINK_STATE_PAUSED) {
+
+               wfd_sink_error("This function must be called after MM_WFD_SINK_STATE_CONNECTED");
+               result = MM_ERROR_WFD_INVALID_STATE;
+       } else {
+               *sample_rate = wfd->stream_info.audio_stream_info.sample_rate;
+       }
+
+       MMWFDSINK_CMD_UNLOCK(wfd);
+
+       wfd_sink_debug_fleave();
+
+       return result;
+}
+
+int mm_wfd_sink_get_negotiated_audio_bitwidth(MMHandleType wfd_sink,  gint *bitwidth)
+{
+       int result = MM_ERROR_NONE;
+       mm_wfd_sink_t *wfd = (mm_wfd_sink_t *)wfd_sink;
+       MMWFDSinkStateType cur_state = MM_WFD_SINK_STATE_NONE;
+
+       wfd_sink_debug_fenter();
+
+       wfd_sink_return_val_if_fail(wfd, MM_ERROR_WFD_NOT_INITIALIZED);
+       wfd_sink_return_val_if_fail(bitwidth, MM_ERROR_WFD_INVALID_ARGUMENT);
+
+       MMWFDSINK_CMD_LOCK(wfd);
+
+       MMWFDSINK_PRINT_STATE(wfd);
+       cur_state = MMWFDSINK_CURRENT_STATE(wfd);
+       if (cur_state != MM_WFD_SINK_STATE_CONNECTED &&
+        cur_state != MM_WFD_SINK_STATE_PLAYING &&
+        cur_state != MM_WFD_SINK_STATE_PAUSED) {
+
+               wfd_sink_error("This function must be called after MM_WFD_SINK_STATE_CONNECTED");
+               result = MM_ERROR_WFD_INVALID_STATE;
+       } else {
+               *bitwidth = wfd->stream_info.audio_stream_info.bitwidth;
+       }
+
+       MMWFDSINK_CMD_UNLOCK(wfd);
+
+       wfd_sink_debug_fleave();
+
+       return result;
+}
index 034944f..737cfd6 100755 (executable)
@@ -143,6 +143,10 @@ __mm_wfd_sink_manager_thread(gpointer data)
                /* link video bin*/
                if (link_video_bin) {
                        wfd_sink_debug("try to link videobin.");
+                       if (MM_ERROR_NONE != __mm_wfd_sink_link_videobin(wfd_sink)) {
+                               wfd_sink_error("failed to link videobin.....\n");
+                               goto EXIT;
+                       }
                }
 
                if (set_ready_audio_bin) {
index fa16e76..db11fe6 100755 (executable)
@@ -44,7 +44,6 @@ static int __mm_wfd_sink_set_state(mm_wfd_sink_t *wfd_sink, MMWFDSinkStateType s
 
 /* util */
 static void __mm_wfd_sink_dump_pipeline_state(mm_wfd_sink_t *wfd_sink);
-const gchar *__mm_wfds_sink_get_state_name(MMWFDSinkStateType state);
 static void __mm_wfd_sink_prepare_video_resolution(gint resolution, guint *CEA_resolution,
                                                    guint *VESA_resolution, guint *HH_resolution);
 
@@ -92,11 +91,11 @@ int _mm_wfd_sink_create(mm_wfd_sink_t **wfd_sink)
        MMWFDSINK_PENDING_STATE(new_wfd_sink) =  MM_WFD_SINK_STATE_NONE;
 
        /* initialize audio/video information */
-       new_wfd_sink->stream_info.audio_stream_info.codec = WFD_SINK_AUDIO_CODEC_NONE;
+       new_wfd_sink->stream_info.audio_stream_info.codec = MM_WFD_SINK_AUDIO_CODEC_NONE;
        new_wfd_sink->stream_info.audio_stream_info.channels = 0;
        new_wfd_sink->stream_info.audio_stream_info.sample_rate = 0;
        new_wfd_sink->stream_info.audio_stream_info.bitwidth = 0;
-       new_wfd_sink->stream_info.video_stream_info.codec = WFD_SINK_VIDEO_CODEC_NONE;
+       new_wfd_sink->stream_info.video_stream_info.codec = MM_WFD_SINK_VIDEO_CODEC_NONE;
        new_wfd_sink->stream_info.video_stream_info.width = 0;
        new_wfd_sink->stream_info.video_stream_info.height = 0;
        new_wfd_sink->stream_info.video_stream_info.frame_rate = 0;
@@ -313,7 +312,12 @@ int _mm_wfd_sink_resume(mm_wfd_sink_t *wfd_sink)
 
        wfd_sink_debug_fenter();
 
-       wfd_sink_return_val_if_fail(wfd_sink, MM_ERROR_WFD_NOT_INITIALIZED);
+       wfd_sink_return_val_if_fail(wfd_sink &&
+                                   wfd_sink->pipeline &&
+                                   wfd_sink->pipeline->mainbin &&
+                                   wfd_sink->pipeline->mainbin[WFD_SINK_M_PIPE].gst &&
+                                   wfd_sink->pipeline->mainbin[WFD_SINK_M_SRC].gst,
+                                   MM_ERROR_WFD_NOT_INITIALIZED);
 
        /* check current wi-fi display sink state */
        MMWFDSINK_CHECK_STATE(wfd_sink, MM_WFD_SINK_COMMAND_RESUME);
@@ -331,7 +335,12 @@ int _mm_wfd_sink_disconnect(mm_wfd_sink_t *wfd_sink)
 
        wfd_sink_debug_fenter();
 
-       wfd_sink_return_val_if_fail(wfd_sink, MM_ERROR_WFD_NOT_INITIALIZED);
+       wfd_sink_return_val_if_fail(wfd_sink &&
+                                   wfd_sink->pipeline &&
+                                   wfd_sink->pipeline->mainbin &&
+                                   wfd_sink->pipeline->mainbin[WFD_SINK_M_PIPE].gst &&
+                                   wfd_sink->pipeline->mainbin[WFD_SINK_M_SRC].gst,
+                                   MM_ERROR_WFD_NOT_INITIALIZED);
 
        /* check current wi-fi display sink state */
        MMWFDSINK_CHECK_STATE(wfd_sink, MM_WFD_SINK_COMMAND_DISCONNECT);
@@ -500,22 +509,6 @@ static int __mm_wfd_sink_init_gstreamer(mm_wfd_sink_t *wfd_sink)
        return result;
 }
 
-static void
-_mm_wfd_sink_correct_pipeline_latency(mm_wfd_sink_t *wfd_sink)
-{
-       GstQuery *qlatency;
-       GstClockTime min_latency;
-
-       qlatency = gst_query_new_latency();
-       gst_element_query(wfd_sink->pipeline->mainbin[WFD_SINK_M_PIPE].gst, qlatency);
-       gst_query_parse_latency(qlatency, NULL, &min_latency, NULL);
-
-       debug_msg("Correct manually pipeline latency: current=%"GST_TIME_FORMAT, GST_TIME_ARGS(min_latency));
-       g_object_set(wfd_sink->pipeline->videobin[WFD_SINK_V_SINK].gst, "ts-offset", -(gint64)(min_latency * 9 / 10), NULL);
-       g_object_set(wfd_sink->pipeline->audiobin[WFD_SINK_A_SINK].gst, "ts-offset", -(gint64)(min_latency * 9 / 10), NULL);
-       gst_query_unref(qlatency);
-}
-
 static GstBusSyncReply
 _mm_wfd_bus_sync_callback(GstBus *bus, GstMessage *message, gpointer data)
 {
@@ -610,6 +603,8 @@ _mm_wfd_sink_msg_callback(GstBus *bus, GstMessage *msg, gpointer data)
                                voldstate = gst_structure_get_value(structure, "old-state");
                                vnewstate = gst_structure_get_value(structure, "new-state");
                                vpending = gst_structure_get_value(structure, "pending-state");
+                               if (voldstate == NULL || vnewstate == NULL || vpending == NULL)
+                                       break;
 
                                oldstate = (GstState)voldstate->data[0].v_int;
                                newstate = (GstState)vnewstate->data[0].v_int;
@@ -682,9 +677,7 @@ _mm_wfd_sink_msg_callback(GstBus *bus, GstMessage *msg, gpointer data)
 
                case GST_MESSAGE_ELEMENT: {
                                const gchar *structure_name = NULL;
-                               const GstStructure *message_structure = NULL;
 
-                               message_structure = gst_message_get_structure(msg);
                                structure_name = gst_structure_get_name(message_structure);
                                if (structure_name) {
                                        wfd_sink_debug("got element specific message[%s]\n", GST_STR_NULL(structure_name));
@@ -1145,8 +1138,13 @@ __mm_wfd_sink_prepare_videobin(mm_wfd_sink_t *wfd_sink)
                        wfd_sink_error("failed to create videobin....\n");
                        goto ERROR;
                }
-       } else {
-               wfd_sink_debug("videobin is already created.\n");
+       }
+
+       if (!wfd_sink->video_bin_is_linked) {
+               if (MM_ERROR_NONE != __mm_wfd_sink_link_videobin(wfd_sink)) {
+                       wfd_sink_error("failed to link video decoder.....\n");
+                       goto ERROR;
+               }
        }
 
        videobin = wfd_sink->pipeline->videobin[WFD_SINK_V_BIN].gst;
@@ -1625,11 +1623,11 @@ __mm_wfd_sink_update_stream_info(GstElement *wfdrtspsrc, GstStructure *str, gpoi
                is_valid_audio_format = TRUE;
                audio_format = g_strdup(gst_structure_get_string(str, "audio_format"));
                if (g_strrstr(audio_format, "AAC"))
-                       stream_info->audio_stream_info.codec = WFD_SINK_AUDIO_CODEC_AAC;
+                       stream_info->audio_stream_info.codec = MM_WFD_SINK_AUDIO_CODEC_AAC;
                else if (g_strrstr(audio_format, "AC3"))
-                       stream_info->audio_stream_info.codec = WFD_SINK_AUDIO_CODEC_AC3;
+                       stream_info->audio_stream_info.codec = MM_WFD_SINK_AUDIO_CODEC_AC3;
                else if (g_strrstr(audio_format, "LPCM"))
-                       stream_info->audio_stream_info.codec = WFD_SINK_AUDIO_CODEC_LPCM;
+                       stream_info->audio_stream_info.codec = MM_WFD_SINK_AUDIO_CODEC_LPCM;
                else {
                        wfd_sink_error("invalid audio format(%s)...\n", audio_format);
                        is_valid_audio_format = FALSE;
@@ -1662,7 +1660,7 @@ __mm_wfd_sink_update_stream_info(GstElement *wfdrtspsrc, GstStructure *str, gpoi
                }
 
                if (is_valid_video_format == TRUE) {
-                       stream_info->video_stream_info.codec = WFD_SINK_VIDEO_CODEC_H264;
+                       stream_info->video_stream_info.codec = MM_WFD_SINK_VIDEO_CODEC_H264;
 
                        if (gst_structure_has_field(str, "video_width"))
                                gst_structure_get_int(str, "video_width", &stream_info->video_stream_info.width);
@@ -1710,9 +1708,7 @@ static int __mm_wfd_sink_prepare_wfdrtspsrc(mm_wfd_sink_t *wfd_sink, GstElement
 
        g_object_set(G_OBJECT(wfdrtspsrc), "debug", wfd_sink->ini.set_debug_property, NULL);
        g_object_set(G_OBJECT(wfdrtspsrc), "latency", wfd_sink->ini.jitter_buffer_latency, NULL);
-#if 0
        g_object_set(G_OBJECT(wfdrtspsrc), "do-request", wfd_sink->ini.enable_retransmission, NULL);
-#endif
        g_object_set(G_OBJECT(wfdrtspsrc), "udp-buffer-size", 2097152, NULL);
        g_object_set(G_OBJECT(wfdrtspsrc), "enable-pad-probe", wfd_sink->ini.enable_wfdrtspsrc_pad_probe, NULL);
 
@@ -1928,7 +1924,7 @@ int __mm_wfd_sink_link_audiobin(mm_wfd_sink_t *wfd_sink)
        MMWFDSinkGstElement     *audiobin = NULL;
        MMWFDSinkGstElement *first_element = NULL;
        MMWFDSinkGstElement *last_element = NULL;
-       gint audio_codec = WFD_SINK_AUDIO_CODEC_NONE;
+       gint audio_codec = MM_WFD_SINK_AUDIO_CODEC_NONE;
        GList *element_bucket = NULL;
        GstPad *sinkpad = NULL;
        GstPad *srcpad = NULL;
@@ -1955,21 +1951,21 @@ int __mm_wfd_sink_link_audiobin(mm_wfd_sink_t *wfd_sink)
        /* check audio codec */
        audio_codec = wfd_sink->stream_info.audio_stream_info.codec;
        switch (audio_codec) {
-               case WFD_SINK_AUDIO_CODEC_LPCM:
+               case MM_WFD_SINK_AUDIO_CODEC_LPCM:
                        if (audiobin[WFD_SINK_A_LPCM_CONVERTER].gst)
                                element_bucket = g_list_append(element_bucket, &audiobin[WFD_SINK_A_LPCM_CONVERTER]);
                        if (audiobin[WFD_SINK_A_LPCM_FILTER].gst)
                                element_bucket = g_list_append(element_bucket, &audiobin[WFD_SINK_A_LPCM_FILTER]);
                        break;
 
-               case WFD_SINK_AUDIO_CODEC_AAC:
+               case MM_WFD_SINK_AUDIO_CODEC_AAC:
                        if (audiobin[WFD_SINK_A_AAC_PARSE].gst)
                                element_bucket = g_list_append(element_bucket, &audiobin[WFD_SINK_A_AAC_PARSE]);
                        if (audiobin[WFD_SINK_A_AAC_DEC].gst)
                                element_bucket = g_list_append(element_bucket, &audiobin[WFD_SINK_A_AAC_DEC]);
                        break;
 
-               case WFD_SINK_AUDIO_CODEC_AC3:
+               case MM_WFD_SINK_AUDIO_CODEC_AC3:
                        if (audiobin[WFD_SINK_A_AC3_PARSE].gst)
                                element_bucket = g_list_append(element_bucket, &audiobin[WFD_SINK_A_AC3_PARSE]);
                        if (audiobin[WFD_SINK_A_AC3_DEC].gst)
@@ -2080,7 +2076,6 @@ static int __mm_wfd_sink_prepare_audiosink(mm_wfd_sink_t *wfd_sink, GstElement *
 
        g_object_set(G_OBJECT(audio_sink), "provide-clock", FALSE,  NULL);
        g_object_set(G_OBJECT(audio_sink), "buffer-time", 100000LL, NULL);
-       g_object_set(G_OBJECT(audio_sink), "query-position-support", FALSE,  NULL);
        g_object_set(G_OBJECT(audio_sink), "slave-method", 2,  NULL);
        g_object_set(G_OBJECT(audio_sink), "async", wfd_sink->ini.audio_sink_async,  NULL);
        g_object_set(G_OBJECT(audio_sink), "ts-offset", (gint64)wfd_sink->ini.sink_ts_offset, NULL);
@@ -2178,7 +2173,7 @@ static int  __mm_wfd_sink_destroy_audiobin(mm_wfd_sink_t *wfd_sink)
 static int __mm_wfd_sink_create_audiobin(mm_wfd_sink_t *wfd_sink)
 {
        MMWFDSinkGstElement *audiobin = NULL;
-       gint audio_codec = WFD_SINK_AUDIO_CODEC_NONE;
+       gint audio_codec = MM_WFD_SINK_AUDIO_CODEC_NONE;
        gboolean link_audio_dec = TRUE;
        GList *element_bucket = NULL;
        GstPad *pad = NULL;
@@ -2209,16 +2204,16 @@ static int __mm_wfd_sink_create_audiobin(mm_wfd_sink_t *wfd_sink)
 
        /* check audio decoder could be linked or not */
        switch (wfd_sink->stream_info.audio_stream_info.codec) {
-               case WFD_SINK_AUDIO_CODEC_AAC:
+               case MM_WFD_SINK_AUDIO_CODEC_AAC:
                        audio_codec = WFD_AUDIO_AAC;
                        break;
-               case WFD_SINK_AUDIO_CODEC_AC3:
+               case MM_WFD_SINK_AUDIO_CODEC_AC3:
                        audio_codec = WFD_AUDIO_AC3;
                        break;
-               case WFD_SINK_AUDIO_CODEC_LPCM:
+               case MM_WFD_SINK_AUDIO_CODEC_LPCM:
                        audio_codec = WFD_AUDIO_LPCM;
                        break;
-               case WFD_SINK_AUDIO_CODEC_NONE:
+               case MM_WFD_SINK_AUDIO_CODEC_NONE:
                default:
                        wfd_sink_debug("audio decoder could NOT be linked now, just prepare.\n");
                        audio_codec = wfd_sink->ini.audio_codec;
@@ -2289,7 +2284,7 @@ static int __mm_wfd_sink_create_audiobin(mm_wfd_sink_t *wfd_sink)
                        caps = gst_caps_new_simple("audio/x-raw",
                                                   "rate", G_TYPE_INT, 48000,
                                                   "channels", G_TYPE_INT, 2,
-                                                  "format", G_TYPE_STRING, "S16LE", NULL);
+                                                  "format", G_TYPE_STRING, "S16BE", NULL);
 
                        g_object_set(G_OBJECT(audiobin[WFD_SINK_A_LPCM_FILTER].gst), "caps", caps, NULL);
                        gst_object_unref(GST_OBJECT(caps));
@@ -2438,6 +2433,43 @@ CREATE_ERROR:
        return MM_ERROR_WFD_INTERNAL;
 }
 
+int __mm_wfd_sink_link_videobin(mm_wfd_sink_t *wfd_sink)
+{
+       MMWFDSinkGstElement     *videobin = NULL;
+
+       wfd_sink_debug_fenter();
+
+       wfd_sink_return_val_if_fail(wfd_sink &&
+                                   wfd_sink->pipeline &&
+                                   wfd_sink->pipeline->videobin &&
+                                   wfd_sink->pipeline->videobin[WFD_SINK_V_BIN].gst,
+                                   MM_ERROR_WFD_NOT_INITIALIZED);
+
+       if (wfd_sink->video_bin_is_linked) {
+               wfd_sink_debug("videobin is already linked... nothing to do\n");
+               return MM_ERROR_NONE;
+       }
+
+       /* take videobin */
+       videobin = wfd_sink->pipeline->videobin;
+
+       if (videobin[WFD_SINK_V_CAPSSETTER].gst) {
+               GstCaps *caps = NULL;
+               caps = gst_caps_new_simple("video/x-h264",
+                                          "width", G_TYPE_INT, wfd_sink->stream_info.video_stream_info.width,
+                                          "height", G_TYPE_INT, wfd_sink->stream_info.video_stream_info.height,
+                                          "framerate", GST_TYPE_FRACTION, wfd_sink->stream_info.video_stream_info.frame_rate, 1, NULL);
+               g_object_set(G_OBJECT(videobin[WFD_SINK_V_CAPSSETTER].gst), "caps", caps, NULL);
+               gst_object_unref(GST_OBJECT(caps));
+       }
+
+       wfd_sink->video_bin_is_linked = TRUE;
+
+       wfd_sink_debug_fleave();
+
+       return MM_ERROR_NONE;
+}
+
 static int __mm_wfd_sink_prepare_videodec(mm_wfd_sink_t *wfd_sink, GstElement *video_dec)
 {
        wfd_sink_debug_fenter();
@@ -2446,8 +2478,6 @@ static int __mm_wfd_sink_prepare_videodec(mm_wfd_sink_t *wfd_sink, GstElement *v
        wfd_sink_return_val_if_fail(video_dec, MM_ERROR_WFD_INVALID_ARGUMENT);
        wfd_sink_return_val_if_fail(wfd_sink && wfd_sink->attrs, MM_ERROR_WFD_NOT_INITIALIZED);
 
-       g_object_set(G_OBJECT(video_dec), "error-concealment", TRUE, NULL);
-
        wfd_sink_debug_fleave();
 
        return MM_ERROR_NONE;
@@ -2512,6 +2542,11 @@ static int __mm_wfd_sink_prepare_videosink(mm_wfd_sink_t *wfd_sink, GstElement *
                                return MM_ERROR_WFD_INTERNAL;
                        }
                        break;
+               default: {
+                               wfd_sink_error("Not Supported Surface.(default case)");
+                               return MM_ERROR_WFD_INTERNAL;
+                       }
+                       break;
        }
 
        g_object_set(G_OBJECT(video_sink), "qos", FALSE, NULL);
@@ -2640,8 +2675,11 @@ static int __mm_wfd_sink_create_videobin(mm_wfd_sink_t *wfd_sink)
        MMWFDSINK_CREATE_ELEMENT(videobin, WFD_SINK_V_PARSE, wfd_sink->ini.name_of_video_parser, "video_parser", TRUE);
        MMWFDSINK_PAD_PROBE(wfd_sink, NULL, videobin[WFD_SINK_V_PARSE].gst,  "sink");
        MMWFDSINK_PAD_PROBE(wfd_sink, NULL, videobin[WFD_SINK_V_PARSE].gst,  "src");
-       if (videobin[WFD_SINK_V_PARSE].gst)
-               g_object_set(G_OBJECT(videobin[WFD_SINK_V_PARSE].gst), "wfd-mode", TRUE, NULL);
+
+       /* create capssetter */
+       MMWFDSINK_CREATE_ELEMENT(videobin, WFD_SINK_V_CAPSSETTER, wfd_sink->ini.name_of_video_capssetter, "video_capssetter", TRUE);
+       MMWFDSINK_PAD_PROBE(wfd_sink, NULL, videobin[WFD_SINK_V_CAPSSETTER].gst,  "sink");
+       MMWFDSINK_PAD_PROBE(wfd_sink, NULL, videobin[WFD_SINK_V_CAPSSETTER].gst,  "src");
 
        /* create dec */
        MMWFDSINK_CREATE_ELEMENT(videobin, WFD_SINK_V_DEC, wfd_sink->ini.name_of_video_decoder, "video_dec", TRUE);
@@ -2654,6 +2692,24 @@ static int __mm_wfd_sink_create_videobin(mm_wfd_sink_t *wfd_sink)
                }
        }
 
+       /* create convert */
+       MMWFDSINK_CREATE_ELEMENT(videobin, WFD_SINK_V_CONVERT, wfd_sink->ini.name_of_video_converter, "video_convert", TRUE);
+       MMWFDSINK_PAD_PROBE(wfd_sink, NULL, videobin[WFD_SINK_V_CONVERT].gst,  "sink");
+       MMWFDSINK_PAD_PROBE(wfd_sink, NULL, videobin[WFD_SINK_V_CONVERT].gst,  "src");
+
+       /* create filter */
+       MMWFDSINK_CREATE_ELEMENT(videobin, WFD_SINK_V_CAPSFILTER, wfd_sink->ini.name_of_video_filter, "video_filter", TRUE);
+       MMWFDSINK_PAD_PROBE(wfd_sink, NULL, videobin[WFD_SINK_V_CAPSFILTER].gst,  "sink");
+       MMWFDSINK_PAD_PROBE(wfd_sink, NULL, videobin[WFD_SINK_V_CAPSFILTER].gst,  "src");
+       if (videobin[WFD_SINK_V_CAPSFILTER].gst) {
+               GstCaps *caps = NULL;
+               caps = gst_caps_new_simple("video/x-raw",
+                                          "format", G_TYPE_STRING, "SN12", NULL);
+               g_object_set(G_OBJECT(videobin[WFD_SINK_V_CAPSFILTER].gst), "caps", caps, NULL);
+               gst_object_unref(GST_OBJECT(caps));
+       }
+
+       
        /* create sink */
        MMWFDSINK_CREATE_ELEMENT(videobin, WFD_SINK_V_SINK, wfd_sink->ini.name_of_video_sink, "video_sink", TRUE);
        MMWFDSINK_PAD_PROBE(wfd_sink, NULL, videobin[WFD_SINK_V_SINK].gst,  "sink");
@@ -2704,7 +2760,6 @@ static int __mm_wfd_sink_create_videobin(mm_wfd_sink_t *wfd_sink)
 
        g_list_free(element_bucket);
 
-       wfd_sink->video_bin_is_linked = TRUE;
 
        /* take it */
        wfd_sink->pipeline->videobin = videobin;
@@ -2766,6 +2821,12 @@ static int __mm_wfd_sink_destroy_pipeline(mm_wfd_sink_t *wfd_sink)
                        MMWFDSinkGstElement *audiobin = wfd_sink->pipeline->audiobin;
                        MMWFDSinkGstElement *videobin = wfd_sink->pipeline->videobin;
 
+                       ret = gst_element_set_state(mainbin[WFD_SINK_M_PIPE].gst, GST_STATE_NULL);
+                       if (ret != GST_STATE_CHANGE_SUCCESS) {
+                               wfd_sink_error("failed to change state of mainbin to NULL\n");
+                               return MM_ERROR_WFD_INTERNAL;
+                       }
+
                        if (MM_ERROR_NONE != __mm_wfd_sink_destroy_videobin(wfd_sink)) {
                                wfd_sink_error("failed to destroy videobin\n");
                                return MM_ERROR_WFD_INTERNAL;
@@ -2776,12 +2837,6 @@ static int __mm_wfd_sink_destroy_pipeline(mm_wfd_sink_t *wfd_sink)
                                return MM_ERROR_WFD_INTERNAL;
                        }
 
-                       ret = gst_element_set_state(mainbin[WFD_SINK_M_PIPE].gst, GST_STATE_NULL);
-                       if (ret != GST_STATE_CHANGE_SUCCESS) {
-                               wfd_sink_error("failed to change state of mainbin to NULL\n");
-                               return MM_ERROR_WFD_INTERNAL;
-                       }
-
                        gst_object_unref(GST_OBJECT(mainbin[WFD_SINK_M_PIPE].gst));
 
                        MMWFDSINK_FREEIF(audiobin);
@@ -2850,6 +2905,9 @@ __mm_wfd_sink_dump_pipeline_state(mm_wfd_sink_t *wfd_sink)
                                case GST_ITERATOR_DONE:
                                        done = TRUE;
                                        break;
+                               default:
+                                       done = TRUE;
+                                       break;
                        }
                }
        }
@@ -2877,7 +2935,7 @@ __mm_wfd_sink_dump_pipeline_state(mm_wfd_sink_t *wfd_sink)
 }
 
 const gchar *
-__mm_wfds_sink_get_state_name(MMWFDSinkStateType state)
+_mm_wfds_sink_get_state_name(MMWFDSinkStateType state)
 {
        switch (state) {
                case MM_WFD_SINK_STATE_NONE:
@@ -2898,6 +2956,7 @@ __mm_wfds_sink_get_state_name(MMWFDSinkStateType state)
                        return "INVAID";
        }
 }
+
 static void __mm_wfd_sink_prepare_video_resolution(gint resolution, guint *CEA_resolution,
                                                    guint *VESA_resolution, guint *HH_resolution)
 {