[vlc-devel] [PATCH 3/7] vout/android: remove sys->embed

Thomas Guillem thomas at gllm.fr
Thu Mar 26 16:33:49 CET 2020


Since vd->window can be used directly.
---
 modules/video_output/android/display.c | 17 +++++------------
 1 file changed, 5 insertions(+), 12 deletions(-)

diff --git a/modules/video_output/android/display.c b/modules/video_output/android/display.c
index 6948516ad1..bbe4ee5742 100644
--- a/modules/video_output/android/display.c
+++ b/modules/video_output/android/display.c
@@ -106,8 +106,6 @@ struct buffer_bounds
 
 struct vout_display_sys_t
 {
-    vout_window_t *embed;
-
     int i_display_width;
     int i_display_height;
 
@@ -483,21 +481,17 @@ static int Open(vout_display_t *vd, const vout_display_cfg_t *cfg,
     vout_display_sys_t *sys;
     video_format_t fmt, sub_fmt;
 
-    vout_window_t *embed = vd->window;
-    if (embed->type != VOUT_WINDOW_TYPE_ANDROID_NATIVE)
+    if (vd->window->type != VOUT_WINDOW_TYPE_ANDROID_NATIVE)
         return VLC_EGENERIC;
 
-    if (embed == NULL)
-        return VLC_EGENERIC;
-    assert(embed->handle.anativewindow);
-    AWindowHandler *p_awh = embed->handle.anativewindow;
+    assert(vd->window->handle.anativewindow);
+    AWindowHandler *p_awh = vd->window->handle.anativewindow;
 
     /* Allocate structure */
     vd->sys = sys = (struct vout_display_sys_t*)calloc(1, sizeof(*sys));
     if (!sys)
         return VLC_ENOMEM;
 
-    sys->embed = embed;
     sys->p_awh = p_awh;
     sys->anw = AWindowHandler_getANativeWindowAPI(sys->p_awh);
 
@@ -609,7 +603,7 @@ static void ClearSurface(vout_display_t *vd)
     if (sys->p_window->b_opaque)
     {
         /* Clear the surface to black with OpenGL ES 2 */
-        char *modlist = var_InheritString(sys->embed, "gles2");
+        char *modlist = var_InheritString(vd->window, "gles2");
         vlc_gl_t *gl = vlc_gl_Create(vd->cfg, vd->window, VLC_OPENGL_ES2, modlist);
         free(modlist);
         if (gl == NULL)
@@ -673,8 +667,7 @@ static void Close(vout_display_t *vd)
     if (sys->p_sub_window)
         AndroidWindow_Destroy(vd, sys->p_sub_window);
 
-    if (sys->embed)
-        AWindowHandler_setVideoLayout(sys->p_awh, 0, 0, 0, 0, 0, 0);
+    AWindowHandler_setVideoLayout(sys->p_awh, 0, 0, 0, 0, 0, 0);
 
     free(sys);
 }
-- 
2.20.1



More information about the vlc-devel mailing list