Application for Android with Qt/C++
Sebastian Dröge
sebastian at centricular.com
Tue Jun 23 02:58:43 PDT 2015
On Di, 2015-06-23 at 00:21 -0700, Liru7 wrote:
> Hello Sebastian!
>
> Thx for your answer :-)
>
> I already know this function which is part of "gstreamer_android.c"
> in the
> android tutorials. But I'm not sure how to get all the initialization
> stuff
> integrated in my C++ project in QtCreator.
>
> If I understand right, than I have to take care that
> "gst_android_init(...)"
> and all the functions called from it have to be available in my Qt
> -project.
> But I don't really know how to get the parameters for
> gst_android_init(...)?
> In the java environment the parameters information comes from the
> makefile
> where is set which plugins should be integrated. Right?
>
> --> gst_android_init (*JNIEnv * env, jclass klass, jobject context*)
>
> For the last parameter I take "android.content.Context". But I have
> no idea
> from where I get the instances of JNIEnv* and jclass? Because I can't
> figure
> out where gst_android_init ist called with this parameters.
You have to get those values from somewhere, I don't know how this
works with Qt. You somehow need to be able to get a JNIEnv*, you will
also need that for any other Android specific Java API (and you
probably can't create a non-trivial application without).
But note that the new signature of that function is a bit different:
http://cgit.freedesktop.org/gstreamer/cerbero/tree/data/ndk-build/gstreamer_android-1.0.c.in#n417
You only need the JNIEnv* and the android.context.Context instance of
your application.
For being able to call that, just declare that function somewhere in
your code and then just call it. As long as you make sure the
libgstreamer_android.so is linked in your application it will work.
--
Sebastian Dröge, Centricular Ltd · http://www.centricular.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 949 bytes
Desc: This is a digitally signed message part
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20150623/04a0df91/attachment.sig>
More information about the gstreamer-devel
mailing list