video_shell: Replace Eina_List with wl_list 49/316749/1
authorSeunghun Lee <shiin.lee@samsung.com>
Fri, 23 Aug 2024 04:47:06 +0000 (13:47 +0900)
committerTizen Window System <tizen.windowsystem@gmail.com>
Tue, 27 Aug 2024 23:09:36 +0000 (08:09 +0900)
Change-Id: I513f198e6d3b05a7de980de06dc92c77b9e137ae

src/bin/server/e_video_shell.c

index b3677f3..d67b481 100644 (file)
@@ -51,6 +51,7 @@ typedef struct
    struct wl_global *global;
    Eina_Hash *viewports;
    struct wl_listener display_destroy;
+   struct wl_list link;
 } E_Video_Shell;
 
 typedef enum
@@ -170,7 +171,7 @@ struct _E_Video_Viewport_Source
 
 static const char *e_video_surface_role_name = "wtz_video_surface";
 static Eina_Bool border_enabled = EINA_FALSE;
-static Eina_List *shells;
+static struct wl_list shells = {NULL, };
 
 static void _source_viewport_destroyed(E_Video_Viewport_Source *source);
 static void _source_viewport_committed(E_Video_Viewport_Source *source);
@@ -1742,8 +1743,8 @@ _video_shell_free(E_Video_Shell *shell)
 {
    VS_INF("SHELL %p| Free", shell);
 
-   shells = eina_list_remove(shells, shell);
    eina_hash_free(shell->viewports);
+   wl_list_remove(&shell->link);
    free(shell);
 }
 
@@ -1776,7 +1777,9 @@ e_video_shell_create(struct wl_display *display)
    shell->display_destroy.notify = _video_shell_cb_display_destroy;
    wl_display_add_destroy_listener(display, &shell->display_destroy);
 
-   shells = eina_list_append(shells, shell);
+   if (shells.prev == NULL)
+     wl_list_init(&shells);
+   wl_list_insert(&shells, &shell->link);
 
    VS_INF("SHELL %p| Created", shell);
 
@@ -1789,9 +1792,8 @@ e_video_shell_border_enabled_set(Eina_Bool enabled)
    E_Video_Shell *shell;
    E_Video_Viewport *viewport;
    Eina_Iterator *itr;
-   Eina_List *l;
 
-   EINA_LIST_FOREACH(shells, l, shell)
+   wl_list_for_each(shell, &shells, link)
      {
         itr = eina_hash_iterator_data_new(shell->viewports);
         EINA_ITERATOR_FOREACH(itr, viewport)
@@ -1913,7 +1915,6 @@ e_video_shell_info_print(void)
 {
    E_Video_Shell *shell;
    E_Video_Viewport *viewport;
-   Eina_List *l;
    Eina_Iterator *itr;
    FILE *fp;
    char *ret;
@@ -1925,7 +1926,7 @@ e_video_shell_info_print(void)
    if (!fp)
      return NULL;
 
-   EINA_LIST_FOREACH(shells, l, shell)
+   wl_list_for_each(shell, &shells, link)
      {
         fprintf(fp, "Vidoe shell %d exported viewport list:\n", ++shell_count);