e_blur_video_capture: Add e_blur_video_capture_trace_dump_debug 38/317938/1
authorChangyeon Lee <cyeon.lee@samsung.com>
Fri, 13 Sep 2024 08:58:17 +0000 (17:58 +0900)
committerTizen Window System <tizen.windowsystem@gmail.com>
Mon, 23 Sep 2024 02:26:23 +0000 (11:26 +0900)
Change-Id: I0c7826a1aca5719e275fd99f8f283f15fd0880c8

src/bin/debug/e_info_client.c
src/bin/debug/e_info_server.c
src/bin/server/e_blur_video_capture.c
src/bin/server/e_blur_video_capture_intern.h
src/include/e_info_shared_types.h

index 07c0d78..27fe8ae 100644 (file)
@@ -3162,48 +3162,60 @@ _e_info_client_proc_trace(int argc, char **argv)
 
    onoff = atoi(argv[3]);
 
-   if (onoff == 1 || onoff == 0)
+   if (eina_streq(argv[2], "hwc"))
      {
-        if (eina_streq(argv[2], "hwc"))
+        if ((onoff != 0) && (onoff != 1))
+          goto arg_err;
+
+        if (!_e_info_client_eldbus_message_with_args("trace_message_hwc", NULL, "i", onoff))
           {
-             if (!_e_info_client_eldbus_message_with_args("trace_message_hwc", NULL, "i", onoff))
-               {
-                  printf("_e_info_client_eldbus_message_with_args error");
-               }
-             return;
+             printf("_e_info_client_eldbus_message_with_args error");
           }
-        else if (eina_streq(argv[2], "prstt"))
+        return;
+     }
+   else if (eina_streq(argv[2], "prstt"))
+     {
+        if ((onoff != 0) && (onoff != 1))
+          goto arg_err;
+
+        if (!_e_info_client_eldbus_message_with_args("trace_message_prstt", NULL, "i", onoff))
           {
-             if (!_e_info_client_eldbus_message_with_args("trace_message_prstt", NULL, "i", onoff))
-               {
-                  printf("_e_info_client_eldbus_message_with_args error");
-               }
-             return;
+             printf("_e_info_client_eldbus_message_with_args error");
           }
-        else if (eina_streq(argv[2], "exsync"))
+        return;
+     }
+   else if (eina_streq(argv[2], "exsync"))
+     {
+        if ((onoff != 0) && (onoff != 1))
+          goto arg_err;
+
+        if (!_e_info_client_eldbus_message_with_args("trace_message_exsync", NULL, "i", onoff))
           {
-             if (!_e_info_client_eldbus_message_with_args("trace_message_exsync", NULL, "i", onoff))
-               {
-                  printf("_e_info_client_eldbus_message_with_args error");
-               }
-             return;
+             printf("_e_info_client_eldbus_message_with_args error");
           }
-        else if (eina_streq(argv[2], "damage"))
+        return;
+     }
+   else if (eina_streq(argv[2], "damage"))
+     {
+        if ((onoff != 0) && (onoff != 1))
+          goto arg_err;
+
+        if (!_e_info_client_eldbus_message_with_args("trace_message_damage", NULL, "i", onoff))
           {
-             if (!_e_info_client_eldbus_message_with_args("trace_message_damage", NULL, "i", onoff))
-               {
-                  printf("_e_info_client_eldbus_message_with_args error");
-               }
-             return;
+             printf("_e_info_client_eldbus_message_with_args error");
           }
-        else if (eina_streq(argv[2], "blur"))
+        return;
+     }
+   else if (eina_streq(argv[2], "blur"))
+     {
+        if ((onoff != 0) && (onoff != 1) && (onoff != 2))
+          goto arg_err;
+
+        if (!_e_info_client_eldbus_message_with_args("trace_message_blur", NULL, "i", onoff))
           {
-             if (!_e_info_client_eldbus_message_with_args("trace_message_blur", NULL, "i", onoff))
-               {
-                  printf("_e_info_client_eldbus_message_with_args error");
-               }
-             return;
+             printf("_e_info_client_eldbus_message_with_args error");
           }
+        return;
      }
 
 arg_err:
index ba2a81a..cc1c569 100644 (file)
@@ -46,6 +46,7 @@
 #include "e_view_intern.h"
 #include "e_view_client_intern.h"
 #include "e_blur_intern.h"
