[Android] VlcObject: Events: second argument is float

Thomas Guillem git at videolan.org
Wed Jul 1 15:14:30 CEST 2015


vlc-ports/android | branch: master | Thomas Guillem <thomas at gllm.fr> | Tue Jun 30 11:17:34 2015 +0200| [f7c52ecffc075f6fab0c764b60be9ba5fbd8a34a] | committer: Thomas Guillem

VlcObject: Events: second argument is float

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

 libvlc/jni/libvlcjni-vlcobject.c                    |    3 ++-
 libvlc/jni/libvlcjni-vlcobject.h                    |    2 +-
 libvlc/jni/libvlcjni.c                              |    4 ++--
 libvlc/src/org/videolan/libvlc/LibVLC.java          |    2 +-
 libvlc/src/org/videolan/libvlc/Media.java           |    2 +-
 libvlc/src/org/videolan/libvlc/MediaDiscoverer.java |    2 +-
 libvlc/src/org/videolan/libvlc/MediaList.java       |    2 +-
 libvlc/src/org/videolan/libvlc/MediaPlayer.java     |    2 +-
 libvlc/src/org/videolan/libvlc/VLCObject.java       |    6 +++---
 9 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/libvlc/jni/libvlcjni-vlcobject.c b/libvlc/jni/libvlcjni-vlcobject.c
index 9c40a19..dd7cdb2 100644
--- a/libvlc/jni/libvlcjni-vlcobject.c
+++ b/libvlc/jni/libvlcjni-vlcobject.c
@@ -177,7 +177,8 @@ VLCJniObject_eventCallback(const libvlc_event_t *ev, void *data)
     assert(p_obj->p_libvlc);
 
     jevent.type = -1;
-    jevent.arg1 = jevent.arg2 = 0;
+    jevent.arg1 = 0;
+    jevent.arg2 = 0.0;
 
     if (!p_obj->p_owner->pf_event_cb(p_obj, ev, &jevent))
         return;
