video_shell: Improve logging format 51/320651/1
authorSeunghun Lee <shiin.lee@samsung.com>
Wed, 26 Feb 2025 07:02:22 +0000 (16:02 +0900)
committerTizen Window System <tizen.windowsystem@gmail.com>
Wed, 5 Mar 2025 08:32:33 +0000 (17:32 +0900)
Change-Id: Ic50f079dabc61a6a588f5ce8d8332fc33976b37b

src/bin/server/e_video_shell.c

index ee828047322fc5884233192021e1815d31cf0d17..db06667dab5a618c1f01c8d596b72f10aa935eca 100644 (file)
 #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;
@@ -261,7 +245,7 @@ _viewport_cb_set_destination(struct wl_client *client, struct wl_resource *resou
        (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;
@@ -310,7 +294,7 @@ _viewport_cb_set_transform(struct wl_client *client, struct wl_resource *resourc
    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;
@@ -328,7 +312,7 @@ _viewport_cb_map(struct wl_client *client, struct wl_resource *resource)
         return;
      }
 
-   VS_INF("VIEWPORT %p| Map", viewport);
+   INF("VIEWPORT(%p) Map", viewport);
 
    if (viewport->pending.map)
      return;
@@ -349,7 +333,7 @@ _viewport_cb_unmap(struct wl_client *client, struct wl_resource *resource)
         return;
      }
 
-   VS_INF("VIEWPORT %p| Unmap", viewport);
+   INF("VIEWPORT(%p) Unmap", viewport);
 
    if (!viewport->pending.map)
      return;
@@ -370,7 +354,7 @@ static const struct wtz_video_exported_viewport_interface _viewport_impl =
 static void
 _viewport_destroy(E_Video_Viewport *viewport)
 {
-   VS_INF("VIEWPORT %p| destroy", viewport);
+   INF("VIEWPORT(%p) Destroy", viewport);
 
    if (viewport->source)
      {
@@ -401,7 +385,7 @@ _viewport_cb_resource_destroy(struct wl_resource *resource)
    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);
 }
@@ -411,7 +395,7 @@ _viewport_cb_subsurface_destroy(struct wl_listener *listener, void *data)
 {
    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);
 }
@@ -443,7 +427,7 @@ _viewport_consider_map(E_Video_Viewport *viewport)
 
    if (viewport->parent_mapped && viewport->current.map)
      {
-        VS_INF("VIEWPORT %p| Map", viewport);
+        INF("VIEWPORT(%p) Map", viewport);
 
         viewport->mapped = EINA_TRUE;
 
@@ -460,7 +444,7 @@ _viewport_unmap(E_Video_Viewport *viewport)
    if (!viewport->mapped)
      return;
 
-   VS_INF("VIEWPORT %p| Unmap", viewport);
+   INF("VIEWPORT(%p) Unmap", viewport);
 
    viewport->mapped = EINA_FALSE;
 
@@ -473,8 +457,6 @@ _viewport_unmap(E_Video_Viewport *viewport)
 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);
 
@@ -499,7 +481,7 @@ _viewport_cb_precommit_to_cache(struct wl_listener *listener, void *data)
    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);
 }
@@ -510,7 +492,7 @@ _viewport_cb_precommit_from_cache(struct wl_listener *listener, void *data)
    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);
@@ -522,7 +504,7 @@ _viewport_cb_precommit_from_pending(struct wl_listener *listener, void *data)
    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);
 }
@@ -535,7 +517,7 @@ _viewport_cb_reposition(struct wl_listener *listener, void *data)
 
    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);
 
@@ -570,7 +552,7 @@ _viewport_cb_new_subsurface(struct wl_listener *listener, void *data)
    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,
@@ -600,7 +582,7 @@ _viewport_export_handle_generate(E_Video_Viewport *viewport)
 
    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
@@ -745,7 +727,7 @@ _source_cb_set_source(struct wl_client *client, struct wl_resource *resource, wl
         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;
@@ -791,7 +773,7 @@ _source_cb_set_aspect_ratio(struct wl_client *client, struct wl_resource *resour
         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;
@@ -830,7 +812,7 @@ _source_destroy(E_Video_Viewport_Source *source)
 {
    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);
 
@@ -925,7 +907,7 @@ _source_cb_resource_destroy(struct wl_resource *resource)
    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);
 }
