i have created a new method into the source file named picture.c, which is in the next path: vlc/misc/picture.c.
This method is native method since i want connect this class with a Java class. I have tested with a easy method to pass a string:
Code: Select all
JNIEXPORT void JNICALL
Java_org_videolan_vlc_gui_video_VirtualActivity_HolaMundo (JNIEnv *env, jobject obj, jstring javaString) {
const char *nativeString = (*env)->GetStringUTFChars(env, javaString, 0);
(*env)->ReleaseStringUTFChars(env, javaString, nativeString);
}
VLC_API JNIEXPORT void JNICALL Java_org_videolan_vlc_gui_video_VirtualActivity_HolaMundo(JNIEnv * env, jobject jobj, jstring javaString);
In the Java class which uses that method:
Code: Select all
static {
try{
Log.d(LOGTAG, "Cargando la librería native");
System.loadLibrary("native");
Log.d(LOGTAG, "Library loaded - native");
}catch (Exception e){
Log.d(LOGTAG, "Did not load library - native");
}
}
public native void HolaMundo(String javaString);
Code: Select all
include $(CLEAR_VARS)
LOCAL_MODULE := native
LOCAL_SRC_FILES := /../../vlc/src/misc/picture.c
LOCAL_C_INCLUDES := \
$(ANDROID_NDK)/platforms/android-8/arch-arm/usr/include \
/usr/include/ \
/home/vmg/android/android/vlc/include \
/home/vmg/android/android/vlc/include/vlc \
include $(BUILD_SHARED_LIBRARY)
Code: Select all
Compile thumb : native <= picture.c
In file included from /home/vmg/android/android/vlc/include/vlc_vout.h:35:0,
from /home/vmg/android/android/vlc/include/vlc_image.h:32,
from jni//../../vlc/src/misc/picture.c:38:
/home/vmg/android/android/vlc/include/vlc_filter.h: In function 'filter_NewPicture':
/home/vmg/android/android/vlc/include/vlc_filter.h:158:9: error: 'MODULE_STRING' undeclared (first use in this function)
/home/vmg/android/android/vlc/include/vlc_filter.h:158:9: note: each undeclared identifier is reported only once for each function it appears in
/home/vmg/android/android/vlc/include/vlc_filter.h: In function 'filter_NewSubpicture':
/home/vmg/android/android/vlc/include/vlc_filter.h:196:9: error: 'MODULE_STRING' undeclared (first use in this function)
make[1]: *** [obj/local/armeabi-v7a/objs-debug/native//__/__/vlc/src/misc/picture.o] Error 1
make[1]: Leaving directory `/home/vmg/android/android/vlc-android'
make: *** [vlc-android/obj/local/armeabi-v7a/libvlcjni.so] Error 2
How can I solve it?
Thanks!