video: 'E_Video_Hwc' handles event of client show for HWC Planes/Windows. 94/204494/1
authorSeunghun Lee <shiin.lee@samsung.com>
Mon, 15 Apr 2019 05:37:03 +0000 (14:37 +0900)
committerSeunghun Lee <shiin.lee@samsung.com>
Wed, 24 Apr 2019 06:33:37 +0000 (15:33 +0900)
Change-Id: I40be08a43421181b63a3b8c70a30d483bbc867c4

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

index 3c9acb29e05b42ea4e3cb53ce67e39e5eed240d5..795d54d3b8a064caddd5585b1dcf1c7d11d4ad5b 100644 (file)
@@ -1218,6 +1218,44 @@ e_video_hwc_child_client_get(E_Client *ec)
    return NULL;
 }
 
+static Eina_Bool
+_e_video_hwc_cb_client_show(void *data, int type, void *event)
+{
+   E_Event_Client *ev = event;
+   E_Client *ec;
+   E_Client *video_ec = NULL;
+   E_Video_Hwc *evh = NULL;
+
+   EINA_SAFETY_ON_NULL_RETURN_VAL(ev, ECORE_CALLBACK_PASS_ON);
+   EINA_SAFETY_ON_NULL_RETURN_VAL(ev->ec, ECORE_CALLBACK_PASS_ON);
+
+   ec = ev->ec;
+   if (!ec->comp_data) return ECORE_CALLBACK_PASS_ON;
+
+   video_ec = e_video_hwc_child_client_get(ec);
+   if (!video_ec) return ECORE_CALLBACK_PASS_ON;
+
+   evh = data;
+   if (!evh) return ECORE_CALLBACK_PASS_ON;
+
+   VIN("show: find video child(0x%08"PRIxPTR")", evh->ec,
+       (Ecore_Window)e_client_util_win_get(video_ec));
+   if (evh->old_comp_buffer)
+     {
+        VIN("video already rendering..", evh->ec);
+        return ECORE_CALLBACK_PASS_ON;
+     }
+
+   if (ec == e_comp_wl_topmost_parent_get(evh->ec))
+     {
+        VIN("video need rendering..", evh->ec);
+        e_comp_wl_viewport_apply(ec);
+        _e_video_hwc_render(evh, __FUNCTION__);
+     }
+
+   return ECORE_CALLBACK_PASS_ON;
+}
+
 static Eina_Bool
 _e_video_hwc_cb_client_buffer_change(void *data, int type, void *event)
 {
@@ -1430,6 +1468,8 @@ _e_video_hwc_create(E_Client *ec)
 static void
 _e_video_hwc_client_event_init(E_Video_Hwc *evh)
 {
+   E_LIST_HANDLER_APPEND(evh->ec_event_handler, E_EVENT_CLIENT_SHOW,
+                         _e_video_hwc_cb_client_show, evh);
    E_LIST_HANDLER_APPEND(evh->ec_event_handler, E_EVENT_CLIENT_BUFFER_CHANGE,
                          _e_video_hwc_cb_client_buffer_change, evh);
 }
index c997054044c8a6c71aeaacaf2fd49d52029a86fb..0ded2735dc5f4e38f41c3a5f13be130a7170720d 100644 (file)
@@ -836,44 +836,6 @@ need_pp:
    return EINA_TRUE;
 }
 
