Qt5, Phonon and Multimedia kit
Asked Answered
L

2

7

I´m quite new to Qt development and I´m using Qt5 Beta1 on MacOSX.

For the last two days I´ve been reading the docs and looking for information about the different possibilities that I have in order to implement a widget that displays the frame of a video which corresponds to a concrete moment in time. A good old preview, in short. First I thought that, since I did not need anything fancy, Phonon would be the right choice, as it´s called to be "on a higher level (than QTMultimedia) and in many cases more suitable for application developers." I read its documentation and even found some discussions that could help me starting, like this; http://www.qtcentre.org/threads/13221-QT-4-4-Phonon-Video-Rendering-a-single-frame. But then, when I tried to make something on my own, I realized that I did not have the Phonon library. Surprised from it, I research about Phonon and Qt5. And that´s when all the trouble began.

I started reading conversation such as this one: http://comments.gmane.org/gmane.comp.lib.qt.user/1581 or this one: http://comments.gmane.org/gmane.comp.lib.qt.devel/3905 or this other link: https://bugreports.qt.io/browse/QTBUG-26471. And I got really confused, without knowing if it was a good idea to download the Phonon library or it was not going to be supported on Qt5 after some time. So I decided to go a step back and think again about using QTMultimedia instead of Phonon. I looked at their VideoWidget example http://doc.qt.io/qt-4.8/qt-multimedia-videowidget-example.html and when I tried to run it, it threw several errors (I´m posting just the beginning of the output):

In file included from ../VideoExample/videoplayer.cpp:43:
In file included from ../VideoExample/videowidget.h:44:
../VideoExample/videowidgetsurface.h:57:11: warning: 'VideoWidgetSurface::isFormatSupported' hides overloaded virtual function [-Woverloaded-virtual]
 bool isFormatSupported(const QVideoSurfaceFormat &format, QVideoSurfaceFormat *similar) const;
      ^
../../Downloads/qt-everywhere-opensource-src-5.0.0-beta1/qtbase/include/QtMultimedia/../../../qtmultimedia/src/multimedia/video/qabstractvideosurface.h:78:18: note: hidden overloaded virtual function 'QAbstractVideoSurface::isFormatSupported' declared here
virtual bool isFormatSupported(const QVideoSurfaceFormat &format) const;
             ^
../VideoExample/videoplayer.cpp:61:40: error: expected a type
 QAbstractButton *openButton = new QPushButton(tr("Open..."));
                                   ^
../VideoExample/videoplayer.cpp:62:6: error: no matching member function for call to 'connect'
 connect(openButton, SIGNAL(clicked()), this, SLOT(openFile()));
 ^~~~~~~
../../Downloads/qt-everywhere-opensource-src-5.0.0-beta1/qtbase/include/QtCore/../../src/corelib/kernel/qobject.h:211:36: note: candidate function not viable: cannot convert argument of incomplete type 'QAbstractButton *' to 'const QObject *'
static QMetaObject::Connection connect(const QObject *sender, const char *signal,

And this is the moment when I felt I was completely lost and wrote here :/

So my actual questions are:

  1. Does anyone knows the actual state of Phonon and if it´s a good idea to use it for Qt5? Is so, what do I have to make it work? I guess I´m mixing concepts here, but I´m terribly lost between what belongs to Qt and what no, and what are the implications of both possibilities.
  2. Any idea why the example from QTMultimedia does not work?

In general, thoughts about this topic would be greatly appreciated.

Loran answered 28/11, 2012 at 15:37 Comment(0)
C
6

The Phonon framework seems not to be included at Qt 5 (Qt and Key Technologies).

The example you tested seems to work only with Qt 4.7, not Qt 5. The Qt 5.0 version can be found here. The Qt 5.1 version can be found here.

Cooperative answered 28/11, 2012 at 17:9 Comment(7)
Thanks, I will check the example version for Qt5! Sorry if it sounds dumb but, not being included means also that it can not be used or just that is not recommended?Loran
Unfortunately, the example does not contain any code so far... :/Loran
IMO it is not recommended even on previous versions of Qt, since Phonon (being a KDE project), includes many features specific to KDE. Also, Qt 4.4 was (as far as I know) the last version of Qt officially supporting Phonon. Today, QtMultimedia and QtMobility have replaced Phonon.Deprecative
I have no idea whether the examples will be ever added or not to Qt 5. Sorry!Deprecative
Sorry, Qt adopted Phonon at Qt 4.4. Support will remain for the Qt 4.x series, but not for Qt 5.Deprecative
I just want to add that I got specially confused because in Qt5, Multimedia contains Multimedia and MultimediaKit, but some of the documentation is missing so, when you check to previous versions, it redirects you to the Multimedia page, not the one from MultimediaKit. Hum... I think I´m not explaining it much better. Just check this site: doc-snapshot.qt-project.org/5.0/qtmultimedia/changes.htmlLoran
That is really confusing. I'm developing since 2010 a multimedia app. Since the beginning I'm using Qt 4.x (4.8 now), but I'll wait until the documentation is complete to upgrade to 5 (although I really want to start playing with Qt 5...). I find this lack of documentation disturbing...Deprecative
B
0

Try installing phonon development kit.

yum install phonon-devel

Bedazzle answered 9/1, 2014 at 14:56 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.