if (_e_video_hwc_can_commit(evh))
{
- if (evh->hwc_policy == E_HWC_POLICY_PLANES)
- displaying_buffer = e_video_hwc_planes_displaying_buffer_get(evh);
- else
- displaying_buffer = e_video_hwc_windows_displaying_buffer_get(evh);
+ displaying_buffer = evh->backend.displaying_buffer_get(evh);
EINA_LIST_FOREACH(evh->committed_list, l, vbuf)
{
_e_video_hwc_wait_buffer_commit(E_Video_Hwc *evh)
{
E_Comp_Wl_Video_Buf *vbuf;
- Eina_Bool res;
vbuf = _e_video_hwc_buffer_dequeue(evh);
if (!vbuf)
return;
- if (evh->hwc_policy == E_HWC_POLICY_PLANES)
- res = e_video_hwc_planes_commit_available_check(evh);
- else
- res = e_video_hwc_windows_commit_available_check(evh);
-
- if (!res)
+ if (!evh->backend.commit_available_check(evh))
return;
_e_video_hwc_buffer_commit(evh, vbuf);
static void
_e_video_hwc_buffer_commit(E_Video_Hwc *evh, E_Comp_Wl_Video_Buf *vbuf)
{
- Eina_Bool res;
-
evh->committed_list = eina_list_append(evh->committed_list, vbuf);
if (!_e_video_hwc_can_commit(evh))
goto no_commit;
- if (evh->hwc_policy == E_HWC_POLICY_PLANES)
- res = e_video_hwc_planes_buffer_commit(evh, vbuf);
- else
- res = e_video_hwc_windows_buffer_commit(evh, vbuf);
-
- if (!res)
+ if (!evh->backend.buffer_commit(evh, vbuf))
goto no_commit;
return;
static void
_e_video_hwc_buffer_show(E_Video_Hwc *evh, E_Comp_Wl_Video_Buf *vbuf, unsigned int transform)
{
- Eina_Bool res;
-
vbuf->content_t = transform;
e_comp_wl_video_buffer_set_use(vbuf, EINA_TRUE);
if (vbuf->comp_buffer)
e_comp_wl_buffer_reference(&vbuf->buffer_ref, vbuf->comp_buffer);
- if (evh->hwc_policy == E_HWC_POLICY_PLANES)
- res = e_video_hwc_planes_commit_available_check(evh);
- else
- res = e_video_hwc_windows_commit_available_check(evh);
-
- if (!res)
+ if (!evh->backend.commit_available_check(evh))
{
_e_video_hwc_buffer_enqueue(evh, vbuf);
return;
}
if (need_hide)
- {
- if (evh->hwc_policy == E_HWC_POLICY_PLANES)
- e_video_hwc_planes_buffer_commit(evh, NULL);
- else
- e_video_hwc_windows_buffer_commit(evh, NULL);
- }
+ evh->backend.buffer_commit(evh, NULL);
}
static E_Comp_Wl_Video_Buf *
E_Comp_Wl_Video_Buf *vbuf;
if (evh->current_fb || evh->committed_list)
- {
- if (evh->hwc_policy == E_HWC_POLICY_PLANES)
- e_video_hwc_planes_buffer_commit(evh, NULL);
- else
- e_video_hwc_windows_buffer_commit(evh, NULL);
- }
+ evh->backend.buffer_commit(evh, NULL);
if (evh->current_fb)
{
E_Comp_Wl_Video_Buf *pp_buffer = NULL;
E_Comp_Wl_Video_Buf *input_buffer = NULL;
E_Client *topmost;
- Eina_Bool res;
EINA_SAFETY_ON_NULL_RETURN(evh->ec);
_e_video_hwc_input_buffer_valid((E_Video_Hwc *)evh, comp_buffer);
- if (evh->hwc_policy == E_HWC_POLICY_PLANES)
- res = e_video_hwc_planes_check_if_pp_needed(evh);
- else
- res = e_video_hwc_windows_check_if_pp_needed(evh);
-
- if (!res)
+ if (!evh->backend.check_if_pp_needed(evh))
{
/* 1. non converting case */
input_buffer = _e_video_hwc_input_buffer_get(evh, comp_buffer, EINA_TRUE);
if (evh->pp)
tdm_pp_destroy(evh->pp);
- evh->backend.destroy(&evh->backend);
+ evh->backend.destroy(evh);
}
static Eina_Bool
{
IFACE_ENTRY;
- if (evh->backend.property_get)
- return evh->backend.property_get(&evh->backend, id, value);
- return EINA_FALSE;
+ return evh->backend.property_get(evh, id, value);
}
static Eina_Bool
{
IFACE_ENTRY;
- if (evh->backend.property_set)
- return evh->backend.property_set(&evh->backend, id, value);
- return EINA_FALSE;
+ return evh->backend.property_set(evh, id, value);
}
static Eina_Bool
{
IFACE_ENTRY;
- if (evh->backend.property_delay_set)
- return evh->backend.property_delay_set(&evh->backend, id, value);
- return EINA_FALSE;
+ if (evh->hwc_policy != E_HWC_POLICY_PLANES)
+ return EINA_FALSE;
+ return e_video_hwc_planes_property_delay_set(evh, id, value);
}
static Eina_Bool
{
IFACE_ENTRY;
- if (evh->backend.available_properties_get)
- return evh->backend.available_properties_get(&evh->backend, props, count);
- return EINA_FALSE;
+ return evh->backend.available_properties_get(evh, props, count);
}
static Eina_Bool
{
IFACE_ENTRY;
- if (evh->backend.info_get)
- return evh->backend.info_get(&evh->backend, info);
- return EINA_FALSE;
+ if (evh->hwc_policy != E_HWC_POLICY_WINDOWS)
+ return EINA_FALSE;
+ return e_video_hwc_windows_info_get(evh, info);
}
static Eina_Bool
{
IFACE_ENTRY;
- if (evh->backend.commit_data_release)
- return evh->backend.commit_data_release(&evh->backend, sequence, tv_sec, tv_usec);
- return EINA_FALSE;
+ if (evh->hwc_policy != E_HWC_POLICY_WINDOWS)
+ return EINA_FALSE;
+ return e_video_hwc_windows_commit_data_release(evh, sequence, tv_sec, tv_usec);
}
static tbm_surface_h
{
IFACE_ENTRY;
- if (evh->backend.tbm_surface_get)
- return evh->backend.tbm_surface_get(&evh->backend);
- return NULL;
+ if (evh->hwc_policy != E_HWC_POLICY_WINDOWS)
+ return NULL;
+ return e_video_hwc_windows_tbm_surface_get(evh);
}
static E_Video_Hwc *
#endif
typedef struct _E_Video_Hwc E_Video_Hwc;
+typedef struct _E_Video_Hwc_Iface E_Video_Hwc_Iface;
typedef struct _E_Video_Hwc_Geometry E_Video_Hwc_Geometry;
+struct _E_Video_Hwc_Iface
+{
+ void (*destroy)(E_Video_Hwc *evh);
+ Eina_Bool (*property_get)(E_Video_Hwc *evh, unsigned int id, tdm_value *value);
+ Eina_Bool (*property_set)(E_Video_Hwc *evh, unsigned int id, tdm_value value);
+ Eina_Bool (*available_properties_get)(E_Video_Hwc *evh, const tdm_prop **props, int *count);
+ Eina_Bool (*buffer_commit)(E_Video_Hwc *evh, E_Comp_Wl_Video_Buf *vbuf);
+ Eina_Bool (*check_if_pp_needed)(E_Video_Hwc *evh);
+ Eina_Bool (*commit_available_check)(E_Video_Hwc *evh);
+ tbm_surface_h (*displaying_buffer_get)(E_Video_Hwc *evh);
+};
+
struct _E_Video_Hwc_Geometry
{
int input_w, input_h; /* input buffer's size */
struct _E_Video_Hwc
{
E_Video_Comp_Iface iface;
+ E_Video_Hwc_Iface backend;
E_Hwc_Policy hwc_policy;
- /* FIXME: Workaround */
- E_Video_Comp_Iface backend;
E_Client *ec;
Ecore_Window window;
Eina_Bool allowed_attribute;
};
-EINTERN E_Video_Hwc *e_video_hwc_planes_create(E_Output *output, E_Client *ec);
-EINTERN Eina_Bool e_video_hwc_planes_buffer_commit(E_Video_Hwc *evh, E_Comp_Wl_Video_Buf *vbuf);
-EINTERN Eina_Bool e_video_hwc_planes_check_if_pp_needed(E_Video_Hwc *evh);
-EINTERN Eina_Bool e_video_hwc_planes_properties_commit(E_Video_Hwc *evh);
-EINTERN Eina_Bool e_video_hwc_planes_commit_available_check(E_Video_Hwc *evh);
-EINTERN tbm_surface_h e_video_hwc_planes_displaying_buffer_get(E_Video_Hwc *evh);
-
-EINTERN E_Video_Hwc *e_video_hwc_windows_create(E_Output *output, E_Client *ec);
-EINTERN Eina_Bool e_video_hwc_windows_buffer_commit(E_Video_Hwc *evh, E_Comp_Wl_Video_Buf *vbuf);
-EINTERN Eina_Bool e_video_hwc_windows_check_if_pp_needed(E_Video_Hwc *evh);
-EINTERN Eina_Bool e_video_hwc_windows_commit_available_check(E_Video_Hwc *evh);
-EINTERN tbm_surface_h e_video_hwc_windows_displaying_buffer_get(E_Video_Hwc *evh);
-
+/* Functions for HWC */
EINTERN void e_video_hwc_show(E_Video_Hwc *evh);
EINTERN void e_video_hwc_wait_buffer_commit(E_Video_Hwc *evh);
EINTERN void e_video_hwc_client_mask_update(E_Video_Hwc *evh);
EINTERN Eina_Bool e_video_hwc_current_fb_update(E_Video_Hwc *evh);
-
EINTERN E_Client *e_video_hwc_client_offscreen_parent_get(E_Client *ec);
+/* Functions for HWC Planes */
+EINTERN E_Video_Hwc *e_video_hwc_planes_create(E_Output *output, E_Client *ec);
+EINTERN Eina_Bool e_video_hwc_planes_properties_commit(E_Video_Hwc *evh);
+EINTERN Eina_Bool e_video_hwc_planes_property_delay_set(E_Video_Hwc *evh, unsigned int id, tdm_value value);
+
+/* Functions for HWC Windows */
+EINTERN E_Video_Hwc *e_video_hwc_windows_create(E_Output *output, E_Client *ec);
+EINTERN Eina_Bool e_video_hwc_windows_info_get(E_Video_Hwc *evh, E_Client_Video_Info *info);
+EINTERN Eina_Bool e_video_hwc_windows_commit_data_release(E_Video_Hwc *evh, unsigned int sequence, unsigned int tv_sec, unsigned int tv_usec);
+EINTERN tbm_surface_h e_video_hwc_windows_tbm_surface_get(E_Video_Hwc *evh);
+
#endif
#define CHECKING_PRIMARY_ZPOS
-#define IFACE_ENTRY \
- E_Video_Hwc_Planes *evhp; \
- evhp = container_of(iface, E_Video_Hwc_Planes, base.backend)
-
typedef struct _E_Video_Hwc_Planes E_Video_Hwc_Planes;
typedef struct _E_Video_Info_Layer E_Video_Info_Layer;
VWR("no available layer for evhp", NULL);
return EINA_FALSE;
}
+
_e_video_hwc_planes_tdm_layer_usable_set(layer, EINA_FALSE);
ret = tdm_layer_get_zpos(layer, &zpos);
}
static void
-_e_video_hwc_planes_iface_destroy(E_Video_Comp_Iface *iface)
+_e_video_hwc_planes_iface_destroy(E_Video_Hwc *evh)
{
- IFACE_ENTRY;
+ E_Video_Hwc_Planes *evhp;
+ evhp = (E_Video_Hwc_Planes *)evh;
_e_video_hwc_planes_ec_event_deinit(evhp);
_e_video_hwc_planes_destroy(evhp);
}
static Eina_Bool
-_e_video_hwc_planes_iface_property_get(E_Video_Comp_Iface *iface, unsigned int id, tdm_value *value)
+_e_video_hwc_planes_iface_property_get(E_Video_Hwc *evh, unsigned int id, tdm_value *value)
{
+ E_Video_Hwc_Planes *evhp;
tdm_error ret;
- IFACE_ENTRY;
-
+ evhp = (E_Video_Hwc_Planes *)evh;
ret = _tdm_layer_property_get(evhp->tdm.layer, id, value);
if (ret != TDM_ERROR_NONE)
return EINA_FALSE;
}
static Eina_Bool
-_e_video_hwc_planes_iface_property_set(E_Video_Comp_Iface *iface, unsigned int id, tdm_value value)
+_e_video_hwc_planes_iface_property_set(E_Video_Hwc *evh, unsigned int id, tdm_value value)
{
+ E_Video_Hwc_Planes *evhp;
Tdm_Prop_Value prop;
const char *name;
- IFACE_ENTRY;
-
+ evhp = (E_Video_Hwc_Planes *)evh;
VIN("set layer: set_attribute", evhp->base.ec);
name = _e_video_hwc_planes_prop_name_get_by_id(evhp, id);
}
static Eina_Bool
-_e_video_hwc_planes_iface_property_delay_set(E_Video_Comp_Iface *iface, unsigned int id, tdm_value value)
-{
- const char *name;
-
- IFACE_ENTRY;
-
- name = _e_video_hwc_planes_prop_name_get_by_id(evhp, id);
-
- _e_video_hwc_planes_property_post_set(evhp, id, name, value);
-
- return EINA_TRUE;
-}
-
-static Eina_Bool
-_e_video_hwc_planes_iface_available_properties_get(E_Video_Comp_Iface *iface, const tdm_prop **props, int *count)
+_e_video_hwc_planes_iface_available_properties_get(E_Video_Hwc *evh, const tdm_prop **props, int *count)
{
+ E_Video_Hwc_Planes *evhp;
tdm_error ret;
- IFACE_ENTRY;
-
+ evhp = (E_Video_Hwc_Planes *)evh;
ret = _e_video_hwc_planes_available_properties_get(evhp, props, count);
if (ret != TDM_ERROR_NONE)
return EINA_FALSE;
return EINA_TRUE;
}
-EINTERN E_Video_Hwc *
-e_video_hwc_planes_create(E_Output *output, E_Client *ec)
-{
- E_Video_Hwc_Planes *evhp;
-
- EINA_SAFETY_ON_NULL_RETURN_VAL(output, NULL);
- EINA_SAFETY_ON_NULL_RETURN_VAL(ec, NULL);
-
- VIN("Create HWC Planes backend", ec);
-
- evhp = E_NEW(E_Video_Hwc_Planes, 1);
- EINA_SAFETY_ON_NULL_RETURN_VAL(evhp, NULL);
-
- evhp->base.e_output = output;
- evhp->tdm.output = output->toutput;
-
- if (!_e_video_hwc_planes_init(evhp, output))
- {
- ERR("Failed to init 'E_Video_Hwc_Planes'");
- free(evhp);
- return NULL;
- }
-
- _e_video_hwc_planes_ec_event_init(evhp);
-
- evhp->base.backend.destroy = _e_video_hwc_planes_iface_destroy;
- evhp->base.backend.property_get = _e_video_hwc_planes_iface_property_get;
- evhp->base.backend.property_set = _e_video_hwc_planes_iface_property_set;
- evhp->base.backend.property_delay_set = _e_video_hwc_planes_iface_property_delay_set;
- evhp->base.backend.available_properties_get = _e_video_hwc_planes_iface_available_properties_get;
- evhp->base.backend.info_get = NULL;
- evhp->base.backend.commit_data_release = NULL;
- evhp->base.backend.tbm_surface_get = NULL;
-
- return (E_Video_Hwc *)evhp;
-}
-
-EINTERN Eina_Bool
-e_video_hwc_planes_properties_commit(E_Video_Hwc *evh)
-{
- E_Video_Hwc_Planes *evhp;
-
- evhp = (E_Video_Hwc_Planes *)evh;
-
- /* FIXME: Is it really necessary? */
- if (evhp->tdm.layer)
- return EINA_TRUE;
-
- VIN("set layer: show", evhp->base.ec);
- if (!_e_video_hwc_planes_tdm_layer_set(evhp))
- {
- VER("set layer failed", evhp->base.ec);
- return EINA_FALSE;
- }
-
- _tdm_layer_property_list_set(evhp->tdm.layer, evhp->tdm.prop_list);
-
- return EINA_TRUE;
-}
-
-EINTERN tbm_surface_h
-e_video_hwc_planes_displaying_buffer_get(E_Video_Hwc *evh)
-{
- E_Video_Hwc_Planes *evhp;
-
- evhp = (E_Video_Hwc_Planes *)evh;
- return _tdm_layer_displaying_buffer_get(evhp->tdm.layer, NULL);
-}
-
-EINTERN Eina_Bool
-e_video_hwc_planes_buffer_commit(E_Video_Hwc *evh, E_Comp_Wl_Video_Buf *vbuf)
+static Eina_Bool
+_e_video_hwc_planes_iface_buffer_commit(E_Video_Hwc *evh, E_Comp_Wl_Video_Buf *vbuf)
{
E_Video_Hwc_Planes *evhp;
return _e_video_hwc_planes_buffer_commit(evhp, vbuf);
}
-EINTERN Eina_Bool
-e_video_hwc_planes_check_if_pp_needed(E_Video_Hwc *evh)
+static Eina_Bool
+_e_video_hwc_planes_iface_check_if_pp_needed(E_Video_Hwc *evh)
{
E_Video_Hwc_Planes *evhp;
int i, count = 0;
return EINA_TRUE;
}
-EINTERN Eina_Bool
-e_video_hwc_planes_commit_available_check(E_Video_Hwc *evh)
+static Eina_Bool
+_e_video_hwc_planes_iface_commit_available_check(E_Video_Hwc *evh)
{
E_Video_Hwc_Planes *evhp;
evhp = (E_Video_Hwc_Planes *)evh;
return !(evhp->waiting_vblank || evhp->video_plane_ready_handler);
}
+
+static tbm_surface_h
+_e_video_hwc_planes_iface_displaying_buffer_get(E_Video_Hwc *evh)
+{
+ E_Video_Hwc_Planes *evhp;
+
+ evhp = (E_Video_Hwc_Planes *)evh;
+ return _tdm_layer_displaying_buffer_get(evhp->tdm.layer, NULL);
+}
+
+static void
+_e_video_hwc_planes_iface_set(E_Video_Hwc_Iface *iface)
+{
+ iface->destroy = _e_video_hwc_planes_iface_destroy;
+ iface->property_get = _e_video_hwc_planes_iface_property_get;
+ iface->property_set = _e_video_hwc_planes_iface_property_set;
+ iface->available_properties_get = _e_video_hwc_planes_iface_available_properties_get;
+ iface->buffer_commit = _e_video_hwc_planes_iface_buffer_commit;
+ iface->check_if_pp_needed = _e_video_hwc_planes_iface_check_if_pp_needed;
+ iface->commit_available_check = _e_video_hwc_planes_iface_commit_available_check;
+ iface->displaying_buffer_get = _e_video_hwc_planes_iface_displaying_buffer_get;
+}
+
+EINTERN E_Video_Hwc *
+e_video_hwc_planes_create(E_Output *output, E_Client *ec)
+{
+ E_Video_Hwc_Planes *evhp;
+
+ EINA_SAFETY_ON_NULL_RETURN_VAL(output, NULL);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(ec, NULL);
+
+ VIN("Create HWC Planes backend", ec);
+
+ evhp = E_NEW(E_Video_Hwc_Planes, 1);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(evhp, NULL);
+
+ evhp->base.e_output = output;
+ evhp->tdm.output = output->toutput;
+
+ if (!_e_video_hwc_planes_init(evhp, output))
+ {
+ ERR("Failed to init 'E_Video_Hwc_Planes'");
+ free(evhp);
+ return NULL;
+ }
+
+ _e_video_hwc_planes_ec_event_init(evhp);
+ _e_video_hwc_planes_iface_set(&evhp->base.backend);
+
+ return (E_Video_Hwc *)evhp;
+}
+
+EINTERN Eina_Bool
+e_video_hwc_planes_properties_commit(E_Video_Hwc *evh)
+{
+ E_Video_Hwc_Planes *evhp;
+
+ evhp = (E_Video_Hwc_Planes *)evh;
+
+ /* FIXME: Is it really necessary? */
+ if (evhp->tdm.layer)
+ return EINA_TRUE;
+
+ VIN("set layer: show", evhp->base.ec);
+ if (!_e_video_hwc_planes_tdm_layer_set(evhp))
+ {
+ VER("set layer failed", evhp->base.ec);
+ return EINA_FALSE;
+ }
+
+ _tdm_layer_property_list_set(evhp->tdm.layer, evhp->tdm.prop_list);
+
+ return EINA_TRUE;
+}
+
+EINTERN Eina_Bool
+e_video_hwc_planes_property_delay_set(E_Video_Hwc *evh, unsigned int id, tdm_value value)
+{
+ E_Video_Hwc_Planes *evhp;
+ const char *name;
+
+ evhp = (E_Video_Hwc_Planes *)evh;
+ name = _e_video_hwc_planes_prop_name_get_by_id(evhp, id);
+
+ _e_video_hwc_planes_property_post_set(evhp, id, name, value);
+
+ return EINA_TRUE;
+}
#include "e_video_internal.h"
#include "e_video_hwc.h"
-#define IFACE_ENTRY \
- E_Video_Hwc_Windows *evhw; \
- evhw = container_of(iface, E_Video_Hwc_Windows, base.backend)
-
typedef struct _E_Video_Hwc_Windows E_Video_Hwc_Windows;
struct _E_Video_Hwc_Windows
evhw->commit_data.info.transform);
}
-static Eina_Bool
-_e_video_frame_buffer_show(E_Video_Hwc_Windows *evhw, E_Comp_Wl_Video_Buf *vbuf)
-{
- /* show means that set the information of the buffer and the info of the hwc window */
-
- if (!vbuf) return EINA_TRUE;
-
- _e_video_hwc_windows_commit_data_set(evhw, vbuf);
-
- // TODO:: this logic move to the hwc windows after hwc commit
-#if 1
- e_video_hwc_client_mask_update((E_Video_Hwc *)evhw);
-#endif
-
- return EINA_TRUE;
-}
-
static void
_e_video_destroy(E_Video_Hwc_Windows *evhw)
{
}
static void
-_e_video_hwc_windows_iface_destroy(E_Video_Comp_Iface *iface)
+_e_video_hwc_windows_iface_destroy(E_Video_Hwc *evh)
{
- IFACE_ENTRY;
+ E_Video_Hwc_Windows *evhw;
+ evhw = (E_Video_Hwc_Windows *)evh;
_e_video_hwc_windows_ec_event_deinit(evhw);
_e_video_destroy(evhw);
}
static Eina_Bool
-_e_video_hwc_windows_iface_property_get(E_Video_Comp_Iface *iface, unsigned int id, tdm_value *value)
+_e_video_hwc_windows_iface_property_get(E_Video_Hwc *evh, unsigned int id, tdm_value *value)
{
+ E_Video_Hwc_Windows *evhw;
tdm_error ret;
- IFACE_ENTRY;
-
+ evhw = (E_Video_Hwc_Windows *)evh;
ret = tdm_hwc_window_get_property(evhw->hwc_window->thwc_window, id, value);
if (ret != TDM_ERROR_NONE)
return EINA_FALSE;
}
static Eina_Bool
-_e_video_hwc_windows_iface_property_set(E_Video_Comp_Iface *iface, unsigned int id, tdm_value value)
+_e_video_hwc_windows_iface_property_set(E_Video_Hwc *evh, unsigned int id, tdm_value value)
{
+ E_Video_Hwc_Windows *evhw;
const char *name;
- IFACE_ENTRY;
-
+ evhw = (E_Video_Hwc_Windows *)evh;
VIN("set_attribute", evhw->base.ec);
name = _e_video_hwc_windows_prop_name_get_by_id(evhw, id);
}
static Eina_Bool
-_e_video_hwc_windows_iface_available_properties_get(E_Video_Comp_Iface *iface, const tdm_prop **props, int *count)
+_e_video_hwc_windows_iface_available_properties_get(E_Video_Hwc *evh, const tdm_prop **props, int *count)
{
- IFACE_ENTRY;
+ E_Video_Hwc_Windows *evhw;
+ evhw = (E_Video_Hwc_Windows *)evh;
if (!e_hwc_windows_get_video_available_properties(evhw->hwc, props, count))
return EINA_FALSE;
}
static Eina_Bool
-_e_video_hwc_windows_iface_info_get(E_Video_Comp_Iface *iface, E_Client_Video_Info *info)
+_e_video_hwc_windows_iface_buffer_commit(E_Video_Hwc *evh, E_Comp_Wl_Video_Buf *vbuf)
{
- IFACE_ENTRY;
+ E_Video_Hwc_Windows *evhw;
- memcpy(&info->src_config, &evhw->commit_data.info.src_config, sizeof(tdm_info_config));
- memcpy(&info->dst_pos, &evhw->commit_data.info.dst_pos, sizeof(tdm_pos));
- info->transform = evhw->commit_data.info.transform;
+ evhw = (E_Video_Hwc_Windows *)evh;
+
+ /* show means that set the information of the buffer and the info of the hwc window */
+
+ if (!vbuf) return EINA_TRUE;
+
+ _e_video_hwc_windows_commit_data_set(evhw, vbuf);
+
+ // TODO:: this logic move to the hwc windows after hwc commit
+#if 1
+ e_video_hwc_client_mask_update((E_Video_Hwc *)evhw);
+#endif
return EINA_TRUE;
}
static Eina_Bool
-_e_video_hwc_windows_iface_commit_data_release(E_Video_Comp_Iface *iface, unsigned int sequence, unsigned int tv_sec, unsigned int tv_usec)
+_e_video_hwc_windows_iface_check_if_pp_needed(E_Video_Hwc *evh)
{
- E_Video_Hwc *evh;
+ E_Video_Hwc_Windows *evhw;
+ int i, count = 0;
+ const tbm_format *formats;
+ Eina_Bool found = EINA_FALSE;
+ E_Hwc *hwc;
- IFACE_ENTRY;
+ evhw = (E_Video_Hwc_Windows *)evh;
+ hwc = evhw->hwc;
+ if (hwc->tdm_hwc_video_stream)
+ return EINA_FALSE;
- evhw->commit_data.wait_release = EINA_FALSE;
+ if (!e_comp_screen_available_video_formats_get(&formats, &count))
+ return EINA_FALSE;
- evh = (E_Video_Hwc *)evhw;
- if (e_video_hwc_current_fb_update(evh))
- e_video_hwc_wait_buffer_commit(evh);
+ for (i = 0; i < count; i++)
+ if (formats[i] == evhw->base.tbmfmt)
+ {
+ found = EINA_TRUE;
+ break;
+ }
+
+ if (!found)
+ {
+ if (formats && count > 0)
+ evhw->base.pp_tbmfmt = formats[0];
+ else
+ {
+ WRN("No layer format information!!!");
+ evhw->base.pp_tbmfmt = TBM_FORMAT_ARGB8888;
+ }
+ return EINA_TRUE;
+ }
+
+ if (hwc->tdm_hwc_video_scanout)
+ goto need_pp;
+
+ /* check size */
+ if (evhw->base.geo.input_r.w != evhw->base.geo.output_r.w || evhw->base.geo.input_r.h != evhw->base.geo.output_r.h)
+ if (!hwc->tdm_hwc_video_scale)
+ goto need_pp;
+
+ /* check rotate */
+ if (evhw->base.geo.transform || e_comp->e_comp_screen->rotation > 0)
+ if (!hwc->tdm_hwc_video_transform)
+ goto need_pp;
+
+ return EINA_FALSE;
+
+need_pp:
+ evhw->base.pp_tbmfmt = evhw->base.tbmfmt;
return EINA_TRUE;
}
+static Eina_Bool
+_e_video_hwc_windows_iface_commit_available_check(E_Video_Hwc *evh)
+{
+ E_Video_Hwc_Windows *evhw;
+
+ evhw = (E_Video_Hwc_Windows *)evh;
+ return !evhw->commit_data.wait_release;
+}
+
static tbm_surface_h
-_e_video_hwc_windows_iface_tbm_surface_get(E_Video_Comp_Iface *iface)
+_e_video_hwc_windows_iface_displaying_buffer_get(E_Video_Hwc *evh)
{
- IFACE_ENTRY;
+ E_Video_Hwc_Windows *evhw;
+ evhw = (E_Video_Hwc_Windows *)evh;
return evhw->commit_data.buffer;
}
+static void
+_e_video_hwc_windows_iface_set(E_Video_Hwc_Iface *iface)
+{
+ iface->destroy = _e_video_hwc_windows_iface_destroy;
+ iface->property_get = _e_video_hwc_windows_iface_property_get;
+ iface->property_set = _e_video_hwc_windows_iface_property_set;
+ iface->available_properties_get = _e_video_hwc_windows_iface_available_properties_get;
+ iface->buffer_commit = _e_video_hwc_windows_iface_buffer_commit;
+ iface->check_if_pp_needed = _e_video_hwc_windows_iface_check_if_pp_needed;
+ iface->commit_available_check = _e_video_hwc_windows_iface_commit_available_check;
+ iface->displaying_buffer_get = _e_video_hwc_windows_iface_displaying_buffer_get;
+}
+
EINTERN E_Video_Hwc *
e_video_hwc_windows_create(E_Output *output, E_Client *ec)
{
}
_e_video_hwc_windows_ec_event_init(evhw);
-
- evhw->base.backend.destroy = _e_video_hwc_windows_iface_destroy;
- evhw->base.backend.property_get = _e_video_hwc_windows_iface_property_get;
- evhw->base.backend.property_set = _e_video_hwc_windows_iface_property_set;
- evhw->base.backend.property_delay_set = NULL;
- evhw->base.backend.available_properties_get = _e_video_hwc_windows_iface_available_properties_get;
- evhw->base.backend.info_get = _e_video_hwc_windows_iface_info_get;
- evhw->base.backend.commit_data_release = _e_video_hwc_windows_iface_commit_data_release;
- evhw->base.backend.tbm_surface_get = _e_video_hwc_windows_iface_tbm_surface_get;
+ _e_video_hwc_windows_iface_set(&evhw->base.backend);
return (E_Video_Hwc *)evhw;
}
-EINTERN tbm_surface_h
-e_video_hwc_windows_displaying_buffer_get(E_Video_Hwc *evh)
-{
- E_Video_Hwc_Windows *evhw;
-
- evhw = (E_Video_Hwc_Windows *)evh;
- return evhw->commit_data.buffer;
-}
-
EINTERN Eina_Bool
-e_video_hwc_windows_buffer_commit(E_Video_Hwc *evh, E_Comp_Wl_Video_Buf *vbuf)
+e_video_hwc_windows_info_get(E_Video_Hwc *evh, E_Client_Video_Info *info)
{
E_Video_Hwc_Windows *evhw;
evhw = (E_Video_Hwc_Windows *)evh;
- return _e_video_frame_buffer_show(evhw, vbuf);
+ memcpy(&info->src_config, &evhw->commit_data.info.src_config, sizeof(tdm_info_config));
+ memcpy(&info->dst_pos, &evhw->commit_data.info.dst_pos, sizeof(tdm_pos));
+ info->transform = evhw->commit_data.info.transform;
+
+ return EINA_TRUE;
}
EINTERN Eina_Bool
-e_video_hwc_windows_check_if_pp_needed(E_Video_Hwc *evh)
+e_video_hwc_windows_commit_data_release(E_Video_Hwc *evh, unsigned int sequence, unsigned int tv_sec, unsigned int tv_usec)
{
E_Video_Hwc_Windows *evhw;
- int i, count = 0;
- const tbm_format *formats;
- Eina_Bool found = EINA_FALSE;
- E_Hwc *hwc;
evhw = (E_Video_Hwc_Windows *)evh;
- hwc = evhw->hwc;
- if (hwc->tdm_hwc_video_stream)
- return EINA_FALSE;
-
- if (!e_comp_screen_available_video_formats_get(&formats, &count))
- return EINA_FALSE;
-
- for (i = 0; i < count; i++)
- if (formats[i] == evhw->base.tbmfmt)
- {
- found = EINA_TRUE;
- break;
- }
-
- if (!found)
- {
- if (formats && count > 0)
- evhw->base.pp_tbmfmt = formats[0];
- else
- {
- WRN("No layer format information!!!");
- evhw->base.pp_tbmfmt = TBM_FORMAT_ARGB8888;
- }
- return EINA_TRUE;
- }
-
- if (hwc->tdm_hwc_video_scanout)
- goto need_pp;
-
- /* check size */
- if (evhw->base.geo.input_r.w != evhw->base.geo.output_r.w || evhw->base.geo.input_r.h != evhw->base.geo.output_r.h)
- if (!hwc->tdm_hwc_video_scale)
- goto need_pp;
-
- /* check rotate */
- if (evhw->base.geo.transform || e_comp->e_comp_screen->rotation > 0)
- if (!hwc->tdm_hwc_video_transform)
- goto need_pp;
-
- return EINA_FALSE;
+ evhw->commit_data.wait_release = EINA_FALSE;
-need_pp:
- evhw->base.pp_tbmfmt = evhw->base.tbmfmt;
+ if (e_video_hwc_current_fb_update(evh))
+ e_video_hwc_wait_buffer_commit(evh);
return EINA_TRUE;
}
-EINTERN Eina_Bool
-e_video_hwc_windows_commit_available_check(E_Video_Hwc *evh)
+EINTERN tbm_surface_h
+e_video_hwc_windows_tbm_surface_get(E_Video_Hwc *evh)
{
E_Video_Hwc_Windows *evhw;
evhw = (E_Video_Hwc_Windows *)evh;
- return !evhw->commit_data.wait_release;
+ return evhw->commit_data.buffer;
}