video: Remove unnecessary interface for video. 62/206162/8
authorSeunghun Lee <shiin.lee@samsung.com>
Tue, 7 May 2019 07:14:27 +0000 (16:14 +0900)
committerSooChan Lim <sc1.lim@samsung.com>
Tue, 28 May 2019 10:43:52 +0000 (10:43 +0000)
'topmost_visibility_follow' and 'property_allow' interfaces are
unnecessary.

Change-Id: I48b5f3e69f9059682534c112c59da702867edc9c

src/bin/video/e_client_video.c
src/bin/video/e_video_internal.h
src/bin/video/iface/e_video_hwc.c
src/bin/video/iface/e_video_hwc.h
src/bin/video/iface/e_video_hwc_planes.c
src/bin/video/iface/e_video_hwc_windows.c

index 83c0016..08bf09e 100644 (file)
@@ -27,6 +27,8 @@ struct _E_Client_Video
    Eina_List *event_handlers;
 
    Eina_Bool hw_composition;
+   Eina_Bool follow_topmost_visibility;
+   Eina_Bool allowed_property;
 };
 
 static void
@@ -221,33 +223,45 @@ e_client_video_unset(E_Client *ec)
 E_API Eina_Bool
 e_client_video_topmost_visibility_follow(E_Client *ec)
 {
-   IFACE_CHECK_RET(follow_topmost_visibility, EINA_FALSE);
+   INTERNAL_DATA_GET;
+
+   EINA_SAFETY_ON_NULL_RETURN_VAL(ecv, EINA_FALSE);
 
-   return ecv->iface->follow_topmost_visibility(ecv->iface);
+   ecv->follow_topmost_visibility = EINA_TRUE;
+   return EINA_TRUE;
 }
 
 E_API Eina_Bool
 e_client_video_topmost_visibility_unfollow(E_Client *ec)
 {
-   IFACE_CHECK_RET(unfollow_topmost_visibility, EINA_FALSE);
+   INTERNAL_DATA_GET;
+
+   EINA_SAFETY_ON_NULL_RETURN_VAL(ecv, EINA_FALSE);
 
-   return ecv->iface->unfollow_topmost_visibility(ecv->iface);
+   ecv->follow_topmost_visibility = EINA_FALSE;
+   return EINA_TRUE;
 }
 
 EINTERN Eina_Bool
 e_client_video_property_allow(E_Client *ec)
 {
-   IFACE_CHECK_RET(allowed_property, EINA_FALSE);
+   INTERNAL_DATA_GET;
+
+   EINA_SAFETY_ON_NULL_RETURN_VAL(ecv, EINA_FALSE);
 
-   return ecv->iface->allowed_property(ecv->iface);
+   ecv->allowed_property = EINA_TRUE;
+   return EINA_TRUE;
 }
 
 EINTERN Eina_Bool
 e_client_video_property_disallow(E_Client *ec)
 {
-   IFACE_CHECK_RET(disallowed_property, EINA_FALSE);
+   INTERNAL_DATA_GET;
 
-   return ecv->iface->disallowed_property(ecv->iface);
+   EINA_SAFETY_ON_NULL_RETURN_VAL(ecv, EINA_FALSE);
+
+   ecv->allowed_property = EINA_FALSE;
+   return EINA_TRUE;
 }
 
 E_API Eina_Bool
@@ -338,3 +352,17 @@ e_client_video_hw_composition_unset(E_Client_Video *ecv)
    EINA_SAFETY_ON_NULL_RETURN(ecv);
    ecv->hw_composition = EINA_FALSE;
 }
+
+EINTERN Eina_Bool
+e_client_video_topmost_visibility_follow_get(E_Client_Video *ecv)
+{
+   EINA_SAFETY_ON_NULL_RETURN_VAL(ecv, EINA_FALSE);
+   return ecv->follow_topmost_visibility;
+}
+
+EINTERN Eina_Bool
+e_client_video_property_allow_get(E_Client_Video *ecv)
+{
+   EINA_SAFETY_ON_NULL_RETURN_VAL(ecv, EINA_FALSE);
+   return ecv->allowed_property;
+}
index 10df010..53dcf68 100644 (file)
@@ -47,10 +47,6 @@ typedef struct _E_Video_Comp_Iface E_Video_Comp_Iface;
 struct _E_Video_Comp_Iface
 {
    void            (*destroy)(E_Video_Comp_Iface *iface);
-   Eina_Bool       (*follow_topmost_visibility)(E_Video_Comp_Iface *iface);
-   Eina_Bool       (*unfollow_topmost_visibility)(E_Video_Comp_Iface *iface);
-   Eina_Bool       (*allowed_property)(E_Video_Comp_Iface *iface);
-   Eina_Bool       (*disallowed_property)(E_Video_Comp_Iface *iface);
    Eina_Bool       (*property_get)(E_Video_Comp_Iface *iface, unsigned int id, tdm_value *value);
    Eina_Bool       (*property_set)(E_Video_Comp_Iface *iface, unsigned int id, tdm_value value);
    Eina_Bool       (*property_delay_set)(E_Video_Comp_Iface *iface, unsigned int id, tdm_value value);
@@ -68,5 +64,7 @@ EINTERN E_Video_Comp_Iface  *e_video_external_iface_create(E_Client_Video *ecv);
 EINTERN E_Client            *e_client_video_ec_get(E_Client_Video *ecv);
 EINTERN void                 e_client_video_hw_composition_set(E_Client_Video *ecv);
 EINTERN void                 e_client_video_hw_composition_unset(E_Client_Video *ecv);
+EINTERN Eina_Bool            e_client_video_topmost_visibility_follow_get(E_Client_Video *ecv);
+EINTERN Eina_Bool            e_client_video_property_allow_get(E_Client_Video *ecv);
 
 #endif
index 2f9e929..faf4596 100644 (file)
@@ -1413,42 +1413,6 @@ _e_video_hwc_iface_destroy(E_Video_Comp_Iface *iface)
 }
 
 static Eina_Bool
