Gstreamer on Android. Issue with the dependent library
doon
don-prog at mail.ru
Fri Feb 19 05:01:53 UTC 2016
doon wrote
> I trying to use Gstreamer on Android via Xamarin.Android(in the Visual
> Studio), so I built
> this sample project
> <https://github.com/jaroslavas/Gstreamer-Android-example>
> on the Ubuntu, took the compiled libtutorial-5.so and
> libgstreamer_android.so libraries and added them into the Xamarin.Android
> project as AndroidNativeLibrary's. When I try to use
> libgstreamer_android.so using DllImport, then all going ok, but when I try
> to use libtutorial-5.so (of course using DllImport), then I get:
/
> DllImport unable to load library 'dlopen failed: could not load library
> "build/obj/local/armeabi-v7a/libgstreamer_android.so" needed by
> "libtutorial-5.so"; caused by library
> "build/obj/local/armeabi-v7a/libgstreamer_android.so" not found'.
/
>
> This error occurs because libtutorial-5.so depends on the
> libgstreamer_android.so. libtutorial-5.so trying to find
> libgstreamer_android.so library in
> build/obj/local/armeabi-v7a/libgstreamer_android.so location.
>
> But of course these two libraries are located in the lib/armeabi-v7a
> directory and even if I replace all two libraries or just
> libgstreamer_android.so in this location, then I still have this error. So
> I think I have two options:
>
> •How can I replace library in the real build/obj/local/armeabi-v7a
> directory(because if I use this location in the Solution Explorer then I
> still have this issue)?
>
> OR
>
> •How can I change path of the libgstreamer_android.so library (on which my
> first library will depend) in the Android Studio or just in the .mk
> files(on the .so building stage)?
Ok, I rebuilt somehow these libraries and now libtutorial-5.so can find
libgstreamer_android.so(maybe some kind of magic). But now I am able to use
in the Xamarin.Android project only three functions:
gst_native_set_position(), gst_native_set_uri(), and JNI_OnLoad(), but of
course Java code in this example able to use ANY function from this array:
/static JNINativeMethod native_methods[] = {
{ "nativeInit", "()V", (void *) gst_native_init},
{ "nativeFinalize", "()V", (void *) gst_native_finalize},
{ "nativeSetUri", "(Ljava/lang/String;)V", (void *) gst_native_set_uri},
{ "nativePlay", "()V", (void *) gst_native_play},
{ "nativePause", "()V", (void *) gst_native_pause},
{ "nativeSetPosition", "(I)V", (void*) gst_native_set_position},
{ "nativeSurfaceInit", "(Ljava/lang/Object;)V", (void *)
gst_native_surface_init},
{ "nativeSurfaceFinalize", "()V", (void *) gst_native_surface_finalize},
{ "nativeClassInit", "()Z", (void *) gst_native_class_init}
};/
Also only these three functons a NON-static and only these three functions I
can find in the output list if I do "nm -D --defined-only libtutorial-5.so".
So how can I use functions from above presented array(gst_native_init,
gst_native_finalize, etc.) in the Xamarin.Android C# project?
--
View this message in context: http://gstreamer-devel.966125.n4.nabble.com/Gstreamer-on-Android-Issue-with-the-dependent-library-tp4675705p4675944.html
Sent from the GStreamer-devel mailing list archive at Nabble.com.
More information about the gstreamer-devel
mailing list