android-vlc on android 2.1 nativeInit();

VLC for Android and Chrome OS specific usage questions
kick_2012
Blank Cone
Blank Cone
Posts: 13
Joined: 15 May 2012 14:42

android-vlc on android 2.1 nativeInit();

Postby kick_2012 » 29 May 2012 10:42

hello everyone.
i run the project on android 2.1,libvlcjni.so is loaded,but when it comes to nativeInit();,the project crashed.
what should i do ,can anybody help me here?
thanks.

Jean-Baptiste Kempf
Site Administrator
Site Administrator
Posts: 37523
Joined: 22 Jul 2005 15:29
VLC version: 4.0.0-git
Operating System: Linux, Windows, Mac
Location: Cone, France
Contact:

Re: android-vlc on android 2.1 nativeInit();

Postby Jean-Baptiste Kempf » 29 May 2012 10:52

You should debug it.

Seriously, how can you expect people to answer to such vague questions?
Jean-Baptiste Kempf
http://www.jbkempf.com/ - http://www.jbkempf.com/blog/category/Videolan
VLC media player developer, VideoLAN President and Sites administrator
If you want an answer to your question, just be specific and precise. Don't use Private Messages.

kick_2012
Blank Cone
Blank Cone
Posts: 13
Joined: 15 May 2012 14:42

Re: android-vlc on android 2.1 nativeInit();

Postby kick_2012 » 29 May 2012 15:36

You should debug it.

Seriously, how can you expect people to answer to such vague questions?

i debuged it ,when the project run,it get an Instance of LibVLC in public ThumbnailerManager(VideoListActivity videoListActivity);
mLibVlc = LibVLC.getInstance();
here is getInstance() in LibVLC.java
public static LibVLC getInstance() throws LibVlcException {
if (sInstance == null) {
sInstance = new LibVLC();
sInstance.init();
}
return sInstance;
}
here is init() in LibVLC.java
/**
* Initialize the libVLC class
*/
private void init() throws LibVlcException {
Log.v(TAG, "Initializing LibVLC");
if (!mIsInitialized) {
nativeInit();
setEventManager(EventManager.getIntance());
mIsInitialized = true;
}
}
nativeInit() is native code in /jni/libvlcjni.c
void Java_org_videolan_vlc_LibVLC_nativeInit(JNIEnv *env, jobject thiz)
{
//only use OpenSLES if java side says we can
jclass cls = (*env)->GetObjectClass(env, thiz);
jmethodID methodId = (*env)->GetMethodID(env, cls, "getAout", "()I");
bool use_opensles = (*env)->CallIntMethod(env, thiz, methodId) == AOUT_OPENSLES;
libvlc_log_subscribe(&debug_subscriber, debug_log, NULL);
/* Don't add any invalid options, otherwise it causes LibVLC to crash */
const char *argv[] = {
"-I", "dummy",
"-vv",
"--no-osd",
"--no-video-title-show",
"--no-stats",
"--no-plugins-cache",
"--no-drop-late-frames",
"--avcodec-fast",
use_opensles ? "--aout=opensles" : "--aout=android_audiotrack"
};
libvlc_instance_t *instance = libvlc_new(sizeof(argv) / sizeof(*argv), argv);///////// when the propram comes to here it crashed.
jclass clazz = (*env)->GetObjectClass(env, thiz);
jfieldID field = (*env)->GetFieldID(env, clazz, "mLibVlcInstance", "I");
(*env)->SetIntField(env, thiz, field, (jint) instance);
if (!instance)
{
jclass exc = (*env)->FindClass(env, "org/videolan/vlc/LibVlcException");
(*env)->ThrowNew(env, exc, "Unable to instantiate LibVLC");
}
LOGI("LibVLC initialized: %p", instance);
}
the os of my device is android 2.1

how should i fix this problem
many thanks.

edwardw
Big Cone-huna
Big Cone-huna
Posts: 2346
Joined: 24 Jun 2012 23:36
VLC version: 3.0.0-git

Re: android-vlc on android 2.1 nativeInit();

Postby edwardw » 25 Jun 2012 04:33

Fixed in latest git master. Use export ANDROID_ABI=armeabi and export NO_FPU=1


Return to “VLC for Android and Chrome OS”

Who is online

Users browsing this forum: No registered users and 23 guests