Gstreamer on Android. Issue with the dependent library

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Gstreamer on Android. Issue with the dependent library

doon
I trying to use Gstreamer on Android via Xamarin.Android(in the Visual Studio), so I built this sample project 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)?
Reply | Threaded
Open this post in threaded view
|

Re: Gstreamer on Android. Issue with the dependent library

doon
doon wrote
I trying to use Gstreamer on Android via Xamarin.Android(in the Visual Studio), so I built this sample project 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)?
I still can't connect these two libraries in the Xamarin project, but I think that I need to change something in the Android Studio project, but I don't know exactly what. Any help will be useful!
Reply | Threaded
Open this post in threaded view
|

Re: Gstreamer on Android. Issue with the dependent library

doon
In reply to this post by doon
doon wrote
I trying to use Gstreamer on Android via Xamarin.Android(in the Visual Studio), so I built this sample project 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?
Reply | Threaded
Open this post in threaded view
|

Re: Gstreamer on Android. Issue with the dependent library

Sebastian Dröge-3
On Do, 2016-02-18 at 21:01 -0800, doon wrote:
>
> > •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:

Why do you want to use tutorial 5 from Xamarin, instead of using
GStreamer directly? Or writing your own C glue for the GStreamer
backend and then calling that from Xamarin?

> 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:

You have to make them non-static but that's going to be not very
useful. This code is meant to be called from JNI, what you want is
something that is called from C# or some other CLI language.

--
Sebastian Dröge, Centricular Ltd · http://www.centricular.com

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

signature.asc (968 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Gstreamer on Android. Issue with the dependent library

doon
Sebastian Dröge-3 wrote
On Do, 2016-02-18 at 21:01 -0800, doon wrote:
>
> > •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:

Why do you want to use tutorial 5 from Xamarin, instead of using
GStreamer directly? Or writing your own C glue for the GStreamer
backend and then calling that from Xamarin?

--
Sebastian Dröge, Centricular Ltd · http://www.centricular.com

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel


signature.asc (968 bytes) <http://gstreamer-devel.966125.n4.nabble.com/attachment/4675946/0/signature.asc>
I try to use Gstreamer tutorial-5 for understanding how should I use my Gstreamer C library in the my Xamarin.Android project. What you meant when you said "using
GStreamer directly"? Are you meant that I need to use libgstreamer_android.so functions directly from my C# code? Sorry for this misunderstanding, I just want to understand how I need to use Gstreamer from Xamarin.Android right.
Regards!
Reply | Threaded
Open this post in threaded view
|

Re: Gstreamer on Android. Issue with the dependent library

Sebastian Dröge-3
On Fr, 2016-02-19 at 01:28 -0800, doon wrote:
> I try to use Gstreamer tutorial-5 for understanding how should I use my
> Gstreamer C library in the my Xamarin.Android project. What you meant when
> you said "using  GStreamer directly"? Are you meant that I need to use
> libgstreamer_android.so functions directly from my C# code? Sorry for this
> misunderstanding, I just want to understand how I need to use Gstreamer from
> Xamarin.Android right. 

Either that, P/invoke GStreamer functions directly. Or at least write
proper GStreamer code in C that is then P/invoked from your application
and does not depend on Java things like the tutorial code.

--
Sebastian Dröge, Centricular Ltd · http://www.centricular.com


_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

signature.asc (968 bytes) Download Attachment