@@ -955,7 +937,7 @@ _source_map(E_Video_Viewport_Source *source)
    if (e_surface_is_mapped(source->surface->surface))
      return;
 
-   VS_INF("SOURCE %p| Map", source);
+   INF("SOURCE(%p) Map", source);
 
    if (ec->ignored)
      {
@@ -976,7 +958,7 @@ _source_unmap(E_Video_Viewport_Source *source)
    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);
 
@@ -1036,7 +1018,7 @@ _source_destination_update(E_Video_Viewport_Source *source)
    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)
      {
@@ -1053,7 +1035,7 @@ _source_destination_update(E_Video_Viewport_Source *source)
 
         _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);
      }
@@ -1148,7 +1130,7 @@ _source_rotation_update(E_Video_Viewport_Source *source)
          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
@@ -1186,7 +1168,7 @@ _source_viewport_source_box_update(E_Video_Viewport_Source *source)
         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);
@@ -1201,7 +1183,7 @@ _source_cb_surface_commit(struct wl_listener *listener, void *data)
    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);
@@ -1220,7 +1202,7 @@ _source_cb_surface_commit(struct wl_listener *listener, void *data)
 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);
@@ -1232,8 +1214,6 @@ _source_viewport_committed(E_Video_Viewport_Source *source)
 {
    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)
      {
@@ -1245,7 +1225,7 @@ _source_viewport_committed(E_Video_Viewport_Source *source)
 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);
@@ -1392,7 +1372,7 @@ _video_surface_cb_get_viewport_source(struct wl_client *client, struct wl_resour
    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;
      }
 
@@ -1405,7 +1385,7 @@ _video_subsurface_cb_subsurface_destroy(struct wl_listener *listener, void *data
 {
    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);
 }
@@ -1413,7 +1393,7 @@ _video_subsurface_cb_subsurface_destroy(struct wl_listener *listener, void *data
 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);
 
@@ -1549,7 +1529,7 @@ _video_surface_cb_get_subsurface(struct wl_client *client, struct wl_resource *r
 
    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;
      }
 
@@ -1577,7 +1557,7 @@ _video_surface_cb_set_name(struct wl_client *client, struct wl_resource *resourc
         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;
@@ -1617,7 +1597,7 @@ _video_surface_cb_set_stand_alone(struct wl_client *client, struct wl_resource *
         return;
      }
 
-   VS_INF("SURFACE %p| Set stand alone mode", surface);
+   INF("SURFACE(%p) Set stand alone mode", surface);
 
    _video_surface_stand_alone_set(surface);
 }
@@ -1634,7 +1614,7 @@ _video_surface_cb_unset_stand_alone(struct wl_client *client, struct wl_resource
         return;
      }
 
-   VS_INF("SURFACE %p| Unset stand alone mode", surface);
+   INF("SURFACE(%p) Unset stand alone mode", surface);
 
    _video_surface_stand_alone_unset(surface);
 }
@@ -1652,7 +1632,7 @@ static const struct wtz_video_surface_interface _video_surface_impl =
 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);
 
@@ -1670,7 +1650,7 @@ _video_surface_cb_resource_destroy(struct wl_resource *resource)
    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);
 }
@@ -1680,7 +1660,7 @@ _video_surface_cb_surface_destroy(struct wl_listener *listener, void *data)
 {
    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);
 }
@@ -1786,7 +1766,7 @@ _video_shell_cb_get_global_resource_id_from_handle(struct wl_client *client, str
 
    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);
 }
 
@@ -1820,7 +1800,7 @@ _video_shell_cb_display_destroy(struct wl_listener *listener, void *data)
    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)
@@ -1871,7 +1851,7 @@ e_video_shell_create(struct wl_display *display)
      wl_list_init(&shells);
    wl_list_insert(&shells, &shell->link);
 
-   VS_INF("SHELL %p| Created", shell);
+   INF("SHELL(%p) Created", shell);
 
    return shell;
 }
@@ -2296,7 +2276,7 @@ _viewport_border_init(E_Video_Viewport *viewport)
    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);