#include <Evas.h>
#include <Eina.h>
-#ifdef VS_ERR
-#undef VS_ERR
-#endif
-
-#ifdef VS_INF
-#undef VS_INF
-#endif
-
-#ifdef VS_DBG
-#undef VS_DBG
-#endif
-
-#define VS_ERR(f, x...) ERR(f, ##x)
-#define VS_INF(f, x...) INF(f, ##x)
-#define VS_DBG(f, x...) DBG(f, ##x)
-
#define WTZ_VIDEO_SHELL_VERSION 1
typedef struct _E_Video_Viewport_Source E_Video_Viewport_Source;
(viewport->pending.height == height))
return;
- VS_INF("VIEWPORT %p| Set destination(width: %d, height: %d)", viewport, width, height);
+ INF("VIEWPORT(%p) Set destination(width: %d, height: %d)", viewport, width, height);
viewport->pending.committed |= E_VIDEO_VIEWPORT_STATE_DESTINATION;
viewport->pending.width = width;
if (viewport->pending.transform == transform)
return;
- VS_INF("VIEWPORT %p| Set transform(%s)", viewport, _viewport_transform_to_str(transform));
+ INF("VIEWPORT(%p) Set transform(%s)", viewport, _viewport_transform_to_str(transform));
viewport->pending.committed |= E_VIDEO_VIEWPORT_STATE_TRANSFORM;
viewport->pending.transform = transform;
return;
}
- VS_INF("VIEWPORT %p| Map", viewport);
+ INF("VIEWPORT(%p) Map", viewport);
if (viewport->pending.map)
return;
return;
}
- VS_INF("VIEWPORT %p| Unmap", viewport);
+ INF("VIEWPORT(%p) Unmap", viewport);
if (!viewport->pending.map)
return;
static void
_viewport_destroy(E_Video_Viewport *viewport)
{
- VS_INF("VIEWPORT %p| destroy", viewport);
+ INF("VIEWPORT(%p) Destroy", viewport);
if (viewport->source)
{
if (!viewport)
return;
- VS_INF("VIEWPORT %p| wl_resource(%p) destroyed", viewport, resource);
+ INF("VIEWPORT(%p) wl_resource(%p) destroyed", viewport, resource);
_viewport_destroy(viewport);
}
{
E_Video_Viewport *viewport = wl_container_of(listener, viewport, destroy);
- VS_INF("VIEWPORT %p| E_Subsurface(%p) destroyed", viewport, viewport->subsurface);
+ INF("VIEWPORT(%p) E_Subsurface(%p) destroyed", viewport, viewport->subsurface);
_viewport_destroy(viewport);
}
if (viewport->parent_mapped && viewport->current.map)
{
- VS_INF("VIEWPORT %p| Map", viewport);
+ INF("VIEWPORT(%p) Map", viewport);
viewport->mapped = EINA_TRUE;
if (!viewport->mapped)
return;
- VS_INF("VIEWPORT %p| Unmap", viewport);
+ INF("VIEWPORT(%p) Unmap", viewport);
viewport->mapped = EINA_FALSE;
static void
_viewport_state_commit(E_Video_Viewport *viewport, E_Video_Viewport_State *next)
{
- VS_DBG("VIEWPORT %p| Commit State", viewport);
-
viewport->current.committed = E_VIDEO_VIEWPORT_STATE_CLEAN;
_viewport_state_move(&viewport->current, next);
E_Video_Viewport *viewport = wl_container_of(listener, viewport, precommit_to_cache);
if (viewport->pending.committed)
- VS_INF("VIEWPORT %p| Precommit to cache", viewport);
+ INF("VIEWPORT(%p) Precommit to cache", viewport);
_viewport_state_move(&viewport->cache, &viewport->pending);
}
E_Video_Viewport *viewport = wl_container_of(listener, viewport, precommit_from_cache);
if (viewport->cache.committed)
- VS_INF("VIEWPORT %p| Precommit from cache", viewport);
+ INF("VIEWPORT(%p) Precommit from cache", viewport);
if (viewport->cache.committed != E_VIDEO_VIEWPORT_STATE_CLEAN)
_viewport_state_commit(viewport, &viewport->cache);
E_Video_Viewport *viewport = wl_container_of(listener, viewport, precommit_from_pending);
if (viewport->pending.committed)
- VS_INF("VIEWPORT %p| Precommit from pending", viewport);
+ INF("VIEWPORT(%p) Precommit from pending", viewport);
_viewport_state_commit(viewport, &viewport->pending);
}
e_subsurface_coord_get(viewport->subsurface, &x, &y);
- VS_INF("VIEWPORT %p| Reposition: coord (%d, %d)", viewport, x, y);
+ INF("VIEWPORT(%p) Reposition: coord (%d, %d)", viewport, x, y);
_viewport_border_geometry_update(viewport);
E_Video_Viewport *viewport = wl_container_of(listener, viewport, new_subsurface);
E_Subsurface *subsurface = data;
- VS_ERR("VIEWPORT %p| The video viewport subsurface cannot have a child subsurface(%p)",
+ ERR("VIEWPORT(%p) Video viewport cannot have child(%p)",
viewport, subsurface);
wl_resource_post_error(viewport->resource,
eina_hash_add(viewport->shell->viewports, handle_str, viewport);
- VS_INF("VIEWPORT %p| Export handle(%s) generated", viewport, handle_str);
+ INF("VIEWPORT(%p) Export handle(%s) generated", viewport, handle_str);
}
static void
source->pending.has_src = EINA_TRUE;
}
- VS_INF("SOURCE %p| Set source region(x:%f, y:%f, width:%f, height:%f)",
+ INF("SOURCE(%p) Set source region(x:%f, y:%f, width:%f, height:%f)",
source, x, y, width, height);
source->pending.src.x = x;
source->pending.has_aspect_ratio = EINA_TRUE;
}
- VS_INF("SOURCE %p| Set aspect ratio(%dx%d)", source, width, height);
+ INF("SOURCE(%p) Set aspect ratio(%dx%d)", source, width, height);
source->pending.aspect_ratio.width = width;
source->pending.aspect_ratio.height = height;
{
E_Client *ec = e_surface_ec_get(source->surface->surface);
- VS_INF("SOURCE %p| Destroy", source);
+ INF("SOURCE(%p) Destroy", source);
wl_signal_emit(&source->events.destroy, source);
if (!source)
return;
- VS_INF("SOURCE %p| wl_resource(%p) destroyed", source, source->resource);
+ INF("SOURCE(%p) wl_resource(%p) destroyed", source, source->resource);
_video_surface_role_destroy(source->surface);
}
if (e_surface_is_mapped(source->surface->surface))
return;
- VS_INF("SOURCE %p| Map", source);
+ INF("SOURCE(%p) Map", source);
if (ec->ignored)
{
if (!e_surface_is_mapped(source->surface->surface))
return;
- VS_INF("SOURCE %p| Unmap", source);
+ INF("SOURCE(%p) Unmap", source);
e_surface_unmap(source->surface->surface);
dest_rect.w = viewport->current.width;
dest_rect.h = viewport->current.height;
- VS_INF("SOURCE %p| Update destination(%dx%d)", source, dest_rect.w, dest_rect.h);
+ INF("SOURCE(%p) Update destination(%dx%d)", source, dest_rect.w, dest_rect.h);
if (source->current.has_aspect_ratio)
{
_letter_box_geometry_calc(&dest_rect, ratio_width, ratio_height);
- VS_INF("SOURCE %p| Update destination with aspect ratio(%d,%d) -> (%d,%d) %dx%d",
+ INF("SOURCE(%p) Apply aspect ratio(%d,%d) -> (%d,%d) %dx%d",
source, ratio_width, ratio_height,
dest_rect.x, dest_rect.y, dest_rect.w, dest_rect.h);
}
assert(0);
}
- VS_INF("SOURCE %p| Update rotation: %s", source, _viewport_transform_to_str(viewport->current.transform));
+ INF("SOURCE(%p) Update rotation: %s", source, _viewport_transform_to_str(viewport->current.transform));
}
static void
src_rect.h = ceil(state->src.height);
}
- VS_INF("SOURCE %p| Update source box (%d,%d) %dx%d",
+ INF("SOURCE(%p) Update source box (%d,%d) %dx%d",
source, src_rect.x, src_rect.y, src_rect.w, src_rect.h);
e_surface_viewporter_source_box_set(source->surface_viewporter, &src_rect);
source->pending.committed = E_VIDEO_VIEWPORT_SOURCE_STATE_CLEAN;
if (source->current.committed)
- VS_INF("SOURCE %p| Commit (current.committed:%d)", source, source->current.committed);
+ INF("SOURCE(%p) Commit (current.committed:%d)", source, source->current.committed);
_source_pixmap_update(source);
_source_map_state_update(source);
static void
_source_viewport_destroyed(E_Video_Viewport_Source *source)
{
- VS_INF("SOURCE %p| viewport destroyed", source);
+ INF("SOURCE(%p) viewport destroyed", source);
source->viewport = NULL;
e_comp_wl_subsurface_data_parent_unset(&source->base);
{
E_Video_Viewport_State *state = &source->viewport->current;
- VS_DBG("SOURCE %p| viewport committed", source);
-
if (state->committed & E_VIDEO_VIEWPORT_STATE_DESTINATION ||
state->committed & E_VIDEO_VIEWPORT_STATE_TRANSFORM)
{
static void
_source_viewport_map_state_changed(E_Video_Viewport_Source *source)
{
- VS_INF("SOURCE %p| viewport map state changed: mapped(%d)",
+ INF("SOURCE(%p) viewport map state changed: mapped(%d)",
source, source->viewport->mapped);
_source_map_state_update(source);
source = _source_create(client, resource, id, surface, handle);
if (!source)
{
- VS_ERR("SURFACE %p| Failed to create E_Video_Viewport_Source", surface);
+ ERR("SURFACE(%p) Failed to create E_Video_Viewport_Source", surface);
return;
}
{
E_Video_Subsurface *subsurface = wl_container_of(listener, subsurface, subsurface_destroy);
- VS_INF("SUBSURFACE %p| E_Subsurface(%p) destroyed", subsurface, subsurface->subsurface);
+ INF("SUBSURFACE(%p) E_Subsurface(%p) destroyed", subsurface, subsurface->subsurface);
_video_surface_role_destroy(subsurface->surface);
}
static void
_video_subsurface_destroy(E_Video_Subsurface *subsurface)
{
- VS_INF("SUBSURFACE %p| Destroy", subsurface);
+ INF("SUBSURFACE(%p) Destroy", subsurface);
_video_surface_role_finish(&subsurface->role);
if (!_video_subsurface_create(resource, id, surface, parent_surface_resource))
{
- VS_ERR("SURFACE %p| Failed to create E_Video_Subsurface", surface);
+ ERR("SURFACE(%p) Failed to create E_Video_Subsurface", surface);
return;
}
return;
}
- VS_INF("SURFACE %p| Set name(old:%s, new:%s)", surface, surface->name ?: "", tmp);
+ INF("SURFACE(%p) Set name(old:%s, new:%s)", surface, surface->name ?: "", tmp);
free(surface->name);
surface->name = tmp;
return;
}
- VS_INF("SURFACE %p| Set stand alone mode", surface);
+ INF("SURFACE(%p) Set stand alone mode", surface);
_video_surface_stand_alone_set(surface);
}
return;
}
- VS_INF("SURFACE %p| Unset stand alone mode", surface);
+ INF("SURFACE(%p) Unset stand alone mode", surface);
_video_surface_stand_alone_unset(surface);
}
static void
_video_surface_destroy(E_Video_Surface *surface)
{
- VS_INF("SURFACE %p| Destroy", surface);
+ INF("SURFACE(%p) Destroy", surface);
_video_surface_role_destroy(surface);
if (!surface)
return;
- VS_INF("SURFACE %p| wl_resource(%p) destroyed", surface, surface->resource);
+ INF("SURFACE(%p) wl_resource(%p) destroyed", surface, surface->resource);
_video_surface_destroy(surface);
}
{
E_Video_Surface *surface = wl_container_of(listener, surface, surface_destroy);
- VS_INF("SURFACE %p| E_Surface(%p) destroyed", surface, surface->surface);
+ INF("SURFACE(%p) E_Surface(%p) destroyed", surface, surface->surface);
_video_surface_destroy(surface);
}
id = e_compositor_surface_export(e_subsurface_surface_get(viewport->subsurface));
end:
- VS_INF("SHELL %p| Send global resource id(%d) of handle(%s)", shell, id, handle);
+ INF("SHELL(%p) Send global resource id(%d) of handle(%s)", shell, id, handle);
wtz_video_shell_send_global_resource_id(resource, id);
}
E_Video_Viewport *viewport;
Eina_Iterator *itr;
- VS_INF("SHELL %p| wl_display destroyed", shell);
+ INF("SHELL(%p) wl_display destroyed", shell);
itr = eina_hash_iterator_data_new(shell->viewports);
EINA_ITERATOR_FOREACH(itr, viewport)
wl_list_init(&shells);
wl_list_insert(&shells, &shell->link);
- VS_INF("SHELL %p| Created", shell);
+ INF("SHELL(%p) Created", shell);
return shell;
}
border = _border_create(e_view_parent_get(view), color);
if (!border)
{
- VS_ERR("Failed to create Viewport_Border");
+ ERR("Failed to create Viewport_Border");
return;
}
_border_place_above(border, view);