[vlc-commits] vout: android: remove PRE-ICS setBuffersGeometry hack

Thomas Guillem git at videolan.org
Fri Feb 2 17:04:15 CET 2018


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Fri Feb  2 17:03:41 2018 +0100| [a16a24bce5e7e8fa6b2c05e63f5524e1d8df0640] | committer: Thomas Guillem

vout: android: remove PRE-ICS setBuffersGeometry hack

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=a16a24bce5e7e8fa6b2c05e63f5524e1d8df0640
---

 modules/video_output/android/display.c | 29 -----------------------------
 modules/video_output/android/utils.c   | 21 ---------------------
 modules/video_output/android/utils.h   | 10 ----------
 3 files changed, 60 deletions(-)

diff --git a/modules/video_output/android/display.c b/modules/video_output/android/display.c
index 9824a417e8..7e306da7c5 100644
--- a/modules/video_output/android/display.c
+++ b/modules/video_output/android/display.c
@@ -393,31 +393,6 @@ static void AndroidWindow_Destroy(vout_display_t *vd,
     free(p_window);
 }
 
-static int AndroidWindow_ConfigureJavaSurface(vout_display_sys_t *sys,
-                                              android_window *p_window,
-                                              bool *p_java_configured)
-{
-    /* setBuffersGeometry is broken before ics. Use
-     * AJavaWindow_setBuffersGeometry to configure the surface on the java side
-     * synchronously.  AJavaWindow_setBuffersGeometry return en error when you
-     * don't need to call it (ie, after ics). if this call succeed, you need to
-     * get a new surface handle. That's why AndroidWindow_DisconnectSurface is
-     * called here. */
-    if (AWindowHandler_setBuffersGeometry(sys->p_awh, p_window->id,
-                                          p_window->fmt.i_width,
-                                          p_window->fmt.i_height,
-                                          p_window->i_android_hal) == VLC_SUCCESS)
-    {
-        *p_java_configured = true;
-        AndroidWindow_DisconnectSurface(sys, p_window);
-        if (AndroidWindow_ConnectSurface(sys, p_window) != 0)
-            return -1;
-    } else
-        *p_java_configured = false;
-
-    return 0;
-}
-
 static int AndroidWindow_SetupANW(vout_display_sys_t *sys,
                                   android_window *p_window,
                                   bool b_java_configured)
@@ -453,10 +428,6 @@ static int AndroidWindow_Setup(vout_display_sys_t *sys,
         p_window->fmt.i_width = (p_pic->format.i_width + align_pixels) & ~align_pixels;
         picture_Release(p_pic);
 
-        if (AndroidWindow_ConfigureJavaSurface(sys, p_window,
-                                               &b_java_configured) != 0)
-            return -1;
-
         if (AndroidWindow_SetupANW(sys, p_window, b_java_configured) != 0)
             return -1;
     } else {
diff --git a/modules/video_output/android/utils.c b/modules/video_output/android/utils.c
index b59035ef89..de65746f18 100644
--- a/modules/video_output/android/utils.c
+++ b/modules/video_output/android/utils.c
@@ -79,7 +79,6 @@ static struct
         jmethodID getSubtitlesSurface;
         jmethodID registerNative;
         jmethodID unregisterNative;
-        jmethodID setBuffersGeometry;
         jmethodID setVideoLayout;
     } AndroidNativeWindow;
     struct {
@@ -424,8 +423,6 @@ InitJNIFields(JNIEnv *env, vlc_object_t *p_obj, jobject *jobj)
                "registerNative", "(J)I", true);
     GET_METHOD(AndroidNativeWindow.unregisterNative,
                "unregisterNative", "()V", true);
-    GET_METHOD(AndroidNativeWindow.setBuffersGeometry,
-               "setBuffersGeometry", "(Landroid/view/Surface;III)Z", true);
     GET_METHOD(AndroidNativeWindow.setVideoLayout,
                "setVideoLayout", "(IIIIII)V", true);
 
@@ -685,24 +682,6 @@ AndroidNativeWindow_onWindowSize(JNIEnv* env, jobject clazz, jlong handle,
         p_awh->event.cb.on_new_window_size(p_awh->wnd, width, height);
 }
 
-int
-AWindowHandler_setBuffersGeometry(AWindowHandler *p_awh, enum AWindow_ID id,
-                                  int i_width, int i_height, int i_format)
-{
-    jobject jsurf;
-    JNIEnv *p_env = AWindowHandler_getEnv(p_awh);
-    if (!p_env)
-        return VLC_EGENERIC;
-
-    jsurf = AWindowHandler_getSurface(p_awh, id);
-    if (!jsurf)
-        return VLC_EGENERIC;
-
-    return JNI_ANWCALL(CallBooleanMethod, setBuffersGeometry,
-                       jsurf, i_width, i_height, i_format) ? VLC_SUCCESS
-                                                           : VLC_EGENERIC;
-}
-
 bool
 AWindowHandler_canSetVideoLayout(AWindowHandler *p_awh)
 {
diff --git a/modules/video_output/android/utils.h b/modules/video_output/android/utils.h
index 3684cd4eca..5d61a30991 100644
--- a/modules/video_output/android/utils.h
+++ b/modules/video_output/android/utils.h
@@ -118,16 +118,6 @@ ANativeWindow *AWindowHandler_getANativeWindow(AWindowHandler *p_awh,
  */
 void AWindowHandler_releaseANativeWindow(AWindowHandler *p_awh,
                                          enum AWindow_ID id);
-/**
- * Pre-ICS hack of ANativeWindow_setBuffersGeometry
- *
- * This function is a fix up of ANativeWindow_setBuffersGeometry that doesn't
- * work before Android ICS. It configures the Surface from the Android
- * MainThread via a SurfaceHolder. It returns VLC_SUCCESS if the Surface was
- * configured (it returns VLC_EGENERIC after Android ICS).
- */
-int AWindowHandler_setBuffersGeometry(AWindowHandler *p_awh, enum AWindow_ID id,
-                                      int i_width, int i_height, int i_format);
 
 /**
  * Returns true if the video layout can be changed



More information about the vlc-commits mailing list