video: Remove duplicated codes. 07/204307/3
authorSeunghun <shiin.lee@samsung.com>
Thu, 11 Apr 2019 09:35:12 +0000 (18:35 +0900)
committerSooChan Lim <sc1.lim@samsung.com>
Tue, 23 Apr 2019 22:41:24 +0000 (22:41 +0000)
Added following codes instead of removed one.
e_video_hwc_vbuf_find()
e_video_hwc_vbuf_find_with_comp_buffer()

Change-Id: I16d540f78c3078bace41063234127c0b21d1d228

src/bin/video/iface/e_video_hwc.c
src/bin/video/iface/e_video_hwc.h
src/bin/video/iface/e_video_hwc_planes.c
src/bin/video/iface/e_video_hwc_windows.c

index c6eebe112037ae8fd661ba7e8927d9d4dd12a89a..86973e42c180b9bac3e83945fb7507533f697b0e 100644 (file)
@@ -19,6 +19,36 @@ struct _E_Video_Hwc
    E_Video_Comp_Iface *backend;
 };
 
+EINTERN E_Comp_Wl_Video_Buf *
+e_video_hwc_vbuf_find(Eina_List *list, tbm_surface_h buffer)
+{
+   E_Comp_Wl_Video_Buf *vbuf;
+   Eina_List *l = NULL;
+
+   EINA_LIST_FOREACH(list, l, vbuf)
+     {
+        if (vbuf->tbm_surface == buffer)
+          return vbuf;
+     }
+
+   return NULL;
+}
+
+EINTERN E_Comp_Wl_Video_Buf *
+e_video_hwc_vbuf_find_with_comp_buffer(Eina_List *list, E_Comp_Wl_Buffer *comp_buffer)
+{
+   E_Comp_Wl_Video_Buf *vbuf;
+   Eina_List *l = NULL;
+
+   EINA_LIST_FOREACH(list, l, vbuf)
+     {
+        if (vbuf->comp_buffer == comp_buffer)
+          return vbuf;
+     }
+
+   return NULL;
+}
+
 EINTERN E_Client *
 e_video_hwc_client_offscreen_parent_get(E_Client *ec)
 {
index 0e93ce08a683888da4d103236d2ed3af5918aee6..366f0b061c986c3ef69242823b227a2f1430eba7 100644 (file)
@@ -36,4 +36,6 @@ EINTERN Eina_Bool    e_video_hwc_client_visible_get(E_Client *ec);
 EINTERN Eina_Bool    e_video_hwc_geometry_get(E_Client *ec, E_Video_Hwc_Geometry *out);
 EINTERN Eina_Bool    e_video_hwc_geometry_map_apply(E_Client *ec, E_Video_Hwc_Geometry *out);
 
+EINTERN E_Comp_Wl_Video_Buf *e_video_hwc_vbuf_find(Eina_List *list, tbm_surface_h buffer);
+EINTERN E_Comp_Wl_Video_Buf *e_video_hwc_vbuf_find_with_comp_buffer(Eina_List *list, E_Comp_Wl_Buffer *comp_buffer);
 #endif
index 87d2b23a4984a717dc9cbb88d00b81e5a191afe7..6a43425fb9f88a91a0f5820a649b42df07f757e3 100644 (file)
@@ -103,36 +103,6 @@ static Eina_Bool _e_video_tdm_get_layer_usable(tdm_layer *layer);
 static void _e_video_vblank_handler(tdm_output *output, unsigned int sequence, unsigned int tv_sec, unsigned int tv_usec, void *user_data);
 
 
-static E_Comp_Wl_Video_Buf *
-_e_video_vbuf_find(Eina_List *list, tbm_surface_h buffer)
-{
-   E_Comp_Wl_Video_Buf *vbuf;
-   Eina_List *l = NULL;
-
-   EINA_LIST_FOREACH(list, l, vbuf)
-     {
-        if (vbuf->tbm_surface == buffer)
-          return vbuf;
-     }
-
-   return NULL;
-}
-
-static E_Comp_Wl_Video_Buf *
-_e_video_vbuf_find_with_comp_buffer(Eina_List *list, E_Comp_Wl_Buffer *comp_buffer)
-{
-   E_Comp_Wl_Video_Buf *vbuf;
-   Eina_List *l = NULL;
-
-   EINA_LIST_FOREACH(list, l, vbuf)
-     {
-        if (vbuf->comp_buffer == comp_buffer)
-          return vbuf;
-     }
-
-   return NULL;
-}
-
 static E_Output *
 _get_e_output(tdm_output *output)
 {
@@ -519,7 +489,7 @@ _e_video_input_buffer_get(E_Video_Hwc_Planes *evhp, E_Comp_Wl_Buffer *comp_buffe
    E_Comp_Wl_Video_Buf *vbuf;
    Eina_Bool need_pp_scanout = EINA_FALSE;
 
-   vbuf = _e_video_vbuf_find_with_comp_buffer(evhp->input_buffer_list, comp_buffer);
+   vbuf = e_video_hwc_vbuf_find_with_comp_buffer(evhp->input_buffer_list, comp_buffer);
    if (vbuf)
      {
         vbuf->content_r = evhp->geo.input_r;
@@ -1332,11 +1302,11 @@ _e_video_pp_cb_done(tdm_pp *pp, tbm_surface_h sb, tbm_surface_h db, void *user_d
    E_Video_Hwc_Planes *evhp = (E_Video_Hwc_Planes*)user_data;
    E_Comp_Wl_Video_Buf *input_buffer, *pp_buffer;
 
-   input_buffer = _e_video_vbuf_find(evhp->input_buffer_list, sb);
+   input_buffer = e_video_hwc_vbuf_find(evhp->input_buffer_list, sb);
    if (input_buffer)
      e_comp_wl_video_buffer_unref(input_buffer);
 
-   pp_buffer = _e_video_vbuf_find(evhp->pp_buffer_list, db);
+   pp_buffer = e_video_hwc_vbuf_find(evhp->pp_buffer_list, db);
    if (pp_buffer)
      {
         e_comp_wl_video_buffer_set_use(pp_buffer, EINA_FALSE);
index 9796bfe20ac2c1d68cc614b634307d9cf70067da..5a1eab353c8d891710c4b2e1787ce1053d5354fb 100644 (file)
@@ -74,36 +74,6 @@ static void      _e_video_render(E_Video_Hwc_Windows *evhw, const char *func);
 static Eina_Bool _e_video_frame_buffer_show(E_Video_Hwc_Windows *evhw, E_Comp_Wl_Video_Buf *vbuf);
 static void      _e_video_vblank_handler(tdm_output *output, unsigned int sequence, unsigned int tv_sec, unsigned int tv_usec, void *user_data);
 
-static E_Comp_Wl_Video_Buf *
-_e_video_vbuf_find(Eina_List *list, tbm_surface_h buffer)
-{
-   E_Comp_Wl_Video_Buf *vbuf;
-   Eina_List *l = NULL;
-
-   EINA_LIST_FOREACH(list, l, vbuf)
-     {
-        if (vbuf->tbm_surface == buffer)
-          return vbuf;
-     }
-
-   return NULL;
-}
-
-static E_Comp_Wl_Video_Buf *
-_e_video_vbuf_find_with_comp_buffer(Eina_List *list, E_Comp_Wl_Buffer *comp_buffer)
-{
-   E_Comp_Wl_Video_Buf *vbuf;
-   Eina_List *l = NULL;
-
-   EINA_LIST_FOREACH(list, l, vbuf)
-     {
-        if (vbuf->comp_buffer == comp_buffer)
-          return vbuf;
-     }
-
-   return NULL;
-}
-
 static Eina_Bool
 _e_video_parent_is_viewable(E_Video_Hwc_Windows *evhw)
 {
@@ -233,7 +203,7 @@ _e_video_input_buffer_get(E_Video_Hwc_Windows *evhw, E_Comp_Wl_Buffer *comp_buff
    E_Comp_Wl_Video_Buf *vbuf;
    Eina_Bool need_pp_scanout = EINA_FALSE;
 
-   vbuf = _e_video_vbuf_find_with_comp_buffer(evhw->input_buffer_list, comp_buffer);
+   vbuf = e_video_hwc_vbuf_find_with_comp_buffer(evhw->input_buffer_list, comp_buffer);
    if (vbuf)
      {
         vbuf->content_r = evhw->geo.input_r;
@@ -853,11 +823,11 @@ _e_video_pp_cb_done(tdm_pp *pp, tbm_surface_h sb, tbm_surface_h db, void *user_d
    E_Video_Hwc_Windows *evhw = (E_Video_Hwc_Windows*)user_data;
    E_Comp_Wl_Video_Buf *input_buffer, *pp_buffer;
 
-   input_buffer = _e_video_vbuf_find(evhw->input_buffer_list, sb);
+   input_buffer = e_video_hwc_vbuf_find(evhw->input_buffer_list, sb);
    if (input_buffer)
      e_comp_wl_video_buffer_unref(input_buffer);
 
-   pp_buffer = _e_video_vbuf_find(evhw->pp_buffer_list, db);
+   pp_buffer = e_video_hwc_vbuf_find(evhw->pp_buffer_list, db);
    if (pp_buffer)
      {
         e_comp_wl_video_buffer_set_use(pp_buffer, EINA_FALSE);