E_Video_Comp_Iface *iface;
E_Client *ec;
+ E_Zone *zone;
Eina_List *event_handlers;
}
static Eina_Bool
-_e_client_video_comp_iface_init(E_Client_Video *ecv, E_Client *ec)
+_e_client_video_comp_iface_init(E_Client_Video *ecv)
{
E_Video_Comp_Iface *iface = NULL;
E_Hwc_Policy hwc_pol;
- hwc_pol = e_zone_video_hwc_policy_get(ec->zone);
+ hwc_pol = e_zone_video_hwc_policy_get(ecv->zone);
- if ((e_config->eom_enable == EINA_TRUE) && (e_eom_is_ec_external(ec)) &&
+ if ((e_config->eom_enable == EINA_TRUE) && (e_eom_is_ec_external(ecv->ec)) &&
(hwc_pol == E_HWC_POLICY_PLANES))
{
- VIN("Try to intialize external interface", ec);
+ VIN("Try to intialize external interface", ecv->ec);
iface = e_video_external_iface_create(ecv);
goto end;
}
if (e_video_debug_display_primary_plane_value_get())
{
- VIN("Select SW Compositing mode according to configuration", ec);
+ VIN("Select SW Compositing mode according to configuration", ecv->ec);
goto end;
}
if (hwc_pol != E_HWC_POLICY_NONE)
{
- VIN("Initialize the interface of the client_video for HWC mode", ec);
+ VIN("Initialize the interface of the client_video for HWC mode", ecv->ec);
iface = e_video_hwc_iface_create(ecv);
if (iface)
e_video_hwc_render_fail_callback_set(iface, _e_client_video_cb_hwc_render_fail);
iface = e_video_fallback_iface_create(ecv);
if (!iface)
{
- VER("Failed to create 'E_Video_Comp_Iface'", ec);
+ VER("Failed to create 'E_Video_Comp_Iface'", ecv->ec);
return EINA_FALSE;
}
}
}
static Eina_Bool
+_e_client_video_cb_zone_del(void *data, int type EINA_UNUSED, void *event)
+{
+ E_Client_Video *ecv;
+ E_Event_Zone_Del *ev;
+
+ ecv = data;
+ ev = event;
+
+ if (ecv->zone != ev->zone)
+ goto end;
+
+ VIN("Zone(%p) deleted.", ecv->ec, ecv->zone);
+
+ _e_client_video_comp_iface_deinit(ecv);
+
+ ecv->zone = NULL;
+end:
+ return ECORE_CALLBACK_PASS_ON;
+}
+
+static Eina_Bool
_e_client_video_cb_ec_zone_set(void *data, int type EINA_UNUSED, void *event)
{
E_Client_Video *ecv;
if (ecv->ec != ev->ec)
goto end;
+ if (ecv->zone == ev->zone)
+ goto end;
+
+ VIN("Zone changed: old(%p) new(%p)", ecv->ec, ecv->zone, ev->zone);
+
+ ecv->zone = ev->zone;
+
_e_client_video_comp_iface_deinit(ecv);
- res = _e_client_video_comp_iface_init(ecv, ev->ec);
+ res = _e_client_video_comp_iface_init(ecv);
if (!res)
{
VER("Failed to initialize the composition interface for video", ev->ec);
Eina_Bool res;
ecv->ec = ec;
+ ecv->zone = ec->zone;
- res = _e_client_video_comp_iface_init(ecv, ec);
+ res = _e_client_video_comp_iface_init(ecv);
if (!res)
{
VER("Failed to initialize the composition interface for video", ec);
return EINA_FALSE;
}
+ E_LIST_HANDLER_APPEND(ecv->event_handlers, E_EVENT_ZONE_DEL,
+ _e_client_video_cb_zone_del, ecv);
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_VISIBILITY_CHANGE,