video: send sw formats if can't use HW layer 21/149821/2 accepted/tizen/unified/20170914.065713 submit/tizen/20170914.015335
authorBoram Park <boram1288.park@samsung.com>
Wed, 13 Sep 2017 07:06:41 +0000 (16:06 +0900)
committerBoram Park <boram1288.park@samsung.com>
Wed, 13 Sep 2017 07:19:53 +0000 (07:19 +0000)
Change-Id: Ia298057d3a7ac0017155977a3c1079fe160f8637

src/bin/e_comp_wl_video.c

index 800e9f4..00d4715 100644 (file)
@@ -110,6 +110,15 @@ typedef struct _Tdm_Prop_Value
    tdm_value value;
 } Tdm_Prop_Value;
 
+static tbm_format sw_formats[] = {
+       TBM_FORMAT_ARGB8888,
+       TBM_FORMAT_XRGB8888,
+       TBM_FORMAT_YUV420,
+       TBM_FORMAT_YVU420,
+};
+
+#define NUM_SW_FORMAT   (sizeof(sw_formats) / sizeof(sw_formats[0]))
+
 static Eina_List *video_list = NULL;
 static Eina_List *video_layers = NULL;
 
@@ -2591,11 +2600,17 @@ _e_comp_wl_video_cb_bind(struct wl_client *client, void *data, uint32_t version,
         EINA_SAFETY_ON_NULL_RETURN(output);
 
         layer = _e_video_tdm_video_layer_get(output);
-        EINA_SAFETY_ON_NULL_RETURN(layer);
-
-        tdm_layer_get_available_formats(layer, &formats, &count);
-        for (i = 0; i < count; i++)
-          tizen_video_send_format(res, formats[i]);
+        if (layer)
+          {
+             tdm_layer_get_available_formats(layer, &formats, &count);
+             for (i = 0; i < count; i++)
+               tizen_video_send_format(res, formats[i]);
+          }
+        else
+          {
+             for (i = 0; i < NUM_SW_FORMAT; i++)
+               tizen_video_send_format(res, sw_formats[i]);
+          }
      }
 }