video: Keep the size of composite object for video to 1 x 1. 22/214022/1 accepted/tizen/unified/20190917.110551 submit/tizen/20190917.080824
authorSeunghun Lee <shiin.lee@samsung.com>
Tue, 17 Sep 2019 07:43:26 +0000 (16:43 +0900)
committerSeunghun Lee <shiin.lee@samsung.com>
Tue, 17 Sep 2019 07:50:14 +0000 (16:50 +0900)
In order to prevent wasting of memory usage, keep the size of composite
object to 1 x 1.
Actually, composite object is virtually unneccessary in case the contents
of video is displayed on overlay plane.

Change-Id: I680db217421225398425bbbf904ba559d9377418

src/bin/video/iface/e_video_hwc.c

index c17ed37ddebee663111ac142472759d5d335c9c4..dcb25f5e2ebb43cd678cf062b34c268ba09aadf6 100644 (file)
@@ -897,6 +897,18 @@ static void
 _e_video_hwc_cb_evas_resize(void *data, Evas *e EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED)
 {
    E_Video_Hwc *evh = data;
+   int w = 0, h = 0;
+
+   /* Since video content will be displayed on the overlay plane,
+    * it's reasonable to keep the size of composite object to 1x1.
+    * Otherwise, it will cause memory usage to be increased unnecessarily. */
+   evas_object_geometry_get(evh->ec->frame, NULL, NULL, &w, &h);
+   if (w > 1 || h > 1)
+     {
+        VIN("Resizing comp object for video displaying overlay plane to 1 x 1",
+            evh->ec);
+        evas_object_resize(evh->ec->frame, 1, 1);
+     }
 
    evh->render.map = EINA_TRUE;
    _e_video_hwc_render_queue(evh);
@@ -1692,6 +1704,11 @@ _e_video_hwc_create(E_Client *ec)
         return NULL;
      }
 
+   /* Since video content will be displayed on the overlay plane,
+    * it's reasonable to keep the size of composite object to 1x1.
+    * Otherwise, it will cause memory usage to be increased unnecessarily. */
+   evas_object_resize(ec->frame, 1, 1);
+
    evh->hwc_policy = hwc_policy;
    evh->e_output = output;
    evh->ec = ec;