video_shell: Reduce log messages 30/316230/1
authorSeunghun Lee <shiin.lee@samsung.com>
Wed, 14 Aug 2024 05:09:54 +0000 (14:09 +0900)
committerTizen Window System <tizen.windowsystem@gmail.com>
Fri, 16 Aug 2024 05:29:01 +0000 (14:29 +0900)
Change-Id: I6749c6bd5a4ba213ad804d36b57720172316656b

src/bin/server/e_video_shell.c

index be9e8d350cfceca83fe0288c6a7ed666cc7413a2..64b2f90a4934190014e74fb62ed253de2a20a34e 100644 (file)
@@ -215,8 +215,6 @@ _viewport_cb_set_destination(struct wl_client *client, struct wl_resource *resou
         return;
      }
 
-   VS_INF("VIEWPORT %p| Set destination(width: %d, height: %d)", viewport, width, height);
-
    if ((width != -1 || height != -1) &&
        (width < 1 || height <1))
      {
@@ -231,6 +229,8 @@ _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);
+
    viewport->pending.committed |= E_VIDEO_VIEWPORT_STATE_DESTINATION;
    viewport->pending.width = width;
    viewport->pending.height = height;
@@ -477,8 +477,11 @@ _viewport_cb_precommit_to_cache(struct wl_listener *listener, void *data)
 {
    E_Video_Viewport *viewport = wl_container_of(listener, viewport, precommit_to_cache);
 
-   VS_INF("VIEWPORT %p| Precommit to cache (pending.committed:%d, cache.committed:%d)",
-          viewport, viewport->pending.committed, viewport->cache.committed);
+   if (viewport->pending.committed)
+     {
+        VS_INF("VIEWPORT %p| Precommit to cache (pending.committed:%d, cache.committed:%d)",
+               viewport, viewport->pending.committed, viewport->cache.committed);
+     }
 
    _viewport_state_move(&viewport->cache, &viewport->pending);
 }
