[Android] LibVLC: AWindow: declare native methods in the subclass

Thomas Guillem git at videolan.org
Mon Feb 29 15:26:21 CET 2016


vlc-android | branch: master | Thomas Guillem <thomas at gllm.fr> | Mon Feb 29 15:23:52 2016 +0100| [6fd9a0d44dff3250fbb86b4d0d8c39eb58111263] | committer: Thomas Guillem

LibVLC: AWindow: declare native methods in the subclass

Otherwise, old Android versions fail to register them.

> https://code.videolan.org/videolan/vlc-android/commit/6fd9a0d44dff3250fbb86b4d0d8c39eb58111263
---

 libvlc/src/org/videolan/libvlc/AWindow.java              | 7 +++++++
 libvlc/src/org/videolan/libvlc/AWindowNativeHandler.java | 5 ++---
 2 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/libvlc/src/org/videolan/libvlc/AWindow.java b/libvlc/src/org/videolan/libvlc/AWindow.java
index 26be97c..a3fc6ed 100644
--- a/libvlc/src/org/videolan/libvlc/AWindow.java
+++ b/libvlc/src/org/videolan/libvlc/AWindow.java
@@ -437,8 +437,15 @@ public class AWindow implements IVLCVout {
         return mAWindowNativeHandler;
     }
 
+    @SuppressWarnings("unused, JniMissingFunction")
     private final AWindowNativeHandler mAWindowNativeHandler = new AWindowNativeHandler() {
         @Override
+        protected native void nativeOnMouseEvent(long nativeHandle, int action, int button, int x, int y);
+
+        @Override
+        protected native void nativeOnWindowSize(long nativeHandle, int width, int height);
+
+        @Override
         public Surface getVideoSurface() {
             return getNativeSurface(ID_VIDEO);
         }
diff --git a/libvlc/src/org/videolan/libvlc/AWindowNativeHandler.java b/libvlc/src/org/videolan/libvlc/AWindowNativeHandler.java
index 8e3cb64..4598f58 100644
--- a/libvlc/src/org/videolan/libvlc/AWindowNativeHandler.java
+++ b/libvlc/src/org/videolan/libvlc/AWindowNativeHandler.java
@@ -22,7 +22,6 @@ package org.videolan.libvlc;
 
 import android.view.Surface;
 
- at SuppressWarnings("unused, JniMissingFunction")
 public abstract class AWindowNativeHandler {
     /**
      * Callback called from {@link IVLCVout#sendMouseEvent}.
@@ -33,7 +32,7 @@ public abstract class AWindowNativeHandler {
      * @param x x coordinate.
      * @param y y coordinate.
      */
-    protected native void nativeOnMouseEvent(long nativeHandle, int action, int button, int x, int y);
+    protected abstract void nativeOnMouseEvent(long nativeHandle, int action, int button, int x, int y);
 
     /**
      * Callback called from {@link IVLCVout#setWindowSize}.
@@ -42,7 +41,7 @@ public abstract class AWindowNativeHandler {
      * @param width width of the window.
      * @param height height of the window.
      */
-    protected native void nativeOnWindowSize(long nativeHandle, int width, int height);
+    protected abstract void nativeOnWindowSize(long nativeHandle, int width, int height);
 
     /**
      * Get the valid Video surface.



More information about the Android mailing list