Commit 4e25b568 authored by Sébastien Toque's avatar Sébastien Toque

LibVLC: move to org.videolan.libvlc

TODO: remove dependencies to :
- VLCApplication
- VideoPlayerActivity (use an interface)
- Preferences
- Util.readAsset
parent 702ea35e
......@@ -335,7 +335,7 @@ void JNI_OnUnload(JavaVM* vm, void* reserved) {
pthread_mutex_destroy(&vout_android_lock);
}
void Java_org_videolan_vlc_LibVLC_attachSurface(JNIEnv *env, jobject thiz, jobject surf, jobject gui, jint width, jint height) {
void Java_org_videolan_libvlc_LibVLC_attachSurface(JNIEnv *env, jobject thiz, jobject surf, jobject gui, jint width, jint height) {
jclass clz;
jfieldID fid;
......@@ -357,7 +357,7 @@ void Java_org_videolan_vlc_LibVLC_attachSurface(JNIEnv *env, jobject thiz, jobje
pthread_mutex_unlock(&vout_android_lock);
}
void Java_org_videolan_vlc_LibVLC_detachSurface(JNIEnv *env, jobject thiz) {
void Java_org_videolan_libvlc_LibVLC_detachSurface(JNIEnv *env, jobject thiz) {
pthread_mutex_lock(&vout_android_lock);
vout_android_surf = NULL;
if (vout_android_gui != NULL)
......@@ -435,15 +435,15 @@ static void debug_log(void *data, int level, const libvlc_log_t *ctx, const char
__android_log_vprint(prio, "VLC", fmt, ap);
}
void Java_org_videolan_vlc_LibVLC_changeVerbosity(JNIEnv *env, jobject thiz, jboolean verbose)
void Java_org_videolan_libvlc_LibVLC_changeVerbosity(JNIEnv *env, jobject thiz, jboolean verbose)
{
verbosity = verbose;
}
void Java_org_videolan_vlc_LibVLC_startDebugBuffer(JNIEnv *env, jobject thiz)
void Java_org_videolan_libvlc_LibVLC_startDebugBuffer(JNIEnv *env, jobject thiz)
{
jclass libVLC_class = (*env)->FindClass(env, "org/videolan/vlc/LibVLC");
jmethodID getInstance = (*env)->GetStaticMethodID(env, libVLC_class, "getInstance", "()Lorg/videolan/vlc/LibVLC;");
jclass libVLC_class = (*env)->FindClass(env, "org/videolan/libvlc/LibVLC");
jmethodID getInstance = (*env)->GetStaticMethodID(env, libVLC_class, "getInstance", "()Lorg/videolan/libvlc/LibVLC;");
jobject libvlcj = (*env)->CallStaticObjectMethod(env, libVLC_class, getInstance);
jfieldID bufferID = (*env)->GetFieldID(env, libVLC_class, "mDebugLogBuffer", "Ljava/lang/StringBuffer;");
......@@ -460,11 +460,11 @@ void Java_org_videolan_vlc_LibVLC_startDebugBuffer(JNIEnv *env, jobject thiz)
buffer_logging = true;
}
void Java_org_videolan_vlc_LibVLC_stopDebugBuffer(JNIEnv *env, jobject thiz)
void Java_org_videolan_libvlc_LibVLC_stopDebugBuffer(JNIEnv *env, jobject thiz)
{
buffer_logging = false;
jclass libVLC_class = (*env)->FindClass(env, "org/videolan/vlc/LibVLC");
jmethodID getInstance = (*env)->GetStaticMethodID(env, libVLC_class, "getInstance", "()Lorg/videolan/vlc/LibVLC;");
jclass libVLC_class = (*env)->FindClass(env, "org/videolan/libvlc/LibVLC");
jmethodID getInstance = (*env)->GetStaticMethodID(env, libVLC_class, "getInstance", "()Lorg/videolan/libvlc/LibVLC;");
jobject libvlcj = (*env)->CallStaticObjectMethod(env, libVLC_class, getInstance);
(*env)->DeleteGlobalRef(env, debugBufferInstance);
......@@ -476,7 +476,7 @@ void Java_org_videolan_vlc_LibVLC_stopDebugBuffer(JNIEnv *env, jobject thiz)
(*env)->DeleteLocalRef(env, libvlcj);
}
void Java_org_videolan_vlc_LibVLC_nativeInit(JNIEnv *env, jobject thiz, jboolean verbose)
void Java_org_videolan_libvlc_LibVLC_nativeInit(JNIEnv *env, jobject thiz, jboolean verbose)
{
//only use OpenSLES if java side says we can
jclass cls = (*env)->GetObjectClass(env, thiz);
......@@ -520,7 +520,7 @@ void Java_org_videolan_vlc_LibVLC_nativeInit(JNIEnv *env, jobject thiz, jboolean
if (!instance)
{
jclass exc = (*env)->FindClass(env, "org/videolan/vlc/LibVlcException");
jclass exc = (*env)->FindClass(env, "org/videolan/libvlc/LibVlcException");
(*env)->ThrowNew(env, exc, "Unable to instantiate LibVLC");
}
......@@ -532,7 +532,7 @@ void Java_org_videolan_vlc_LibVLC_nativeInit(JNIEnv *env, jobject thiz, jboolean
/* Initialize media list (a.k.a. playlist/history) */
libvlc_media_list_t* pointer = libvlc_media_list_new( instance );
if(!pointer) {
jclass exc = (*env)->FindClass(env, "org/videolan/vlc/LibVlcException");
jclass exc = (*env)->FindClass(env, "org/videolan/libvlc/LibVlcException");
(*env)->ThrowNew(env, exc, "Unable to create LibVLC media list");
return;
}
......@@ -549,7 +549,7 @@ void Java_org_videolan_vlc_LibVLC_nativeInit(JNIEnv *env, jobject thiz, jboolean
setLong(env, thiz, "mMediaListInstance", (jlong)(intptr_t)pointer);
}
jstring Java_org_videolan_vlc_LibVLC_nativeToURI(JNIEnv *env, jobject thiz, jstring path)
jstring Java_org_videolan_libvlc_LibVLC_nativeToURI(JNIEnv *env, jobject thiz, jstring path)
{
jboolean isCopy;
/* Get C string */
......@@ -568,7 +568,7 @@ jstring Java_org_videolan_vlc_LibVLC_nativeToURI(JNIEnv *env, jobject thiz, jstr
return t;
}
void Java_org_videolan_vlc_LibVLC_nativeDestroy(JNIEnv *env, jobject thiz)
void Java_org_videolan_libvlc_LibVLC_nativeDestroy(JNIEnv *env, jobject thiz)
{
releaseMediaPlayer(env, thiz);
jlong libVlcInstance = getLong(env, thiz, "mLibVlcInstance");
......@@ -582,7 +582,7 @@ void Java_org_videolan_vlc_LibVLC_nativeDestroy(JNIEnv *env, jobject thiz)
setLong(env, thiz, "mLibVlcInstance", 0);
}
void Java_org_videolan_vlc_LibVLC_detachEventHandler(JNIEnv *env, jobject thiz)
void Java_org_videolan_libvlc_LibVLC_detachEventHandler(JNIEnv *env, jobject thiz)
{
if (eventHandlerInstance != NULL) {
(*env)->DeleteGlobalRef(env, eventHandlerInstance);
......@@ -590,7 +590,7 @@ void Java_org_videolan_vlc_LibVLC_detachEventHandler(JNIEnv *env, jobject thiz)
}
}
void Java_org_videolan_vlc_LibVLC_setEventHandler(JNIEnv *env, jobject thiz, jobject eventHandler)
void Java_org_videolan_libvlc_LibVLC_setEventHandler(JNIEnv *env, jobject thiz, jobject eventHandler)
{
if (eventHandlerInstance != NULL) {
(*env)->DeleteGlobalRef(env, eventHandlerInstance);
......@@ -612,7 +612,7 @@ void Java_org_videolan_vlc_LibVLC_setEventHandler(JNIEnv *env, jobject thiz, job
eventHandlerInstance = (*env)->NewGlobalRef(env, eventHandler);
}
jobjectArray Java_org_videolan_vlc_LibVLC_readMediaMeta(JNIEnv *env,
jobjectArray Java_org_videolan_libvlc_LibVLC_readMediaMeta(JNIEnv *env,
jobject thiz, jlong instance, jstring mrl)
{
jobjectArray array = (*env)->NewObjectArray(env, 8,
......@@ -701,7 +701,7 @@ static void create_player_and_play(JNIEnv* env, jobject thiz,
libvlc_media_list_player_play_item_at_index(p_mlp, position);
}
jint Java_org_videolan_vlc_LibVLC_readMedia(JNIEnv *env, jobject thiz,
jint Java_org_videolan_libvlc_LibVLC_readMedia(JNIEnv *env, jobject thiz,
jlong instance, jstring mrl, jboolean novideo)
{
/* Create a new item */
......@@ -732,12 +732,12 @@ jint Java_org_videolan_vlc_LibVLC_readMedia(JNIEnv *env, jobject thiz,
return position;
}
void Java_org_videolan_vlc_LibVLC_playIndex(JNIEnv *env, jobject thiz,
void Java_org_videolan_libvlc_LibVLC_playIndex(JNIEnv *env, jobject thiz,
jlong instance, int position) {
create_player_and_play(env, thiz, instance, position);
}
void Java_org_videolan_vlc_LibVLC_getMediaListItems(
void Java_org_videolan_libvlc_LibVLC_getMediaListItems(
JNIEnv *env, jobject thiz, jobject arrayList) {
jclass arrayClass = (*env)->FindClass(env, "java/util/ArrayList");
jmethodID methodID = (*env)->GetMethodID(env, arrayClass, "add", "(Ljava/lang/Object;)Z");
......@@ -755,7 +755,7 @@ void Java_org_videolan_vlc_LibVLC_getMediaListItems(
libvlc_media_list_unlock( p_mlist );
}
jfloat Java_org_videolan_vlc_LibVLC_getRate(JNIEnv *env, jobject thiz) {
jfloat Java_org_videolan_libvlc_LibVLC_getRate(JNIEnv *env, jobject thiz) {
libvlc_media_player_t* mp = getMediaPlayer(env, thiz);
if(mp)
return libvlc_media_player_get_rate(mp);
......@@ -763,13 +763,13 @@ jfloat Java_org_videolan_vlc_LibVLC_getRate(JNIEnv *env, jobject thiz) {
return 1.00;
}
void Java_org_videolan_vlc_LibVLC_setRate(JNIEnv *env, jobject thiz, jfloat rate) {
void Java_org_videolan_libvlc_LibVLC_setRate(JNIEnv *env, jobject thiz, jfloat rate) {
libvlc_media_player_t* mp = getMediaPlayer(env, thiz);
if(mp)
libvlc_media_player_set_rate(mp, rate);
}
jboolean Java_org_videolan_vlc_LibVLC_hasVideoTrack(JNIEnv *env, jobject thiz,
jboolean Java_org_videolan_libvlc_LibVLC_hasVideoTrack(JNIEnv *env, jobject thiz,
jlong i_instance, jstring fileLocation)
{
/* Create a new item and assign it to the media player. */
......@@ -837,10 +837,10 @@ jboolean Java_org_videolan_vlc_LibVLC_hasVideoTrack(JNIEnv *env, jobject thiz,
jobjectArray read_track_info_internal(JNIEnv *env, jobject thiz, libvlc_media_t* p_m)
{
/* get java class */
jclass cls = (*env)->FindClass( env, "org/videolan/vlc/TrackInfo" );
jclass cls = (*env)->FindClass( env, "org/videolan/libvlc/TrackInfo" );
if ( !cls )
{
LOGE("Failed to load class (org/videolan/vlc/TrackInfo)" );
LOGE("Failed to load class (org/videolan/libvlc/TrackInfo)" );
return NULL;
}
......@@ -848,7 +848,7 @@ jobjectArray read_track_info_internal(JNIEnv *env, jobject thiz, libvlc_media_t*
jmethodID clsCtor = (*env)->GetMethodID( env, cls, "<init>", "()V" );
if ( !clsCtor )
{
LOGE("Failed to find class constructor (org/videolan/vlc/TrackInfo)" );
LOGE("Failed to find class constructor (org/videolan/libvlc/TrackInfo)" );
return NULL;
}
......@@ -905,7 +905,7 @@ jobjectArray read_track_info_internal(JNIEnv *env, jobject thiz, libvlc_media_t*
}
jobjectArray Java_org_videolan_vlc_LibVLC_readTracksInfo(JNIEnv *env, jobject thiz,
jobjectArray Java_org_videolan_libvlc_LibVLC_readTracksInfo(JNIEnv *env, jobject thiz,
jlong instance, jstring mrl)
{
/* Create a new item and assign it to the media player. */
......@@ -923,7 +923,7 @@ jobjectArray Java_org_videolan_vlc_LibVLC_readTracksInfo(JNIEnv *env, jobject th
}
jobjectArray Java_org_videolan_vlc_LibVLC_readTracksInfoPosition(JNIEnv *env, jobject thiz,
jobjectArray Java_org_videolan_libvlc_LibVLC_readTracksInfoPosition(JNIEnv *env, jobject thiz,
jint position)
{
libvlc_media_list_t* p_mlist = getMediaList(env, thiz);
......@@ -935,7 +935,7 @@ jobjectArray Java_org_videolan_vlc_LibVLC_readTracksInfoPosition(JNIEnv *env, jo
return read_track_info_internal(env, thiz, p_m);
}
jlong Java_org_videolan_vlc_LibVLC_getLengthFromLocation(JNIEnv *env, jobject thiz,
jlong Java_org_videolan_libvlc_LibVLC_getLengthFromLocation(JNIEnv *env, jobject thiz,
jlong i_instance, jstring fileLocation)
{
jlong length = 0;
......@@ -981,12 +981,12 @@ end:
return length;
}
jboolean Java_org_videolan_vlc_LibVLC_hasMediaPlayer(JNIEnv *env, jobject thiz)
jboolean Java_org_videolan_libvlc_LibVLC_hasMediaPlayer(JNIEnv *env, jobject thiz)
{
return !!getMediaListPlayer(env, thiz);
}
jboolean Java_org_videolan_vlc_LibVLC_isPlaying(JNIEnv *env, jobject thiz)
jboolean Java_org_videolan_libvlc_LibVLC_isPlaying(JNIEnv *env, jobject thiz)
{
libvlc_media_list_player_t *mp = getMediaListPlayer(env, thiz);
if (mp)
......@@ -995,7 +995,7 @@ jboolean Java_org_videolan_vlc_LibVLC_isPlaying(JNIEnv *env, jobject thiz)
return 0;
}
jboolean Java_org_videolan_vlc_LibVLC_isSeekable(JNIEnv *env, jobject thiz)
jboolean Java_org_videolan_libvlc_LibVLC_isSeekable(JNIEnv *env, jobject thiz)
{
libvlc_media_player_t *mp = getMediaPlayer(env, thiz);
if (mp)
......@@ -1003,42 +1003,42 @@ jboolean Java_org_videolan_vlc_LibVLC_isSeekable(JNIEnv *env, jobject thiz)
return 0;
}
void Java_org_videolan_vlc_LibVLC_play(JNIEnv *env, jobject thiz)
void Java_org_videolan_libvlc_LibVLC_play(JNIEnv *env, jobject thiz)
{
libvlc_media_list_player_t *mp = getMediaListPlayer(env, thiz);
if (mp)
libvlc_media_list_player_play(mp);
}
void Java_org_videolan_vlc_LibVLC_pause(JNIEnv *env, jobject thiz)
void Java_org_videolan_libvlc_LibVLC_pause(JNIEnv *env, jobject thiz)
{
libvlc_media_list_player_t *mp = getMediaListPlayer(env, thiz);
if (mp)
libvlc_media_list_player_pause(mp);
}
void Java_org_videolan_vlc_LibVLC_stop(JNIEnv *env, jobject thiz)
void Java_org_videolan_libvlc_LibVLC_stop(JNIEnv *env, jobject thiz)
{
libvlc_media_list_player_t *mp = getMediaListPlayer(env, thiz);
if (mp)
libvlc_media_list_player_stop(mp);
}
void Java_org_videolan_vlc_LibVLC_previous(JNIEnv *env, jobject thiz)
void Java_org_videolan_libvlc_LibVLC_previous(JNIEnv *env, jobject thiz)
{
libvlc_media_list_player_t *mp = getMediaListPlayer(env, thiz);
if (mp)
libvlc_media_list_player_previous(mp);
}
void Java_org_videolan_vlc_LibVLC_next(JNIEnv *env, jobject thiz)
void Java_org_videolan_libvlc_LibVLC_next(JNIEnv *env, jobject thiz)
{
libvlc_media_list_player_t *mp = getMediaListPlayer(env, thiz);
if (mp)
libvlc_media_list_player_next(mp);
}
jint Java_org_videolan_vlc_LibVLC_getVolume(JNIEnv *env, jobject thiz)
jint Java_org_videolan_libvlc_LibVLC_getVolume(JNIEnv *env, jobject thiz)
{
libvlc_media_player_t *mp = getMediaPlayer(env, thiz);
if (mp)
......@@ -1046,7 +1046,7 @@ jint Java_org_videolan_vlc_LibVLC_getVolume(JNIEnv *env, jobject thiz)
return -1;
}
jint Java_org_videolan_vlc_LibVLC_setVolume(JNIEnv *env, jobject thiz, jint volume)
jint Java_org_videolan_libvlc_LibVLC_setVolume(JNIEnv *env, jobject thiz, jint volume)
{
libvlc_media_player_t *mp = getMediaPlayer(env, thiz);
if (mp)
......@@ -1055,7 +1055,7 @@ jint Java_org_videolan_vlc_LibVLC_setVolume(JNIEnv *env, jobject thiz, jint volu
return -1;
}
jlong Java_org_videolan_vlc_LibVLC_getTime(JNIEnv *env, jobject thiz)
jlong Java_org_videolan_libvlc_LibVLC_getTime(JNIEnv *env, jobject thiz)
{
libvlc_media_player_t *mp = getMediaPlayer(env, thiz);
if (mp)
......@@ -1063,14 +1063,14 @@ jlong Java_org_videolan_vlc_LibVLC_getTime(JNIEnv *env, jobject thiz)
return -1;
}
void Java_org_videolan_vlc_LibVLC_setTime(JNIEnv *env, jobject thiz, jlong time)
void Java_org_videolan_libvlc_LibVLC_setTime(JNIEnv *env, jobject thiz, jlong time)
{
libvlc_media_player_t *mp = getMediaPlayer(env, thiz);
if (mp)
libvlc_media_player_set_time(mp, time);
}
jfloat Java_org_videolan_vlc_LibVLC_getPosition(JNIEnv *env, jobject thiz)
jfloat Java_org_videolan_libvlc_LibVLC_getPosition(JNIEnv *env, jobject thiz)
{
libvlc_media_player_t *mp = getMediaPlayer(env, thiz);
if (mp)
......@@ -1078,14 +1078,14 @@ jfloat Java_org_videolan_vlc_LibVLC_getPosition(JNIEnv *env, jobject thiz)
return -1;
}
void Java_org_videolan_vlc_LibVLC_setPosition(JNIEnv *env, jobject thiz, jfloat pos)
void Java_org_videolan_libvlc_LibVLC_setPosition(JNIEnv *env, jobject thiz, jfloat pos)
{
libvlc_media_player_t *mp = getMediaPlayer(env, thiz);
if (mp)
libvlc_media_player_set_position(mp, pos);
}
jlong Java_org_videolan_vlc_LibVLC_getLength(JNIEnv *env, jobject thiz)
jlong Java_org_videolan_libvlc_LibVLC_getLength(JNIEnv *env, jobject thiz)
{
libvlc_media_player_t *mp = getMediaPlayer(env, thiz);
if (mp)
......@@ -1093,22 +1093,22 @@ jlong Java_org_videolan_vlc_LibVLC_getLength(JNIEnv *env, jobject thiz)
return -1;
}
jstring Java_org_videolan_vlc_LibVLC_version(JNIEnv* env, jobject thiz)
jstring Java_org_videolan_libvlc_LibVLC_version(JNIEnv* env, jobject thiz)
{
return (*env)->NewStringUTF(env, libvlc_get_version());
}
jstring Java_org_videolan_vlc_LibVLC_compiler(JNIEnv* env, jobject thiz)
jstring Java_org_videolan_libvlc_LibVLC_compiler(JNIEnv* env, jobject thiz)
{
return (*env)->NewStringUTF(env, libvlc_get_compiler());
}
jstring Java_org_videolan_vlc_LibVLC_changeset(JNIEnv* env, jobject thiz)
jstring Java_org_videolan_libvlc_LibVLC_changeset(JNIEnv* env, jobject thiz)
{
return (*env)->NewStringUTF(env, libvlc_get_changeset());
}
jint Java_org_videolan_vlc_LibVLC_getAudioTracksCount(JNIEnv *env, jobject thiz)
jint Java_org_videolan_libvlc_LibVLC_getAudioTracksCount(JNIEnv *env, jobject thiz)
{
libvlc_media_player_t *mp = getMediaPlayer(env, thiz);
if (mp)
......@@ -1116,7 +1116,7 @@ jint Java_org_videolan_vlc_LibVLC_getAudioTracksCount(JNIEnv *env, jobject thiz)
return -1;
}
jobject Java_org_videolan_vlc_LibVLC_getAudioTrackDescription(JNIEnv *env, jobject thiz)
jobject Java_org_videolan_libvlc_LibVLC_getAudioTrackDescription(JNIEnv *env, jobject thiz)
{
libvlc_media_player_t *mp = getMediaPlayer(env, thiz);
if (!mp)
......@@ -1159,7 +1159,7 @@ jobject Java_org_videolan_vlc_LibVLC_getAudioTrackDescription(JNIEnv *env, jobje
return audioTrackMap;
}
jint Java_org_videolan_vlc_LibVLC_getAudioTrack(JNIEnv *env, jobject thiz)
jint Java_org_videolan_libvlc_LibVLC_getAudioTrack(JNIEnv *env, jobject thiz)
{
libvlc_media_player_t *mp = getMediaPlayer(env, thiz);
if (mp)
......@@ -1167,7 +1167,7 @@ jint Java_org_videolan_vlc_LibVLC_getAudioTrack(JNIEnv *env, jobject thiz)
return -1;
}
jint Java_org_videolan_vlc_LibVLC_setAudioTrack(JNIEnv *env, jobject thiz, jint index)
jint Java_org_videolan_libvlc_LibVLC_setAudioTrack(JNIEnv *env, jobject thiz, jint index)
{
libvlc_media_player_t *mp = getMediaPlayer(env, thiz);
if (mp)
......@@ -1175,7 +1175,7 @@ jint Java_org_videolan_vlc_LibVLC_setAudioTrack(JNIEnv *env, jobject thiz, jint
return -1;
}
jint Java_org_videolan_vlc_LibVLC_getVideoTracksCount(JNIEnv *env, jobject thiz)
jint Java_org_videolan_libvlc_LibVLC_getVideoTracksCount(JNIEnv *env, jobject thiz)
{
libvlc_media_player_t *mp = getMediaPlayer(env, thiz);
if (mp)
......@@ -1183,7 +1183,7 @@ jint Java_org_videolan_vlc_LibVLC_getVideoTracksCount(JNIEnv *env, jobject thiz)
return -1;
}
jobject Java_org_videolan_vlc_LibVLC_getSpuTrackDescription(JNIEnv *env, jobject thiz)
jobject Java_org_videolan_libvlc_LibVLC_getSpuTrackDescription(JNIEnv *env, jobject thiz)
{
libvlc_media_player_t *mp = getMediaPlayer(env, thiz);
if (!mp)
......@@ -1224,7 +1224,7 @@ jobject Java_org_videolan_vlc_LibVLC_getSpuTrackDescription(JNIEnv *env, jobject
return spuTrackMap;
}
jint Java_org_videolan_vlc_LibVLC_getSpuTracksCount(JNIEnv *env, jobject thiz)
jint Java_org_videolan_libvlc_LibVLC_getSpuTracksCount(JNIEnv *env, jobject thiz)
{
libvlc_media_player_t *mp = getMediaPlayer(env, thiz);
if (mp)
......@@ -1232,7 +1232,7 @@ jint Java_org_videolan_vlc_LibVLC_getSpuTracksCount(JNIEnv *env, jobject thiz)
return -1;
}
jint Java_org_videolan_vlc_LibVLC_getSpuTrack(JNIEnv *env, jobject thiz)
jint Java_org_videolan_libvlc_LibVLC_getSpuTrack(JNIEnv *env, jobject thiz)
{
libvlc_media_player_t *mp = getMediaPlayer(env, thiz);
if (mp)
......@@ -1240,7 +1240,7 @@ jint Java_org_videolan_vlc_LibVLC_getSpuTrack(JNIEnv *env, jobject thiz)
return -1;
}
jint Java_org_videolan_vlc_LibVLC_setSpuTrack(JNIEnv *env, jobject thiz, jint index)
jint Java_org_videolan_libvlc_LibVLC_setSpuTrack(JNIEnv *env, jobject thiz, jint index)
{
libvlc_media_player_t *mp = getMediaPlayer(env, thiz);
if (mp)
......@@ -1248,7 +1248,7 @@ jint Java_org_videolan_vlc_LibVLC_setSpuTrack(JNIEnv *env, jobject thiz, jint in
return -1;
}
void Java_org_videolan_vlc_LibVLC_nativeReadDirectory(JNIEnv *env, jobject thiz, jstring path, jobject arrayList)
void Java_org_videolan_libvlc_LibVLC_nativeReadDirectory(JNIEnv *env, jobject thiz, jstring path, jobject arrayList)
{
jboolean isCopy;
/* Get C string */
......@@ -1280,7 +1280,7 @@ void Java_org_videolan_vlc_LibVLC_nativeReadDirectory(JNIEnv *env, jobject thiz,
closedir(p_dir);
}
jboolean Java_org_videolan_vlc_LibVLC_nativeIsPathDirectory(JNIEnv *env, jobject thiz, jstring path)
jboolean Java_org_videolan_libvlc_LibVLC_nativeIsPathDirectory(JNIEnv *env, jobject thiz, jstring path)
{
jboolean isCopy;
/* Get C string */
......
......@@ -134,9 +134,9 @@ static void thumbnailer_unlock(void *opaque, void *picture, void *const *pixels)
* Thumbnailer main function.
* return null if the thumbail generation failed.
**/
jbyteArray Java_org_videolan_vlc_LibVLC_getThumbnail(JNIEnv *env, jobject thiz,
jlong instance, jstring filePath,
const jint frameWidth, const jint frameHeight)
jbyteArray Java_org_videolan_libvlc_LibVLC_getThumbnail(JNIEnv *env, jobject thiz,
jlong instance, jstring filePath,
const jint frameWidth, const jint frameHeight)
{
libvlc_instance_t *libvlc = (libvlc_instance_t *)(intptr_t)instance;
jbyteArray byteArray = NULL;
......
......@@ -18,7 +18,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
package org.videolan.vlc;
package org.videolan.libvlc;
import android.media.AudioFormat;
import android.media.AudioManager;
......
......@@ -18,7 +18,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
package org.videolan.vlc;
package org.videolan.libvlc;
import java.util.ArrayList;
......
......@@ -18,11 +18,12 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
package org.videolan.vlc;
package org.videolan.libvlc;
import java.util.ArrayList;
import java.util.Map;
import org.videolan.vlc.VLCApplication;
import org.videolan.vlc.gui.video.VideoPlayerActivity;
import android.content.SharedPreferences;
......@@ -169,7 +170,7 @@ public class LibVLC {
}
public int getAout() {
final SharedPreferences p = PreferenceManager.getDefaultSharedPreferences(VLCApplication.getAppContext());
int defaultAout = Util.isGingerbreadOrLater() ? AOUT_OPENSLES : AOUT_AUDIOTRACK_JAVA;
int defaultAout = LibVlcUtil.isGingerbreadOrLater() ? AOUT_OPENSLES : AOUT_AUDIOTRACK_JAVA;
int aout = defaultAout;
try {
aout = Integer.parseInt(p.getString("aout", String.valueOf(defaultAout)));
......@@ -186,7 +187,7 @@ public class LibVLC {
public String getChroma() {
final SharedPreferences p = PreferenceManager.getDefaultSharedPreferences(VLCApplication.getAppContext());
String chroma = p.getString("chroma_format", "");
return chroma.equals("YV12") && !Util.isGingerbreadOrLater() ? "" : chroma;
return chroma.equals("YV12") && !LibVlcUtil.isGingerbreadOrLater() ? "" : chroma;
}
/**
......@@ -196,8 +197,8 @@ public class LibVLC {
Log.v(TAG, "Initializing LibVLC");
mDebugLogBuffer = new StringBuffer();
if (!mIsInitialized) {
if(!Util.hasCompatibleCPU()) {
Log.e(TAG, Util.getErrorMsg());
if(!LibVlcUtil.hasCompatibleCPU()) {
Log.e(TAG, LibVlcUtil.getErrorMsg());
throw new LibVlcException();
}
SharedPreferences pref = PreferenceManager.getDefaultSharedPreferences(VLCApplication.getAppContext());
......@@ -501,6 +502,13 @@ public class LibVLC {
public static native String nativeToURI(String path);
public static String PathToURI(String path) {
if(path == null) {
throw new NullPointerException("Cannot convert null path!");
}
return LibVLC.nativeToURI(path);
}
public static native void nativeReadDirectory(String path, ArrayList<String> res);
public native static boolean nativeIsPathDirectory(String path);
......
......@@ -21,7 +21,7 @@
/**
* LibVlcException: exceptions thrown by the native LibVLC interface
*/
package org.videolan.vlc;
package org.videolan.libvlc;
/**
* @author jpeg
......
/*****************************************************************************
* LibVlcUtil.java
*****************************************************************************
* Copyright © 2011-2012 VLC authors and VideoLAN
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
package org.videolan.libvlc;
import java.io.BufferedReader;
import java.io.ByteArrayInputStream;
import java.io.FileReader;
import java.io.IOException;
import java.util.Properties;
import org.videolan.vlc.Util;
import org.videolan.vlc.VLCApplication;
import android.util.Log;
public class LibVlcUtil {
public final static String TAG = "LibVlc/Util";
public static boolean isFroyoOrLater()
{
return android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.FROYO;
}
public static boolean isGingerbreadOrLater()
{
return android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.GINGERBREAD;
}
public static boolean isHoneycombOrLater()
{
return android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.HONEYCOMB;
}
public static boolean isICSOrLater()
{
return android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.ICE_CREAM_SANDWICH;
}
public static boolean isJellyBeanOrLater()
{
return android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.JELLY_BEAN;