@@ -488,8 +491,11 @@ _viewport_cb_precommit_from_cache(struct wl_listener *listener, void *data)
 {
    E_Video_Viewport *viewport = wl_container_of(listener, viewport, precommit_from_cache);
 
-   VS_INF("VIEWPORT %p| Precommit from cache (cache.committed:%d)",
-          viewport, viewport->cache.committed);
+   if (viewport->cache.committed)
+     {
+        VS_INF("VIEWPORT %p| Precommit from cache (cache.committed:%d)",
+               viewport, viewport->cache.committed);
+     }
 
    if (viewport->cache.committed != E_VIDEO_VIEWPORT_STATE_CLEAN)
      _viewport_state_commit(viewport, &viewport->cache);
@@ -500,8 +506,11 @@ _viewport_cb_precommit_from_pending(struct wl_listener *listener, void *data)
 {
    E_Video_Viewport *viewport = wl_container_of(listener, viewport, precommit_from_pending);
 
-   VS_INF("VIEWPORT %p| Precommit from pending (pending.committed:%d)",
-          viewport, viewport->pending.committed);
+   if (viewport->pending.committed)
+     {
+        VS_INF("VIEWPORT %p| Precommit from pending (pending.committed:%d)",
+               viewport, viewport->pending.committed);
+     }
 
     _viewport_state_commit(viewport, &viewport->pending);
 }
@@ -658,7 +667,8 @@ _video_shell_cb_export_viewport(struct wl_client *client, struct wl_resource *re
    if (border_enabled)
      _viewport_border_init(viewport);
 
-   VS_INF("VIEWPORT %p| Created with E_Subsurface(%p)", viewport, subsurface);
+   ELOGF("VSHELL", "Created Viewport(%p) from E_Subsurface(%p)",
+         e_surface_ec_get(surface), viewport, viewport->subsurface);
 }
 
 static void
@@ -691,11 +701,11 @@ _source_cb_set_source(struct wl_client *client, struct wl_resource *resource, wl
    width = wl_fixed_to_double(width_fixed);
    height = wl_fixed_to_double(height_fixed);
 
-   VS_INF("SOURCE %p| Set source region(x:%f, y:%f, width:%f, height:%f)",
-          source, x, y, width, height);
-
    if (x == -1.0 && y == -1.0 && width == -1.0 && height == -1.0)
      {
+        if (!source->pending.has_src)
+          return;
+
         source->pending.has_src = EINA_FALSE;
      }
    else if (x < 0 || y < 0 || width <= 0 || height <= 0)
@@ -707,9 +717,17 @@ _source_cb_set_source(struct wl_client *client, struct wl_resource *resource, wl
      }
    else
      {
+        if (source->pending.has_src &&
+            source->pending.src.x == x && source->pending.src.y == y &&
+            source->pending.src.width == width && source->pending.src.height == height)
+          return;
+
         source->pending.has_src = EINA_TRUE;
      }
 
+   VS_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.src.y = y;
    source->pending.src.width = width;
@@ -729,10 +747,11 @@ _source_cb_set_aspect_ratio(struct wl_client *client, struct wl_resource *resour
         return;
      }
 
-   VS_INF("SOURCE %p| Set aspect ratio(%dx%d)", source, width, height);
-
    if (width == -1 && height == -1)
      {
+        if (!source->pending.has_aspect_ratio)
+          return;
+
         source->pending.has_aspect_ratio = EINA_FALSE;
      }
    else if (width <= 0 || height <= 0)
@@ -744,9 +763,16 @@ _source_cb_set_aspect_ratio(struct wl_client *client, struct wl_resource *resour
      }
    else
      {
+        if (source->pending.has_aspect_ratio &&
+            source->pending.aspect_ratio.width == width &&
+            source->pending.aspect_ratio.height == height)
+          return;
+
         source->pending.has_aspect_ratio = EINA_TRUE;
      }
 
+   VS_INF("SOURCE %p| Set aspect ratio(%dx%d)", source, width, height);
+
    source->pending.aspect_ratio.width = width;
    source->pending.aspect_ratio.height = height;
    source->pending.committed |= E_VIDEO_VIEWPORT_SOURCE_STATE_ASPECT_RATIO;
@@ -1137,7 +1163,8 @@ _source_cb_surface_commit(struct wl_listener *listener, void *data)
    source->current = source->pending;
    source->pending.committed = E_VIDEO_VIEWPORT_SOURCE_STATE_CLEAN;
 
-   VS_INF("SOURCE %p| Commit (current.committed:%d)", source, source->current.committed);
+   if (source->current.committed)
+     VS_INF("SOURCE %p| Commit (current.committed:%d)", source, source->current.committed);
 
    _source_pixmap_update(source);
    _source_map_state_update(source);
@@ -1319,7 +1346,7 @@ _source_viewport_committed(E_Video_Viewport_Source *source)
 {
    E_Video_Viewport_State *state = &source->viewport->current;
 
-   VS_INF("SOURCE %p| viewport committed", source);
+   VS_DBG("SOURCE %p| viewport committed", source);
 
    if (state->committed & E_VIDEO_VIEWPORT_STATE_DESTINATION)
      {
@@ -1397,10 +1424,11 @@ _video_surface_cb_get_viewport_source(struct wl_client *client, struct wl_resour
      }
    wl_resource_set_implementation(source->resource, &_source_impl, source, _source_cb_resource_destroy);
 
+   ELOGF("VSHELL", "Created Source(%p) from E_Video_Surface(%p), Viewport(%p)",
+         e_surface_ec_get(surface->surface), source, surface, viewport);
+
    _source_viewport_link(source, viewport);
    _video_surface_name_update(surface);
-
-   VS_INF("SOURCE %p| Created with E_Video_Surface(%p), Viewport(%p)", source, surface, viewport);
 }
 
 static void
@@ -1466,8 +1494,8 @@ _video_surface_cb_get_subsurface(struct wl_client *client, struct wl_resource *r
 
    _video_surface_name_update(surface);
 
-   VS_INF("SURFACE %p| Subsurface(%p) created with Parent E_Surface(%p)",
-          surface, surface->subsurface, parent_surface);
+   ELOGF("VSHELL", "Created legacy Subsurface(%p) from E_Video_Surface(%p), Parent(%p)",
+         e_surface_ec_get(surface->surface), surface->subsurface, surface, parent_surface);
 }
 
 static void
@@ -1654,7 +1682,7 @@ _video_shell_cb_get_surface(struct wl_client *client, struct wl_resource *resour
    surface->surface_destroy.notify = _video_surface_cb_surface_destroy;
    e_surface_destroy_listener_add(surface->surface, &surface->surface_destroy);
 
-   VS_INF("SURFACE %p| Created with E_Surface(%p)", surface, e_surface);
+   ELOGF("VSHELL", "Created Surface(%p) from E_Surface(%p)", e_surface_ec_get(e_surface), surface, e_surface);
 }
 
 static void
@@ -1665,8 +1693,6 @@ _video_shell_cb_get_global_resource_id_from_handle(struct wl_client *client, str
    E_Client *ec;
    uint32_t id = 0;
 
-   VS_INF("SHELL %p| Get global resource id from handle(%s)", shell, handle);
-
    viewport = eina_hash_find(shell->viewports, handle);
    if (!viewport)
      goto end;
@@ -1675,7 +1701,7 @@ _video_shell_cb_get_global_resource_id_from_handle(struct wl_client *client, str
    id = e_pixmap_res_id_get(ec->pixmap);
 
 end:
-   VS_INF("SHELL %p| Send global resource id(%d)", shell, id);
+   VS_INF("SHELL %p| Send global resource id(%d) of handle(%s)", shell, id, handle);
    wtz_video_shell_send_global_resource_id(resource, id);
 }