diff --git a/libvlc/jni/libvlcjni-vlcobject.h b/libvlc/jni/libvlcjni-vlcobject.h
index 79f2e33..b22686b 100644
--- a/libvlc/jni/libvlcjni-vlcobject.h
+++ b/libvlc/jni/libvlcjni-vlcobject.h
@@ -60,7 +60,7 @@ struct java_event
 {
     jint type;
     jlong arg1;
-    jlong arg2;
+    jfloat arg2;
 };
 
 /* event manager callback dispatched to native struct implementing a
diff --git a/libvlc/jni/libvlcjni.c b/libvlc/jni/libvlcjni.c
index 0e10204..9be9fb9 100644
--- a/libvlc/jni/libvlcjni.c
+++ b/libvlc/jni/libvlcjni.c
@@ -192,7 +192,7 @@ jint JNI_OnLoad(JavaVM *vm, void *reserved)
     GET_ID(GetMethodID,
            fields.VLCObject.dispatchEventFromNativeID,
            fields.VLCObject.clazz,
-           "dispatchEventFromNative", "(IJJ)V");
+           "dispatchEventFromNative", "(IJF)V");
 
     if (fields.SDK_INT <= 10)
     {
@@ -204,7 +204,7 @@ jint JNI_OnLoad(JavaVM *vm, void *reserved)
         GET_ID(GetStaticMethodID,
                fields.VLCObject.dispatchEventFromWeakNativeID,
                fields.VLCObject.clazz,
-               "dispatchEventFromWeakNative", "(Ljava/lang/Object;IJJ)V");
+               "dispatchEventFromWeakNative", "(Ljava/lang/Object;IJF)V");
     } else
     {
         fields.VLCObject.getWeakReferenceID = NULL;
diff --git a/libvlc/src/org/videolan/libvlc/LibVLC.java b/libvlc/src/org/videolan/libvlc/LibVLC.java
index 1f6d85d..b200502 100644
--- a/libvlc/src/org/videolan/libvlc/LibVLC.java
+++ b/libvlc/src/org/videolan/libvlc/LibVLC.java
@@ -119,7 +119,7 @@ public class LibVLC extends VLCObject<LibVLC.Event> {
     private native void detachEventHandler();
 
     @Override
-    protected Event onEventNative(int eventType, long arg1, long arg2) {
+    protected Event onEventNative(int eventType, long arg1, float arg2) {
         return null;
     }
 
diff --git a/libvlc/src/org/videolan/libvlc/Media.java b/libvlc/src/org/videolan/libvlc/Media.java
index c70fac5..bfb7da2 100644
--- a/libvlc/src/org/videolan/libvlc/Media.java
+++ b/libvlc/src/org/videolan/libvlc/Media.java
@@ -350,7 +350,7 @@ public class Media extends VLCObject<Media.Event> {
     }
 
     @Override
-    protected synchronized Event onEventNative(int eventType, long arg1, long arg2) {
+    protected synchronized Event onEventNative(int eventType, long arg1, float arg2) {
         switch (eventType) {
         case Event.MetaChanged:
             // either we update all metas (if first call) or we update a specific meta
diff --git a/libvlc/src/org/videolan/libvlc/MediaDiscoverer.java b/libvlc/src/org/videolan/libvlc/MediaDiscoverer.java
index 65ba669..13fe07d 100644
--- a/libvlc/src/org/videolan/libvlc/MediaDiscoverer.java
+++ b/libvlc/src/org/videolan/libvlc/MediaDiscoverer.java
@@ -74,7 +74,7 @@ public class MediaDiscoverer extends VLCObject<MediaDiscoverer.Event> {
     }
 
     @Override
-    protected Event onEventNative(int eventType, long arg1, long arg2) {
+    protected Event onEventNative(int eventType, long arg1, float arg2) {
         switch (eventType) {
             case Event.Started:
             case Event.Ended:
diff --git a/libvlc/src/org/videolan/libvlc/MediaList.java b/libvlc/src/org/videolan/libvlc/MediaList.java
index d790b3d..1404cf3 100644
--- a/libvlc/src/org/videolan/libvlc/MediaList.java
+++ b/libvlc/src/org/videolan/libvlc/MediaList.java
@@ -121,7 +121,7 @@ public class MediaList extends VLCObject<MediaList.Event> {
     }
 
     @Override
-    protected synchronized Event onEventNative(int eventType, long arg1, long arg2) {
+    protected synchronized Event onEventNative(int eventType, long arg1, float arg2) {
         if (mLocked)
             throw new IllegalStateException("already locked from event callback");
         mLocked = true;
diff --git a/libvlc/src/org/videolan/libvlc/MediaPlayer.java b/libvlc/src/org/videolan/libvlc/MediaPlayer.java
index 03f23e5..a922930 100644
--- a/libvlc/src/org/videolan/libvlc/MediaPlayer.java
+++ b/libvlc/src/org/videolan/libvlc/MediaPlayer.java
@@ -326,7 +326,7 @@ public class MediaPlayer extends VLCObject<MediaPlayer.Event> implements AWindow
     }
 
     @Override
-    protected Event onEventNative(int eventType, long arg1, long arg2) {
+    protected Event onEventNative(int eventType, long arg1, float arg2) {
         /* TODO */
         return null;
     }
diff --git a/libvlc/src/org/videolan/libvlc/VLCObject.java b/libvlc/src/org/videolan/libvlc/VLCObject.java
index 5ff8f28..abcf40c 100644
--- a/libvlc/src/org/videolan/libvlc/VLCObject.java
+++ b/libvlc/src/org/videolan/libvlc/VLCObject.java
@@ -99,7 +99,7 @@ abstract class VLCObject<T extends VLCEvent> {
      * @param arg2 second argument
      * @return Event that will be dispatched to listeners
      */
-    protected abstract T onEventNative(int eventType, long arg1, long arg2);
+    protected abstract T onEventNative(int eventType, long arg1, float arg2);
 
     /**
      * Called when native object is released (refcount is 0).
@@ -111,7 +111,7 @@ abstract class VLCObject<T extends VLCEvent> {
     /* JNI */
     @SuppressWarnings("unused") /* Used from JNI */
     private long mInstance = 0;
-    private synchronized void dispatchEventFromNative(int eventType, long arg1, long arg2) {
+    private synchronized void dispatchEventFromNative(int eventType, long arg1, float arg2) {
         if (isReleased())
             return;
         final T event = onEventNative(eventType, arg1, arg2);
@@ -141,7 +141,7 @@ abstract class VLCObject<T extends VLCEvent> {
         return new WeakReference<VLCObject>(this);
     }
     @SuppressWarnings("unchecked,unused") /* Used from JNI */
-    private static void dispatchEventFromWeakNative(Object weak, int eventType, long arg1, long arg2) {
+    private static void dispatchEventFromWeakNative(Object weak, int eventType, long arg1, float arg2) {
         VLCObject obj = ((WeakReference<VLCObject>)weak).get();
         if (obj != null)
             obj.dispatchEventFromNative(eventType, arg1, arg2);



More information about the Android mailing list