if (e_object_is_del(E_OBJECT(ec))) return EINA_FALSE;
if (!ec->comp_data) return EINA_FALSE;
- if (ec->comp_data->video_client)
+ if (e_client_video_hw_composition_check(ec))
return EINA_TRUE;
if (ec->comp_data->has_video_client)
/* if a leaf client is not video cliet */
if (ec->comp_data->sub.data && !ec->comp_data->sub.below_list &&
- !ec->comp_data->sub.below_list_pending && !ec->comp_data->video_client)
+ !ec->comp_data->sub.below_list_pending && !e_client_video_hw_composition_check(ec))
return EINA_TRUE;
EINA_LIST_FOREACH(ec->comp_data->sub.below_list_pending, l, subc)
ec->comp_data->layer = p_cdata->layer;
ec->comp_data->fetch.win_type = p_cdata->fetch.win_type;
ec->comp_data->fetch.layer = p_cdata->fetch.layer;
- ec->comp_data->video_client = p_cdata->video_client;
e_pixmap_cdata_set(ec->pixmap, ec->comp_data);
}
else
{
- if ((ec) && (ec->comp_data->video_client))
+ if ((ec) && (e_client_video_hw_composition_check(ec)))
{
buffer->type = E_COMP_WL_BUFFER_TYPE_VIDEO;
buffer->w = buffer->h = 1;
if (!tbm_surf)
goto err;
- if ((ec) && (ec->comp_data->video_client))
+ if ((ec) && (e_client_video_hw_composition_check(ec)))
{
buffer->type = E_COMP_WL_BUFFER_TYPE_VIDEO;
buffer->w = buffer->h = 1;
Eina_Bool maximize_pre : 1;
Eina_Bool focus_update : 1;
Eina_Bool opaque_state : 1;
- Eina_Bool video_client : 1;
Eina_Bool has_video_client : 1;
Eina_Bool never_hwc : 1; // force window not to do hwc
unsigned char accepts_focus : 1;
ec = evas_object_data_get(evas_obj, "E_Client");
- if (asprintf(&str, "%d", ec->comp_data ? ec->comp_data->video_client : 0) < 0)
+ if (asprintf(&str, "%d", ec->comp_data ? e_client_video_hw_composition_check((E_Client *)ec) : 0) < 0)
return NULL;
return str;
if (ec->comp_data->sub.below_obj)
bgrect = (Ecore_Window)ec->comp_data->sub.below_obj;
maskobj = e_comp_object_mask_has(ec->frame);
- video = (ec->comp_data->video_client) ? 1 : 0;
+ video = (e_client_video_hw_composition_check(ec)) ? 1 : 0;
if (ec->comp_data->sub.data)
stand = ec->comp_data->sub.data->stand_alone;
name = e_client_util_name_get(ec);
if (!ecv->iface->iname) \
return ret
-typedef struct _E_Client_Video E_Client_Video;
-
struct _E_Client_Video
{
/* Composite interface ( hwc planes / hwc windows / fallback ) */
E_Client_Video_Commit_Data_Release_Cb commit_data_release;
E_Client_Video_Tbm_Surface_Get_Cb tbm_surface_get;
} cb;
+
+ Eina_Bool hw_composition;
};
static void
if ((e_config->eom_enable == EINA_TRUE) && (e_eom_is_ec_external(ec)))
{
INF("Try to intialize external interface");
- iface = e_video_external_iface_create(ec);
+ iface = e_video_external_iface_create(ecv);
goto end;
}
if (hwc_pol != E_HWC_POLICY_NONE)
{
INF("Initialize the interface of the client_video for HWC mode");
- iface = e_video_hwc_iface_create(ec);
+ iface = e_video_hwc_iface_create(ecv);
}
end:
if (!iface)
{
- iface = e_video_fallback_iface_create(ec);
+ iface = e_video_fallback_iface_create(ecv);
if (!iface)
{
ERR("Failed to create 'E_Video_Comp_Iface'");
{
Eina_Bool res;
+ ecv->ec = ec;
+
res = _e_client_video_comp_iface_init(ecv, ec);
if (!res)
{
return EINA_FALSE;
}
- ecv->ec = ec;
-
E_LIST_HANDLER_APPEND(ecv->event_handlers, E_EVENT_CLIENT_ZONE_SET,
_e_client_video_cb_ec_zone_set, ecv);
E_LIST_HANDLER_APPEND(ecv->event_handlers, E_EVENT_CLIENT_REMOVE,
ecv->cb.tbm_surface_get = func;
}
+
+EINTERN Eina_Bool
+e_client_video_hw_composition_check(E_Client *ec)
+{
+ INTERNAL_DATA_GET;
+
+ if (!ecv)
+ return EINA_FALSE;
+
+ return ecv->hw_composition;
+}
+
+/* Video Internal Functions */
+EINTERN E_Client *
+e_client_video_ec_get(E_Client_Video *ecv)
+{
+ EINA_SAFETY_ON_NULL_RETURN_VAL(ecv, NULL);
+ return ecv->ec;
+}
+
+EINTERN void
+e_client_video_hw_composition_set(E_Client_Video *ecv)
+{
+ EINA_SAFETY_ON_NULL_RETURN(ecv);
+ ecv->hw_composition = EINA_TRUE;
+}
+
+EINTERN void
+e_client_video_hw_composition_unset(E_Client_Video *ecv)
+{
+ EINA_SAFETY_ON_NULL_RETURN(ecv);
+ ecv->hw_composition = EINA_FALSE;
+}
E_API Eina_Bool e_client_video_set(E_Client *ec);
E_API void e_client_video_unset(E_Client *ec);
+EINTERN Eina_Bool e_client_video_hw_composition_check(E_Client *ec);
E_API Eina_Bool e_client_video_topmost_visibility_follow(E_Client *ec);
E_API Eina_Bool e_client_video_topmost_visibility_unfollow(E_Client *ec);
(g)->output_r.w, (g)->output_r.h, (g)->output_r.x, (g)->output_r.y, \
(g)->transform
+typedef struct _E_Client_Video E_Client_Video;
typedef struct _E_Video_Comp_Iface E_Video_Comp_Iface;
struct _E_Video_Comp_Iface
};
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);
+EINTERN E_Video_Comp_Iface *e_video_hwc_iface_create(E_Client_Video *ecv);
+EINTERN E_Video_Comp_Iface *e_video_fallback_iface_create(E_Client_Video *ecv);
+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);
#endif
struct _E_Video_External
{
E_Video_Comp_Iface base;
- E_Client *ec;
+ E_Client_Video *ecv;
};
static void
E_Video_External *evs;
evs = container_of(iface, E_Video_External, base);
-
- if (!e_object_is_del(E_OBJECT(evs->ec)))
- {
- /* 'ec->comp_data' is supposed to be freed when ec is deleted. */
- evs->ec->comp_data->video_client = 0;
- }
+ e_client_video_hw_composition_unset(evs->ecv);
free(evs);
}
static void
-_e_video_external_init(E_Client *ec)
+_e_video_external_init(E_Client_Video *ecv)
{
- /* Set video_client flag so that 'e_comp_wl' can ignore it. */
- ec->comp_data->video_client = 1;
+ e_client_video_hw_composition_set(ecv);
}
EINTERN E_Video_Comp_Iface *
-e_video_external_iface_create(E_Client *ec)
+e_video_external_iface_create(E_Client_Video *ecv)
{
E_Video_External *evs;
return NULL;
}
- _e_video_external_init(ec);
+ _e_video_external_init(ecv);
- evs->ec = ec;
+ evs->ecv = ecv;
evs->base.destroy = _e_video_external_iface_destroy;
return &evs->base;
struct _E_Video_Fallback
{
E_Video_Comp_Iface base;
- E_Client *ec;
+ E_Client_Video *ecv;
};
static void
_e_video_fallback_iface_destroy(E_Video_Comp_Iface *iface)
{
E_Video_Fallback *evs;
+ E_Client *ec;
evs = container_of(iface, E_Video_Fallback, base);
/* Unset animatable lock */
- e_policy_animatable_lock(evs->ec, E_POLICY_ANIMATABLE_NEVER, 0);
+ ec = e_client_video_ec_get(evs->ecv);
+ e_policy_animatable_lock(ec, E_POLICY_ANIMATABLE_NEVER, 0);
free(evs);
}
static void
-_e_video_fallback_init(E_Client *ec)
+_e_video_fallback_init(E_Client_Video *ecv)
{
+ E_Client *ec;
+
/* software compositing */
- ec->comp_data->video_client = 0;
+ e_client_video_hw_composition_unset(ecv);
+
/* Set animatable lock */
+ ec = e_client_video_ec_get(ecv);
e_policy_animatable_lock(ec, E_POLICY_ANIMATABLE_NEVER, 1);
}
EINTERN E_Video_Comp_Iface *
-e_video_fallback_iface_create(E_Client *ec)
+e_video_fallback_iface_create(E_Client_Video *ecv)
{
E_Video_Fallback *evs;
return NULL;
}
- _e_video_fallback_init(ec);
+ _e_video_fallback_init(ecv);
- evs->ec = ec;
+ evs->ecv = ecv;
evs->base.destroy = _e_video_fallback_iface_destroy;
return &evs->base;
if (e_object_is_del(E_OBJECT(ec))) return NULL;
if (!ec->comp_data) return NULL;
- if (ec->comp_data->video_client) return ec;
+ if (e_client_video_hw_composition_check(ec)) return ec;
EINA_LIST_FOREACH(ec->comp_data->sub.below_list, l, subc)
{
}
EINTERN E_Video_Comp_Iface *
-e_video_hwc_iface_create(E_Client *ec)
+e_video_hwc_iface_create(E_Client_Video *ecv)
{
E_Video_Hwc *evh;
+ E_Client *ec;
+
+ ec = e_client_video_ec_get(ecv);
VIN("Create HWC interface", ec);
_e_video_hwc_client_event_init(evh);
+ 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;
/* This ec is a video client now. */
VIN("video client", ec);
- ec->comp_data->video_client = 1;
+ e_client_video_hw_composition_set(ecv);
return &evh->iface;
}
E_Hwc_Policy hwc_policy;
+ E_Client_Video *ecv;
E_Client *ec;
Ecore_Window window;
E_Output *e_output;