-_e_video_hwc_iface_follow_topmost_visibility(E_Video_Comp_Iface *iface)
-{
-   IFACE_ENTRY;
-
-   evh->follow_topmost_visibility = EINA_TRUE;
-   return EINA_TRUE;
-}
-
-static Eina_Bool
-_e_video_hwc_iface_unfollow_topmost_visibility(E_Video_Comp_Iface *iface)
-{
-   IFACE_ENTRY;
-
-   evh->follow_topmost_visibility = EINA_FALSE;
-   return EINA_TRUE;
-}
-
-static Eina_Bool
-_e_video_hwc_iface_allowed_property(E_Video_Comp_Iface *iface)
-{
-   IFACE_ENTRY;
-
-   evh->allowed_attribute = EINA_TRUE;
-   return EINA_TRUE;
-}
-
-static Eina_Bool
-_e_video_hwc_iface_disallowed_property(E_Video_Comp_Iface *iface)
-{
-   IFACE_ENTRY;
-
-   evh->allowed_attribute = EINA_FALSE;
-   return EINA_TRUE;
-}
-
-static Eina_Bool
 _e_video_hwc_iface_property_get(E_Video_Comp_Iface *iface, unsigned int id, tdm_value *value)
 {
    IFACE_ENTRY;
@@ -1567,7 +1531,7 @@ _e_video_hwc_show(E_Video_Hwc *evh)
 
    /* if stand_alone is true, not show */
    if ((ec->comp_data->sub.data && ec->comp_data->sub.data->stand_alone) ||
-       (ec->comp_data->sub.data && evh->follow_topmost_visibility))
+       (ec->comp_data->sub.data && e_client_video_topmost_visibility_follow_get(evh->ecv)))
      return;
 
    /* FIXME It seems unnecessary. */
@@ -1621,10 +1585,6 @@ e_video_hwc_iface_create(E_Client_Video *ecv)
    evh->ecv = ecv;
 
    evh->iface.destroy = _e_video_hwc_iface_destroy;
-   evh->iface.follow_topmost_visibility = _e_video_hwc_iface_follow_topmost_visibility;
-   evh->iface.unfollow_topmost_visibility = _e_video_hwc_iface_unfollow_topmost_visibility;
-   evh->iface.allowed_property = _e_video_hwc_iface_allowed_property;
-   evh->iface.disallowed_property = _e_video_hwc_iface_disallowed_property;
    evh->iface.property_get = _e_video_hwc_iface_property_get;
    evh->iface.property_set = _e_video_hwc_iface_property_set;
    evh->iface.property_delay_set = _e_video_hwc_iface_property_delay_set;
index d6097c4..65ecad8 100644 (file)
@@ -86,8 +86,6 @@ struct _E_Video_Hwc
 
    Eina_Bool  cb_registered;
    Eina_Bool  need_force_render;
-   Eina_Bool  follow_topmost_visibility;
-   Eina_Bool  allowed_attribute;
 };
 
 /* Functions for HWC */
index 2b8b0ab..fe20ec7 100644 (file)
@@ -679,7 +679,7 @@ _e_video_hwc_planes_cb_topmost_client_visibility_change(void *data, int type, vo
    if (topmost != ec)
      goto end;
 
-   if (evhp->base.follow_topmost_visibility)
+   if (e_client_video_topmost_visibility_follow_get(evhp->base.ecv))
      {
         switch (ec->visibility.obscured)
           {
@@ -866,7 +866,7 @@ _e_video_hwc_planes_iface_property_set(E_Video_Hwc *evh, unsigned int id, tdm_va
          * Set property with assigning layer right away if allowed_attribute
          * flag is set. The reason why we have to do like this isn't figured
          * yet. It's for backward compatibility. */
-        if (evhp->base.allowed_attribute)
+        if (e_client_video_property_allow_get(evhp->base.ecv))
           {
              if (!_e_video_hwc_planes_tdm_layer_set(evhp))
                {
index 2abad05..50fac7c 100644 (file)
@@ -155,7 +155,7 @@ _e_video_cb_topmost_ec_visibility_change(void *data, int type, void *event)
 
    ev = event;
    evhw = data;
-   if (!evhw->base.follow_topmost_visibility)
+   if (!e_client_video_topmost_visibility_follow_get(evhw->base.ecv))
        goto end;
 
    topmost = e_comp_wl_topmost_parent_get(evhw->base.ec);
@@ -205,7 +205,7 @@ _e_video_hwc_windows_cb_hook_subsurface_create(void *data, E_Client *ec)
    E_Client *topmost1, *topmost2;
 
    evhw = data;
-   if (!evhw->base.follow_topmost_visibility)
+   if (!e_client_video_topmost_visibility_follow_get(evhw->base.ecv))
      return;
 
    /* This is to raise an 'VISIBILITY_CHANGE' event to video client when its
@@ -275,7 +275,7 @@ _e_video_hwc_windows_iface_property_set(E_Video_Hwc *evh, unsigned int id, tdm_v
       return EINA_FALSE;
    }
 
-   if (evhw->base.allowed_attribute)
+   if (e_client_video_property_allow_get(evhw->base.ecv))
      {
         VIN("set_attribute now : property(%s), value(%d)", evhw->base.ec, name, value.u32);