How to include vlc in an android app using Qt?

VLC for Android and Chrome OS specific usage questions
guenther
New Cone
New Cone
Posts: 5
Joined: 17 Oct 2012 10:03

How to include vlc in an android app using Qt?

Postby guenther » 29 Nov 2013 17:35

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?

edwardw
Big Cone-huna
Big Cone-huna
Posts: 2346
Joined: 24 Jun 2012 23:36
VLC version: 3.0.0-git

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

Postby edwardw » 01 Dec 2013 17:40

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.

guenther
New Cone
New Cone
Posts: 5
Joined: 17 Oct 2012 10:03

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

Postby guenther » 02 Dec 2013 09:11

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!

edwardw
Big Cone-huna
Big Cone-huna
Posts: 2346
Joined: 24 Jun 2012 23:36
VLC version: 3.0.0-git

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

Postby edwardw » 02 Dec 2013 12:49

Well, it is not supported then.

guenther
New Cone
New Cone
Posts: 5
Joined: 17 Oct 2012 10:03

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

Postby guenther » 03 Dec 2013 10:50

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.

edwardw
Big Cone-huna
Big Cone-huna
Posts: 2346
Joined: 24 Jun 2012 23:36
VLC version: 3.0.0-git

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

Postby edwardw » 03 Dec 2013 13:48

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.

Jean-Baptiste Kempf
Site Administrator
Site Administrator
Posts: 37523
Joined: 22 Jul 2005 15:29
VLC version: 4.0.0-git
Operating System: Linux, Windows, Mac
Location: Cone, France
Contact:

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

Postby Jean-Baptiste Kempf » 09 Dec 2013 16:34

You could be able to do it with the GLES2 video output, but this is FAR from being supported and ready.
Jean-Baptiste Kempf
http://www.jbkempf.com/ - http://www.jbkempf.com/blog/category/Videolan
VLC media player developer, VideoLAN President and Sites administrator
If you want an answer to your question, just be specific and precise. Don't use Private Messages.

geostein8888
Cone that earned his stripes
Cone that earned his stripes
Posts: 142
Joined: 15 Dec 2010 11:32

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

Postby geostein8888 » 27 Apr 2014 15:24

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

edwardw
Big Cone-huna
Big Cone-huna
Posts: 2346
Joined: 24 Jun 2012 23:36
VLC version: 3.0.0-git

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

Postby edwardw » 27 Apr 2014 15:25

Simple, don't use Qt on Android.

geostein8888
Cone that earned his stripes
Cone that earned his stripes
Posts: 142
Joined: 15 Dec 2010 11:32

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

Postby geostein8888 » 27 Apr 2014 15:34

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

edwardw
Big Cone-huna
Big Cone-huna
Posts: 2346
Joined: 24 Jun 2012 23:36
VLC version: 3.0.0-git

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

Postby edwardw » 27 Apr 2014 16:17

Using a native Androidsurface.

RSATom
Big Cone-huna
Big Cone-huna
Posts: 513
Joined: 24 Nov 2011 06:55
Operating System: Windows/Linux/OsX
Location: Russia, Tomsk

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

Postby RSATom » 08 May 2014 06:30

did you think about use Qt Quick 2 on android?

edwardw
Big Cone-huna
Big Cone-huna
Posts: 2346
Joined: 24 Jun 2012 23:36
VLC version: 3.0.0-git

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

Postby edwardw » 08 May 2014 06:41

That does not alleviate the problem of video output, though.

RSATom
Big Cone-huna
Big Cone-huna
Posts: 513
Joined: 24 Nov 2011 06:55
Operating System: Windows/Linux/OsX
Location: Russia, Tomsk

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

Postby RSATom » 08 May 2014 06:44

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.

edwardw
Big Cone-huna
Big Cone-huna
Posts: 2346
Joined: 24 Jun 2012 23:36
VLC version: 3.0.0-git

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

Postby edwardw » 08 May 2014 06:45

With vmem?

Nowhere close to as fast as Androidsurface native rendering.

RSATom
Big Cone-huna
Big Cone-huna
Posts: 513
Joined: 24 Nov 2011 06:55
Operating System: Windows/Linux/OsX
Location: Russia, Tomsk

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

Postby RSATom » 08 May 2014 06:46

yes, with vmem. I just want check it to be sure... It could be not so bad as you think.

RSATom
Big Cone-huna
Big Cone-huna
Posts: 513
Joined: 24 Nov 2011 06:55
Operating System: Windows/Linux/OsX
Location: Russia, Tomsk

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

Postby RSATom » 08 May 2014 06:51

And if it will be not absolutely bad, it could be created vlc plugin for output to qt quick item (it uses OpenGL ES).


Return to “VLC for Android and Chrome OS”

Who is online

Users browsing this forum: Bing [Bot] and 8 guests