e_client_video: initialize new compositing interface when zone is changed 21/271321/1
authorChangyeon Lee <cyeon.lee@samsung.com>
Tue, 25 Jan 2022 09:51:03 +0000 (18:51 +0900)
committerChangyeon Lee <cyeon.lee@samsung.com>
Fri, 18 Feb 2022 02:15:52 +0000 (11:15 +0900)
compositing policy of given E_Zone is changed.

Change-Id: Ib38415533f04034a027c04e3d533387d64840081

src/bin/video/e_client_video.c

index d6f8762662458876142961a0518de286f97e863d..c5ea0e7ac0e9af48bd35cda1d70a1997f41abfa8 100644 (file)
@@ -41,6 +41,8 @@ struct _E_Client_Video
 static void
 _e_client_video_comp_iface_deinit(E_Client_Video *ecv)
 {
+   if (!ecv->iface) return;
+
    ecv->iface->destroy(ecv->iface);
    ecv->iface = NULL;
 }
@@ -146,6 +148,7 @@ _e_client_video_cb_ec_zone_set(void *data, int type EINA_UNUSED, void *event)
 {
    E_Client_Video *ecv;
    E_Event_Client_Zone_Set *ev;
+   Eina_Bool res;
 
    ecv = data;
    ev = event;
@@ -153,9 +156,14 @@ _e_client_video_cb_ec_zone_set(void *data, int type EINA_UNUSED, void *event)
    if (ecv->ec != ev->ec)
      goto end;
 
-   /* TODO
-    * if compositing policy of given E_Zone is changed, de-initialize previous
-    * compositing interface and initialize new compositing interface. */
+   _e_client_video_comp_iface_deinit(ecv);
+
+   res = _e_client_video_comp_iface_init(ecv, ev->ec);
+   if (!res)
+     {
+        VER("Failed to initialize the composition interface for video", ev->ec);
+        return ECORE_CALLBACK_PASS_ON;
+     }
 
 end:
    return ECORE_CALLBACK_PASS_ON;