[Interest] Using QMediaplayer with QAbstractVideoSurface on Android?

Ola Røer Thorsen ola at silentwings.no
Tue May 13 13:31:46 CEST 2014


Hi all,

I've got a custom video player application currently being used on Linux
(embedded with EGLFS), Desktop Linux and Windows 7. Now trying to deploy it
on Android as well, but I'm facing some problems. I'm using the Qt 5.3.0 RC
version.

The application uses Qt Quick2. The video playing part is done by
instancing QMediaPlayer and a custom video surface inheriting
QAbstractVideoSurface, in C++ during startup. This custom surface class
then communicates with a specialized QQuickItem used for rendering. The
rendering is not done on a simple 2D rectangle, that's why I need this
special stuff.

So basically I do this:

m_surface = new CustomVideoSurface();
m_player = new QMediaPlayer();
m_player->setVideoOutput(m_surface);

m_player->setMedia(....);
m_player->play();

My problem is that on Android, none of the methods in the video surface
class are called. So I never get any video frames in "present" etc. Not
even "supportedPixelFormats" seems to be called.

The "Qt for Android known issues" page says the Qt Multimedia Widgets
module is not supported on Android. I'm not using widgets, but does this
also mean I cannot use custom video surfaces etc. in C++ on android?

The pure QML-based video examples do work on my Android device, so it
should be doable somehow. I see that the internal QDeclarativeVideoOutput
class also uses a video surface, so maybe I'm only missing some additional
details?

Cheers,
Ola
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20140513/e014e1de/attachment.html>


More information about the Interest mailing list