waylandsink : Add S420(I420 tbm zero copy) video format. 50/102950/2 accepted/tizen/common/20161214.160333 accepted/tizen/ivi/20161214.015240 accepted/tizen/mobile/20161214.014643 accepted/tizen/tv/20161214.015011 accepted/tizen/wearable/20161214.015157 submit/tizen/20161213.083228
authorHyunil <hyunil46.park@samsung.com>
Wed, 7 Dec 2016 01:46:10 +0000 (10:46 +0900)
committerHyunil <hyunil46.park@samsung.com>
Wed, 7 Dec 2016 06:28:04 +0000 (15:28 +0900)
Change-Id: Iba1eca7cb743bee38eb76d109ce25af0274d1c6c
Signed-off-by: Hyunil <hyunil46.park@samsung.com>
ext/wayland/gstwaylandsink.c
ext/wayland/tizen-wlvideoformat.c

index 1e42ec2..2a82cc4 100755 (executable)
@@ -1389,9 +1389,9 @@ gst_wayland_sink_get_caps (GstBaseSink * bsink, GstCaps * filter)
         tbm_fmt = g_array_index (formats, uint32_t, i);
         g_value_set_string (&value, gst_wl_tbm_format_to_string (tbm_fmt));
         gst_value_list_append_value (&list, &value);
-        /* TBM doesn't support SN12 and ST12. So we add SN12 and ST12 manually as supported format.
-         * SN12 is same with NV12, ST12 is same with NV12MT
-         */
+
+        /* TBM doesn't support Native formats(SN12, ST12, SR32 and S420),
+           So we add Native formats manually as supported format. */
         if (tbm_fmt == TBM_FORMAT_NV12) {
           g_value_set_string (&value,
               gst_video_format_to_string (GST_VIDEO_FORMAT_SN12));
@@ -1404,6 +1404,10 @@ gst_wayland_sink_get_caps (GstBaseSink * bsink, GstCaps * filter)
           g_value_set_string (&value,
               gst_video_format_to_string (GST_VIDEO_FORMAT_SR32));
           gst_value_list_append_value (&list, &value);
+        } else if (tbm_fmt == TBM_FORMAT_YUV420) {
+          g_value_set_string (&value,
+              gst_video_format_to_string (GST_VIDEO_FORMAT_S420));
+          gst_value_list_append_value (&list, &value);
         }
       } else {                  /* USE SHM */
         fmt = g_array_index (formats, uint32_t, i);
@@ -1518,7 +1522,8 @@ gst_wayland_sink_set_caps (GstBaseSink * bsink, GstCaps * caps)
   if (sink->USE_TBM) {
     if (GST_VIDEO_INFO_FORMAT (&info) == GST_VIDEO_FORMAT_SN12 ||
         GST_VIDEO_INFO_FORMAT (&info) == GST_VIDEO_FORMAT_ST12 ||
-        GST_VIDEO_INFO_FORMAT (&info) == GST_VIDEO_FORMAT_SR32) {
+        GST_VIDEO_INFO_FORMAT (&info) == GST_VIDEO_FORMAT_SR32 ||
+        GST_VIDEO_INFO_FORMAT (&info) == GST_VIDEO_FORMAT_S420) {
       sink->display->is_native_format = TRUE;
 
       /* store the video info */
index a9dc147..b38a8b9 100644 (file)
@@ -46,7 +46,7 @@ static const wl_TbmVideoFormat tbm_formats[] = {
   {TBM_FORMAT_ABGR8888, GST_VIDEO_FORMAT_RGBA},
   {TBM_FORMAT_RGBA8888, GST_VIDEO_FORMAT_RGBA},
   {TBM_FORMAT_BGRA8888, GST_VIDEO_FORMAT_BGRA},
-  {TBM_FORMAT_BGRA8888, GST_VIDEO_FORMAT_SR32}
+  {TBM_FORMAT_BGRA8888, GST_VIDEO_FORMAT_SR32},
 #else
   {TBM_FORMAT_XRGB8888, GST_VIDEO_FORMAT_BGRx},
   {TBM_FORMAT_XBGR8888, GST_VIDEO_FORMAT_RGBx},
@@ -78,6 +78,7 @@ static const wl_TbmVideoFormat tbm_formats[] = {
   {TBM_FORMAT_YUV444, GST_VIDEO_FORMAT_v308},
   {TBM_FORMAT_NV12MT, GST_VIDEO_FORMAT_ST12},
   {TBM_FORMAT_NV12, GST_VIDEO_FORMAT_SN12},
+  {TBM_FORMAT_YUV420, GST_VIDEO_FORMAT_S420}
 };
 
 uint32_t