+#include "e_blur_video_capture_intern.h"
 
 #include <tbm_bufmgr.h>
 #include <tbm_debug.h>
@@ -4545,8 +4546,19 @@ e_info_server_cb_blur_trace_message(const Eldbus_Service_Interface *iface EINA_U
         return reply;
      }
 
-   if (on == 0 || on == 1)
-     e_blur_trace_debug(on);
+   switch (on)
+     {
+      case 0:
+        e_blur_trace_debug(EINA_FALSE);
+        e_blur_video_capture_trace_dump_debug(EINA_FALSE);
+        break;
+      case 1:
+        e_blur_trace_debug(EINA_TRUE);
+        break;
+      case 2:
+        e_blur_video_capture_trace_dump_debug(EINA_TRUE);
+        break;
+     }
 
    return reply;
 }
index 3d71d8e..3bf479b 100644 (file)
@@ -95,6 +95,7 @@ static E_Blur_Video_Capture *_video_capture = NULL;
 static Eina_List *_e_blur_video_capture_hwc_window_hooks = NULL;
 static Eina_List *_e_blur_video_capture_blur_hooks = NULL;
 static Eina_Bool blur_video_capture_trace = EINA_FALSE;
+static Eina_Bool blur_video_capture_trace_dump = EINA_FALSE;
 
 static Eina_Bool _e_blur_video_capture_start(void);
 static Eina_Bool _e_blur_video_capture_stop(void);
@@ -463,12 +464,21 @@ _e_blur_video_capture_thread_run_notify_cb(void *data, Ecore_Thread *thread, voi
    E_Blur_Video_Capture_Object *object;
    Eina_List *l, *l2;
    int comp_w = 0, comp_h = 0;
+   static int dump_count = 0;
+   char dump_name[128];
 
    if (!tbm_surface_queue_can_acquire(video_capture->tqueue, 0)) return;
 
    tsq_err = tbm_surface_queue_acquire(video_capture->tqueue, &tsurface);
    EINA_SAFETY_ON_FALSE_RETURN(tsq_err == TBM_SURFACE_QUEUE_ERROR_NONE);
 
+   if (blur_video_capture_trace_dump)
+     {
+        snprintf(dump_name, sizeof(dump_name), "blur_video_capture_%d", dump_count);
+        tbm_surface_internal_capture_buffer(tsurface, "/tmp", dump_name, "yuv");
+        dump_count++;
+     }
+
    EINA_SAFETY_ON_NULL_GOTO(video_capture->source_obj, update);
 
    memset(&ns, 0, sizeof(Evas_Native_Surface));
@@ -1137,3 +1147,11 @@ e_blur_video_capture_trace_debug(Eina_Bool onoff)
    blur_video_capture_trace = onoff;
    INF("Blur Video Capture Debug is %s", onoff?"ON":"OFF");
 }
+
+EINTERN void
+e_blur_video_capture_trace_dump_debug(Eina_Bool onoff)
+{
+   if (onoff == blur_video_capture_trace_dump) return;
+   blur_video_capture_trace_dump = onoff;
+   INF("Blur Video Capture Dump Debug is %s", onoff?"ON":"OFF");
+}
index ce8d7f4..cdbe13b 100644 (file)
@@ -6,5 +6,6 @@
 EINTERN Eina_Bool e_blur_video_capture_init(void);
 EINTERN void e_blur_video_capture_deinit(void);
 EINTERN void e_blur_video_capture_trace_debug(Eina_Bool onoff);
+EINTERN void e_blur_video_capture_trace_dump_debug(Eina_Bool onoff);
 
 #endif // E_BLUR_VIDEO_CAPTURE_INTERN_H
index 309a63e..e614aaa 100644 (file)
@@ -213,7 +213,10 @@ typedef enum
    "\tenlightenment_info -trace exsync 1\n"                          \
    "\tenlightenment_info -trace exsync 0\n"                          \
    "\tenlightenment_info -trace damage 1\n"                          \
-   "\tenlightenment_info -trace damage 0\n"
+   "\tenlightenment_info -trace damage 0\n"                          \
+   "\tenlightenment_info -trace blur 1\n"                            \
+   "\tenlightenment_info -trace blur 2\n"                            \
+   "\tenlightenment_info -trace blur 0\n"
 
 /* -------------------------------------------------------------------------- */
 /* HWC WINS                                                                   */