video: 'e_video_hwc.c' has been added to place duplicated codes for hwc operation. 02/204302/3
authorSeunghun <shiin.lee@samsung.com>
Thu, 11 Apr 2019 05:32:51 +0000 (14:32 +0900)
committerSooChan Lim <sc1.lim@samsung.com>
Tue, 23 Apr 2019 22:41:01 +0000 (22:41 +0000)
Change-Id: I2915ad50386af7a9d12ff99257bce024baab3f67

src/bin/Makefile.mk
src/bin/video/e_client_video.c
src/bin/video/e_video_internal.h
src/bin/video/e_zone_video.c
src/bin/video/iface/e_video_hwc.c [new file with mode: 0644]
src/bin/video/iface/e_video_hwc.h

index 5d7aedd..6784025 100644 (file)
@@ -223,6 +223,7 @@ src/bin/video/e_comp_wl_video_buffer.c \
 src/bin/video/e_client_video.c \
 src/bin/video/e_zone_video.c \
 src/bin/video/e_video_debug.c \
+src/bin/video/iface/e_video_hwc.c \
 src/bin/video/iface/e_video_hwc_planes.c \
 src/bin/video/iface/e_video_hwc_windows.c \
 src/bin/video/iface/e_video_external.c \
index 964dcbc..cd5caf9 100644 (file)
@@ -36,21 +36,6 @@ struct _E_Client_Video
    } cb;
 };
 
-static E_Hwc_Policy
-_e_client_video_zone_hwc_policy_get(E_Zone *zone)
-{
-   E_Output *eout;
-
-   eout = e_output_find(zone->output_id);
-   if (!eout)
-     {
-        ERR("Something wrong, couldn't find 'E_Output' from 'E_Zone'");
-        return E_HWC_POLICY_NONE;
-     }
-
-   return e_hwc_policy_get(eout->hwc);
-}
-
 static void
 _e_client_video_comp_iface_deinit(E_Client_Video *ecv)
 {
@@ -77,16 +62,11 @@ _e_client_video_comp_iface_init(E_Client_Video *ecv, E_Client *ec)
         goto end;
      }
 
-   hwc_pol = _e_client_video_zone_hwc_policy_get(ec->zone);
-   if (hwc_pol == E_HWC_POLICY_WINDOWS)
-     {
-        INF("Initialize the interface of the client_video for HWC WINDOWS mode");
-        iface = e_video_hwc_windows_iface_create(ec);;
-     }
-   else if (hwc_pol == E_HWC_POLICY_PLANES)
+   hwc_pol = e_zone_video_hwc_policy_get(ec->zone);
+   if (hwc_pol != E_HWC_POLICY_NONE)
      {
-        INF("Initialize the interface of the client_video for HWC PLANES mode");
-        iface = e_video_hwc_planes_iface_create(ec);
+        INF("Initialize the interface of the client_video for HWC mode");
+        iface = e_video_hwc_iface_create(ec);
      }
 
 end:
index 0de94d0..ea797c9 100644 (file)
@@ -60,8 +60,8 @@ struct _E_Video_Comp_Iface
    tbm_surface_h   (*tbm_surface_get)(E_Video_Comp_Iface *iface);
 };
 
-EINTERN E_Video_Comp_Iface  *e_video_hwc_planes_iface_create(E_Client *ec);
-EINTERN E_Video_Comp_Iface  *e_video_hwc_windows_iface_create(E_Client *ec);
+EINTERN E_Hwc_Policy         e_zone_video_hwc_policy_get(E_Zone *zone);
+EINTERN E_Video_Comp_Iface  *e_video_hwc_iface_create(E_Client *ec);
 EINTERN E_Video_Comp_Iface  *e_video_fallback_iface_create(E_Client *ec);
 EINTERN E_Video_Comp_Iface  *e_video_external_iface_create(E_Client *ec);
 
index af1b090..6e423f8 100644 (file)
@@ -89,3 +89,18 @@ end:
 
    return EINA_TRUE;
 }
+
+EINTERN E_Hwc_Policy
+e_zone_video_hwc_policy_get(E_Zone *zone)
+{
+   E_Output *eout;
+
+   eout = e_output_find(zone->output_id);
+   if (!eout)
+     {
+        ERR("Something wrong, couldn't find 'E_Output' from 'E_Zone'");
+        return E_HWC_POLICY_NONE;
+     }
+
+   return e_hwc_policy_get(eout->hwc);
+}
diff --git a/src/bin/video/iface/e_video_hwc.c b/src/bin/video/iface/e_video_hwc.c
new file mode 100644 (file)
index 0000000..efb388a
--- /dev/null
@@ -0,0 +1,23 @@
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include "e_video_internal.h"
+#include "e_video_hwc.h"
+
+EINTERN E_Video_Comp_Iface *
+e_video_hwc_iface_create(E_Client *ec)
+{
+   E_Video_Comp_Iface *iface = NULL;
+   E_Hwc_Policy hwc_pol;
+
+   VIN("Create HWC interface", ec);
+
+   hwc_pol = e_zone_video_hwc_policy_get(ec->zone);
+   if (hwc_pol == E_HWC_POLICY_PLANES)
+     iface = e_video_hwc_planes_iface_create(ec);
+   else if (hwc_pol == E_HWC_POLICY_WINDOWS)
+     iface = e_video_hwc_windows_iface_create(ec);
+
+   return iface;
+}
index 8eb1842..62964cf 100644 (file)
@@ -1,10 +1,15 @@
 #ifndef _E_VIDEO_HWC_H_
 #define _E_VIDEO_HWC_H_
 
+#include "e_video_internal.h"
+
 #define BUFFER_MAX_COUNT   5
 
 #ifndef CLEAR
 #define CLEAR(x) memset(&(x), 0, sizeof(x))
 #endif
 
+EINTERN E_Video_Comp_Iface  *e_video_hwc_planes_iface_create(E_Client *ec);
+EINTERN E_Video_Comp_Iface  *e_video_hwc_windows_iface_create(E_Client *ec);
+
 #endif