[Android] [PATCH 05/24] jni: Correct the function prototypes
Edward Wang
edward.c.wang at compdigitec.com
Wed Aug 22 23:15:05 CEST 2012
---
vlc-android/jni/libvlcjni.c | 8 ++++----
vlc-android/jni/thumbnailer.c | 2 +-
vlc-android/jni/utils.h | 2 +-
vlc-android/src/org/videolan/vlc/LibVLC.java | 12 ++++++------
4 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/vlc-android/jni/libvlcjni.c b/vlc-android/jni/libvlcjni.c
index c0d98ee..244a55b 100644
--- a/vlc-android/jni/libvlcjni.c
+++ b/vlc-android/jni/libvlcjni.c
@@ -137,7 +137,7 @@ static void length_changed_callback(const libvlc_event_t *ev, void *data)
pthread_mutex_unlock(&monitor->doneMutex);
}
-libvlc_media_t *new_media(jint instance, JNIEnv *env, jobject thiz, jstring fileLocation, bool noOmx, bool noVideo)
+libvlc_media_t *new_media(jlong instance, JNIEnv *env, jobject thiz, jstring fileLocation, bool noOmx, bool noVideo)
{
libvlc_instance_t *libvlc = (libvlc_instance_t*)instance;
jboolean isCopy;
@@ -454,7 +454,7 @@ void Java_org_videolan_vlc_LibVLC_setEventManager(JNIEnv *env, jobject thiz, job
}
jobjectArray Java_org_videolan_vlc_LibVLC_readMediaMeta(JNIEnv *env,
- jobject thiz, jint instance, jstring mrl)
+ jobject thiz, jlong instance, jstring mrl)
{
jobjectArray array = (*env)->NewObjectArray(env, 8,
(*env)->FindClass(env, "java/lang/String"),
@@ -496,7 +496,7 @@ jobjectArray Java_org_videolan_vlc_LibVLC_readMediaMeta(JNIEnv *env,
}
void Java_org_videolan_vlc_LibVLC_readMedia(JNIEnv *env, jobject thiz,
- jint instance, jstring mrl, jboolean novideo)
+ jlong instance, jstring mrl, jboolean novideo)
{
/* Release previous media player, if any */
releaseMediaPlayer(env, thiz);
@@ -629,7 +629,7 @@ jboolean Java_org_videolan_vlc_LibVLC_hasVideoTrack(JNIEnv *env, jobject thiz,
}
jobjectArray Java_org_videolan_vlc_LibVLC_readTracksInfo(JNIEnv *env, jobject thiz,
- jint instance, jstring mrl)
+ jlong instance, jstring mrl)
{
/* get java class */
jclass cls = (*env)->FindClass( env, "org/videolan/vlc/TrackInfo" );
diff --git a/vlc-android/jni/thumbnailer.c b/vlc-android/jni/thumbnailer.c
index 151378b..a0f5a96 100644
--- a/vlc-android/jni/thumbnailer.c
+++ b/vlc-android/jni/thumbnailer.c
@@ -114,7 +114,7 @@ static void thumbnailer_unlock(void *opaque, void *picture, void *const *pixels)
* return null if the thumbail generation failed.
**/
jbyteArray Java_org_videolan_vlc_LibVLC_getThumbnail(JNIEnv *env, jobject thiz,
- jint instance, jstring filePath,
+ jlong instance, jstring filePath,
jint width, jint height)
{
libvlc_instance_t *libvlc = (libvlc_instance_t *)instance;
diff --git a/vlc-android/jni/utils.h b/vlc-android/jni/utils.h
index b1c36f8..5960f52 100644
--- a/vlc-android/jni/utils.h
+++ b/vlc-android/jni/utils.h
@@ -21,7 +21,7 @@
#ifndef LIBVLCJNI_UTILS_H
#define LIBVLCJNI_UTILS_H
-libvlc_media_t *new_media(jint libvlc, JNIEnv *env, jobject thiz, jstring filePath, bool noOmx, bool noVideo);
+libvlc_media_t *new_media(jlong instance, JNIEnv *env, jobject thiz, jstring fileLocation, bool noOmx, bool noVideo);
#endif // LIBVLCJNI_UTILS_H
diff --git a/vlc-android/src/org/videolan/vlc/LibVLC.java b/vlc-android/src/org/videolan/vlc/LibVLC.java
index 10dcdcd..4eb6675 100644
--- a/vlc-android/src/org/videolan/vlc/LibVLC.java
+++ b/vlc-android/src/org/videolan/vlc/LibVLC.java
@@ -312,7 +312,7 @@ public class LibVLC {
* @param instance: the instance of libVLC
* @param mrl: the media mrl
*/
- private native void readMedia(int instance, String mrl, boolean novideo);
+ private native void readMedia(long instance, String mrl, boolean novideo);
/**
* Return true if there is currently a running media player.
@@ -408,16 +408,16 @@ public class LibVLC {
* Get a media thumbnail.
* @return a bytearray with the RGBA thumbnail data inside.
*/
- private native byte[] getThumbnail(int instance, String mrl, int i_width, int i_height);
+ private native byte[] getThumbnail(long instance, String mrl, int i_width, int i_height);
/**
* Return true if there is a video track in the file
*/
- private native boolean hasVideoTrack(int instance, String mrl);
+ private native boolean hasVideoTrack(long instance, String mrl);
- private native String[] readMediaMeta(int instance, String mrl);
+ private native String[] readMediaMeta(long instance, String mrl);
- private native TrackInfo[] readTracksInfo(int instance, String mrl);
+ private native TrackInfo[] readTracksInfo(long instance, String mrl);
public native int getAudioTracksCount();
@@ -446,7 +446,7 @@ public class LibVLC {
/**
* Return the length of the stream, in milliseconds
*/
- private native long getLengthFromLocation(int instance, String mrl);
+ private native long getLengthFromLocation(long instance, String mrl);
private native void setEventManager(EventManager eventManager);
--
1.7.5.4
More information about the Android
mailing list