video: Added e_video_debug_screen_punch_set()/unset() functions. 61/206161/8
authorSeunghun Lee <shiin.lee@samsung.com>
Tue, 30 Apr 2019 01:03:13 +0000 (10:03 +0900)
committerSooChan Lim <sc1.lim@samsung.com>
Tue, 28 May 2019 10:43:44 +0000 (10:43 +0000)
This API will make full-sized transparent object overlapping canvas of
e_comp to show video plane.

Change-Id: I05976b1465ca486951e6c756d1ec7541fa3b20ad

src/bin/e_info_server.c
src/bin/video/e_video_debug.c
src/bin/video/e_video_debug.h

index ef1b7e3..29aa7dd 100644 (file)
@@ -3526,7 +3526,6 @@ _e_info_server_cb_punch(const Eldbus_Service_Interface *iface EINA_UNUSED, const
    Eldbus_Message *reply = eldbus_message_method_return_new(msg);
    int onoff = 0, x = 0, y = 0, w = 0, h = 0;
    int a = 0, r = 0, g = 0, b = 0;
-   static Evas_Object *punch_obj = NULL;
 
    if (!eldbus_message_arguments_get(msg, "iiiiiiiii", &onoff, &x, &y, &w, &h, &a, &r, &g, &b))
      {
@@ -3534,29 +3533,10 @@ _e_info_server_cb_punch(const Eldbus_Service_Interface *iface EINA_UNUSED, const
         return reply;
      }
 
-  if (!onoff)
-    {
-       if (punch_obj)
-         evas_object_del(punch_obj);
-       punch_obj = NULL;
-       return reply;
-    }
-
-  if (!punch_obj)
-    {
-       punch_obj = evas_object_rectangle_add(e_comp->evas);
-       evas_object_render_op_set(punch_obj, EVAS_RENDER_COPY);
-    }
-
-   evas_object_color_set(punch_obj, r, g, b, a);
-
-   if (w == 0 || h == 0)
-     evas_output_size_get(e_comp->evas, &w, &h);
-
-   evas_object_move(punch_obj, x, y);
-   evas_object_resize(punch_obj, w, h);
-   evas_object_layer_set(punch_obj, EVAS_LAYER_MAX);
-   evas_object_show(punch_obj);
+   if (onoff)
+     e_video_debug_screen_punch_set(x, y, w, h, a, r, g, b);
+   else
+     e_video_debug_screen_punch_unset();
 
    return reply;
 }
index a8b5616..4f78116 100644 (file)
@@ -2,6 +2,7 @@
 
 static Eina_Bool video_to_primary = EINA_FALSE;
 static Eina_Bool video_punch = EINA_FALSE;
+static Evas_Object *punch_obj = NULL;
 
 E_API Eina_Bool
 e_video_debug_display_primary_plane_value_get(void)
@@ -26,3 +27,33 @@ e_video_debug_punch_set(Eina_Bool set)
 {
    video_punch = set;
 }
+
+EINTERN void
+e_video_debug_screen_punch_set(int x, int y, int w, int h, int a, int r, int g, int b)
+{
+   if (!punch_obj)
+     {
+        punch_obj = evas_object_rectangle_add(e_comp->evas);
+        evas_object_layer_set(punch_obj, EVAS_LAYER_MAX);
+        evas_object_render_op_set(punch_obj, EVAS_RENDER_COPY);
+     }
+
+   evas_object_color_set(punch_obj, r, g, b, a);
+
+   if (w == 0 || h == 0)
+     evas_output_size_get(e_comp->evas, &w, &h);
+
+   evas_object_move(punch_obj, x, y);
+   evas_object_resize(punch_obj, w, h);
+   evas_object_show(punch_obj);
+}
+
+EINTERN void
+e_video_debug_screen_punch_unset(void)
+{
+   if (!punch_obj)
+     return;
+
+   evas_object_del(punch_obj);
+   punch_obj = NULL;
+}
index 0d9aed3..6c48204 100644 (file)
@@ -7,5 +7,7 @@ E_API   Eina_Bool   e_video_debug_display_primary_plane_value_get(void);
 E_API   void        e_video_debug_display_primary_plane_set(Eina_Bool set);
 EINTERN Eina_Bool   e_video_debug_punch_value_get(void);
 EINTERN void        e_video_debug_punch_set(Eina_Bool set);
+EINTERN void        e_video_debug_screen_punch_set(int x, int y, int w, int h, int a, int r, int g, int b);
+EINTERN void        e_video_debug_screen_punch_unset(void);
 
 #endif