Monday, September 29, 2014

How to solve: defaultServiceProvider::requestService(): no service found for - "org.qt-project.qt.mediaplayer"

When we try to run a Qt application that uses QMediaPlayer on Windows XP, we get:

defaultServiceProvider::requestService(): no service found for - "org.qt-project.qt.mediaplayer"

From: https://bugreports.qt-project.org/browse/QTBUG-28881
"On Windows XP, Qt Multimedia uses DirectShow (and WMF for Windows Vista and later). The DirectShow plugin binary is not included in the Qt 5.0 package (only the WMF plugin is)."

So prebuild binaries from qt-project.org does not contain the DirectShow plugin, so we need to build one ourself.
For that, we need a compiler and Qt Multimedia source code.
The source code can be obtained from qt-project.org, http://download.qt-project.org/official_releases/qt/5.3/5.3.2/submodules/qtmultimedia-opensource-src-5.3.2.7z ,
or from https://gitorious.org/qt/qtmultimedia.git (in that case we also need PERL in path).

 mkdir BuildDirectShowPlugin  
 cd BuildDirectShowPlugin  
 /path/to/qt/bin/qmake /path/to/multimedia/source/src/plugins/directshow/directshow.pro  
 nmake (make, mingw32-make)  


Copy dsengine.dll, dsengined.dll and dsengined.pdb over the old files in /path/to/qt/plugins/mediaservice .

2 comments: