return &evh->iface;
}
+
+static Eina_Bool
+_e_video_hwc_current_fb_update(E_Video_Hwc *evh)
+{
+ Eina_List *l;
+ E_Comp_Wl_Video_Buf *vbuf;
+ tbm_surface_h displaying_buffer;
+
+ EINA_SAFETY_ON_NULL_RETURN_VAL(evh, EINA_FALSE);
+
+ if (!evh->committed_list)
+ return EINA_FALSE;
+
+ 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);
+
+ EINA_LIST_FOREACH(evh->committed_list, l, vbuf)
+ {
+ if (vbuf->tbm_surface == displaying_buffer) break;
+ }
+ if (!vbuf)
+ return EINA_FALSE;
+ }
+ else
+ vbuf = eina_list_nth(evh->committed_list, 0);
+
+ evh->committed_list = eina_list_remove(evh->committed_list, vbuf);
+
+ /* client can attachs the same wl_buffer twice. */
+ if (evh->current_fb && VBUF_IS_VALID(evh->current_fb) && vbuf != evh->current_fb)
+ {
+ e_comp_wl_video_buffer_set_use(evh->current_fb, EINA_FALSE);
+
+ if (evh->current_fb->comp_buffer)
+ e_comp_wl_buffer_reference(&evh->current_fb->buffer_ref, NULL);
+ }
+
+ evh->current_fb = vbuf;
+
+ VDB("current_fb(%d)", evh->ec, MSTAMP(evh->current_fb));
+
+ return EINA_TRUE;
+}
+
+EINTERN Eina_Bool
+e_video_hwc_commit_done(E_Video_Hwc *evh)
+{
+ return _e_video_hwc_current_fb_update(evh);
+}
EINTERN void e_video_hwc_planes_buffer_show(E_Video_Hwc *evh, E_Comp_Wl_Video_Buf *vbuf, unsigned int transform);
EINTERN Eina_Bool e_video_hwc_planes_frame_buffer_show(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 tbm_surface_h e_video_hwc_planes_displaying_buffer_get(E_Video_Hwc *evh);
EINTERN E_Video_Hwc *e_video_hwc_windows_create(void);
EINTERN Eina_Bool e_video_hwc_windows_init(E_Video_Hwc *evh);
EINTERN void e_video_hwc_windows_buffer_show(E_Video_Hwc *evh, E_Comp_Wl_Video_Buf *vbuf, unsigned int transform);
EINTERN Eina_Bool e_video_hwc_windows_frame_buffer_show(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 tbm_surface_h e_video_hwc_windows_displaying_buffer_get(E_Video_Hwc *evh);
EINTERN void e_video_hwc_render(E_Video_Hwc *evh, const char *func);
EINTERN Eina_Bool e_video_hwc_can_commit(E_Video_Hwc *evh);
+EINTERN Eina_Bool e_video_hwc_commit_done(E_Video_Hwc *evh);
EINTERN E_Client *e_video_hwc_client_offscreen_parent_get(E_Client *ec);
return tdm_layer_get_displaying_buffer(layer->tdm_layer, tdm_error);
}
+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 _e_video_layer_get_displaying_buffer(evhp->layer, NULL);
+}
+
static tdm_error
_e_video_layer_set_property(E_Video_Layer * layer, Tdm_Prop_Value *prop)
{
void *user_data)
{
E_Video_Hwc_Planes *evhp;
- Eina_List *l;
- E_Comp_Wl_Video_Buf *vbuf;
evhp = user_data;
if (!evhp) return;
- if (!evhp->base.committed_list) return;
-
- if (e_video_hwc_can_commit((E_Video_Hwc *)evhp))
- {
- tbm_surface_h displaying_buffer = _e_video_layer_get_displaying_buffer(evhp->layer, NULL);
-
- EINA_LIST_FOREACH(evhp->base.committed_list, l, vbuf)
- {
- if (vbuf->tbm_surface == displaying_buffer) break;
- }
- if (!vbuf) return;
- }
- else
- vbuf = eina_list_nth(evhp->base.committed_list, 0);
-
- evhp->base.committed_list = eina_list_remove(evhp->base.committed_list, vbuf);
-
- /* client can attachs the same wl_buffer twice. */
- if (evhp->base.current_fb && VBUF_IS_VALID(evhp->base.current_fb) && vbuf != evhp->base.current_fb)
- {
- e_comp_wl_video_buffer_set_use(evhp->base.current_fb, EINA_FALSE);
-
- if (evhp->base.current_fb->comp_buffer)
- e_comp_wl_buffer_reference(&evhp->base.current_fb->buffer_ref, NULL);
- }
-
- evhp->base.current_fb = vbuf;
- VDB("current_fb(%d)", evhp->base.ec, MSTAMP(evhp->base.current_fb));
+ e_video_hwc_commit_done((E_Video_Hwc *)evhp);
}
static void
void *user_data)
{
E_Video_Hwc_Windows *evhw;
- Eina_List *l;
- E_Comp_Wl_Video_Buf *vbuf;
evhw = user_data;
if (!evhw) return;
- if (!evhw->base.committed_list) return;
-
- if (e_video_hwc_can_commit((E_Video_Hwc *)evhw))
- {
- tbm_surface_h displaying_buffer = evhw->cur_tsurface;
-
- EINA_LIST_FOREACH(evhw->base.committed_list, l, vbuf)
- {
- if (vbuf->tbm_surface == displaying_buffer) break;
- }
- if (!vbuf) return;
- }
- else
- vbuf = eina_list_nth(evhw->base.committed_list, 0);
-
- evhw->base.committed_list = eina_list_remove(evhw->base.committed_list, vbuf);
-
- /* client can attachs the same wl_buffer twice. */
- if (evhw->base.current_fb && VBUF_IS_VALID(evhw->base.current_fb) && vbuf != evhw->base.current_fb)
- {
- e_comp_wl_video_buffer_set_use(evhw->base.current_fb, EINA_FALSE);
- if (evhw->base.current_fb->comp_buffer)
- e_comp_wl_buffer_reference(&evhw->base.current_fb->buffer_ref, NULL);
- }
-
- evhw->base.current_fb = vbuf;
-
- VDB("current_fb(%d)", evhw->base.ec, MSTAMP(evhw->base.current_fb));
+ if (!e_video_hwc_commit_done((E_Video_Hwc *)evhw))
+ return;
_e_video_vblank_handler(NULL, sequence, tv_sec, tv_usec, evhw);
}
return EINA_TRUE;
}
+
+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->cur_tsurface;
+}