Page 1 of 1

How to include vlc in an android app using Qt?

Posted: 29 Nov 2013 17:35
by guenther
I managed to write a little Qt (5.2) application integrating libVlc for Android. The VLC media player can play a file stored on my Android device, but the actual picture is only displayed when I use callbacks and print each picture into some QWidget manually.

I'm looking for a way to let VLC paint the picture directly to some QWidget. For Windows, MacOS or Linux, one has to simply specify:

#ifdef Q_OS_WIN
libvlc_media_player_set_hwnd (_mp, (void *)winId());
#elif defined Q_OS_MAC
libvlc_media_player_set_nsobject(_mp, (void *)winId());
#else
libvlc_media_player_set_xwindow(_mp, winId());
#endif

How can that be done for Android?

Re: How to include vlc in an android app using Qt?

Posted: 01 Dec 2013 17:40
by edwardw
I think you are mixing something. libVLC for Android is a Java API for use with Android.

Qt is a desktop toolkit that cannot exist on Android.

Re: How to include vlc in an android app using Qt?

Posted: 02 Dec 2013 09:11
by guenther
Actually, I'm not mixing things up. Qt does work on Android and I managed to write a Qt app that integrates the libVlc for Android. As I said, the only remaining problem is how to get the libVlc paint the pictures directly into some QWidget or similiar, and not manually within the callbacks. Big performance issue!

Re: How to include vlc in an android app using Qt?

Posted: 02 Dec 2013 12:49
by edwardw
Well, it is not supported then.

Re: How to include vlc in an android app using Qt?

Posted: 03 Dec 2013 10:50
by guenther
My question is about vlc on android an where it paints its pictures by default. Judging from the sources, it seems as if it uses VOUT_ANDROID_SURFACE and not VOUT_OPEGLES2?

Once I figure that out, I might be able to see how Qt on Android handles the surface stuff and how I could work with Qt on Android in order to get the libVLC to paint the video that it does actually read and decod in the background.

Re: How to include vlc in an android app using Qt?

Posted: 03 Dec 2013 13:48
by edwardw
The surface vout is directly dependent on the Java backend of VLC for Android.

Therefore there isn't like a "window" you can set, and hence this is virtually impossible without at least including the libVLC Java glue code.

Re: How to include vlc in an android app using Qt?

Posted: 09 Dec 2013 16:34
by Jean-Baptiste Kempf
You could be able to do it with the GLES2 video output, but this is FAR from being supported and ready.

Re: How to include vlc in an android app using Qt?

Posted: 27 Apr 2014 15:24
by geostein8888
Hello,
while I'm also playing around with vlc and Qt, and in the future I plan to make a small android app with this, it will be nice if somebody can push me here in the right direction; means how is this working together: Qt-LIBVLC-ANDROID

is there a reference player or example out

Georg

Re: How to include vlc in an android app using Qt?

Posted: 27 Apr 2014 15:25
by edwardw
Simple, don't use Qt on Android.

Re: How to include vlc in an android app using Qt?

Posted: 27 Apr 2014 15:34
by geostein8888
and what is the alternative, i made my app under Qt for win/mac/linux and wanted to port it over easily to android

Georg

Re: How to include vlc in an android app using Qt?

Posted: 27 Apr 2014 16:17
by edwardw
Using a native Androidsurface.

Re: How to include vlc in an android app using Qt?

Posted: 08 May 2014 06:30
by RSATom
did you think about use Qt Quick 2 on android?

Re: How to include vlc in an android app using Qt?

Posted: 08 May 2014 06:41
by edwardw
That does not alleviate the problem of video output, though.

Re: How to include vlc in an android app using Qt?

Posted: 08 May 2014 06:44
by RSATom
maybe, but I have lib which can render video from libvlc to Qt Quick item. And I just want to check, will it be good enough to use it on android.

Re: How to include vlc in an android app using Qt?

Posted: 08 May 2014 06:45
by edwardw
With vmem?

Nowhere close to as fast as Androidsurface native rendering.

Re: How to include vlc in an android app using Qt?

Posted: 08 May 2014 06:46
by RSATom
yes, with vmem. I just want check it to be sure... It could be not so bad as you think.

Re: How to include vlc in an android app using Qt?

Posted: 08 May 2014 06:51
by RSATom
And if it will be not absolutely bad, it could be created vlc plugin for output to qt quick item (it uses OpenGL ES).