-static Eina_Bool
-_e_video_cb_ec_client_show(void *data, int type, void *event)
-{
-   E_Event_Client *ev = event;
-   E_Client *ec;
-   E_Client *video_ec = NULL;
-   E_Video_Hwc_Planes *evhp = NULL;
-
-   EINA_SAFETY_ON_NULL_RETURN_VAL(ev, ECORE_CALLBACK_PASS_ON);
-   EINA_SAFETY_ON_NULL_RETURN_VAL(ev->ec, ECORE_CALLBACK_PASS_ON);
-
-   ec = ev->ec;
-   if (!ec->comp_data) return ECORE_CALLBACK_PASS_ON;
-
-   video_ec = e_video_hwc_child_client_get(ec);
-   if (!video_ec) return ECORE_CALLBACK_PASS_ON;
-
-   evhp = data;
-   if (!evhp) return ECORE_CALLBACK_PASS_ON;
-
-   VIN("show: find video child(0x%08"PRIxPTR")", evhp->base.ec,
-       (Ecore_Window)e_client_util_win_get(video_ec));
-   if (evhp->base.old_comp_buffer)
-     {
-        VIN("video already rendering..", evhp->base.ec);
-        return ECORE_CALLBACK_PASS_ON;
-     }
-
-   if (ec == e_comp_wl_topmost_parent_get(evhp->base.ec))
-     {
-        VIN("video need rendering..", evhp->base.ec);
-        e_comp_wl_viewport_apply(ec);
-        e_video_hwc_render((E_Video_Hwc *)evhp, __FUNCTION__);
-     }
-
-   return ECORE_CALLBACK_PASS_ON;
-}
-
 static Eina_Bool
 _e_video_cb_ec_visibility_change(void *data, int type, void *event)
 {
@@ -1220,8 +1182,6 @@ _e_video_hwc_planes_ec_event_init(E_Video_Hwc_Planes *evhp)
    evas_object_event_callback_add(ec->frame, EVAS_CALLBACK_HIDE,
                                   _e_video_cb_evas_hide, evhp);
 
-   E_LIST_HANDLER_APPEND(evhp->base.ec_event_handler, E_EVENT_CLIENT_SHOW,
-                         _e_video_cb_ec_client_show, evhp);
    E_LIST_HANDLER_APPEND(evhp->base.ec_event_handler, E_EVENT_REMOTE_SURFACE_PROVIDER_VISIBILITY_CHANGE,
                          _e_video_cb_ec_visibility_change, evhp);
    E_LIST_HANDLER_APPEND(evhp->base.ec_event_handler, E_EVENT_CLIENT_VISIBILITY_CHANGE,
index e723c9a62fae9da97037da208af85b21338bfb9f..569c0e60fd7da3470591d81de169fad0de55a3ca 100644 (file)
@@ -355,44 +355,6 @@ need_pp:
    return EINA_TRUE;
 }
 
-static Eina_Bool
-_e_video_cb_ec_client_show(void *data, int type, void *event)
-{
-   E_Event_Client *ev = event;
-   E_Client *ec;
-   E_Client *video_ec = NULL;
-   E_Video_Hwc_Windows *evhw = NULL;
-
-   EINA_SAFETY_ON_NULL_RETURN_VAL(ev, ECORE_CALLBACK_PASS_ON);
-   EINA_SAFETY_ON_NULL_RETURN_VAL(ev->ec, ECORE_CALLBACK_PASS_ON);
-
-   ec = ev->ec;
-   if (!ec->comp_data) return ECORE_CALLBACK_PASS_ON;
-
-   video_ec = e_video_hwc_child_client_get(ec);
-   if (!video_ec) return ECORE_CALLBACK_PASS_ON;
-
-   evhw = data;
-   if (!evhw) return ECORE_CALLBACK_PASS_ON;
-
-   VIN("show: find video child(0x%08"PRIxPTR")",
-       evhw->base.ec, (Ecore_Window)e_client_util_win_get(video_ec));
-   if(evhw->base.old_comp_buffer)
-     {
-        VIN("video already rendering..", evhw->base.ec);
-        return ECORE_CALLBACK_PASS_ON;
-     }
-
-   if (ec == e_comp_wl_topmost_parent_get(evhw->base.ec))
-     {
-        VIN("video need rendering..", evhw->base.ec);
-        e_comp_wl_viewport_apply(ec);
-        e_video_hwc_render((E_Video_Hwc *)evhw, __FUNCTION__);
-     }
-
-   return ECORE_CALLBACK_PASS_ON;
-}
-
 static Eina_Bool
 _e_video_cb_ec_visibility_change(void *data, int type, void *event)
 {
@@ -559,8 +521,6 @@ _e_video_hwc_windows_ec_event_init(E_Video_Hwc_Windows *evhw)
       e_comp_wl_hook_add(E_COMP_WL_HOOK_SUBSURFACE_CREATE,
                          _e_video_hwc_windows_cb_hook_subsurface_create, evhw);
 
-   E_LIST_HANDLER_APPEND(evhw->base.ec_event_handler, E_EVENT_CLIENT_SHOW,
-                         _e_video_cb_ec_client_show, evhw);
    E_LIST_HANDLER_APPEND(evhw->base.ec_event_handler, E_EVENT_REMOTE_SURFACE_PROVIDER_VISIBILITY_CHANGE,
                          _e_video_cb_ec_visibility_change, evhw);
    E_LIST_HANDLER_APPEND(evhw->base.ec_event_handler, E_EVENT_CLIENT_VISIBILITY_CHANGE,