Recently, I need to use Qt in Windows to write some interface, which uses the Multimedia Framework phonon of QT. I use QT-4.5.3. The installed QT downloaded from the official website does not integrate the phonon, but the source code is provided. I encountered some problems when compiling phonon. I have discussed a lot on the Internet, but it is rarely about compiling phonon in windows, so I will describe the phonon compilation process system here. I hope this will help you.
Assume that the installation directory of QT is XX.
1. Compile and install phonon
1. Use the XX \ QT \ SRC \ phonon. Pro project to edit phonon. Pro.
Phonon_dir = ../3 rdparty/phonon
2. Compile the debug and release versions. libphon4.a, libphonond4.a, phonon4.dll, and phonond4.dll are generated under XX \ QT \ bin.
(Note: When compiling some built-in demos and example of QT, the required library name is libphonon. a, you just need to change the name, and remove 4 from the four files mentioned above) // note that it is best to copy one copy.
Ii. compile and generate phon_backend (XX \ QT \ plugins)
1. Download The kdewin32 package from kde svn.
Http://websvn.kde.org/trunk/kdesupport/kdewin/
SVN: // anonsvn.kde.org/home/kde/trunk/kdesupport/kdewin // you have to download the svn under the window, here to find the http://subversion.apache.org/packages.html
Download the command SVN checkout SVN: // anonsvn.kde.org/home/kde/trunk/kdesupp/kdewin
2. Copy kdewin/include/mingw/comdef. H to the kdewin/include/DirectX/folder.
3. Go to the XX \ QT \ src directory, edit src/plugins/phonon/DS9/ds9.pro, and add the following line includepath + = <your DirectX path>
4. Use the QT \ SRC \ plugins \ phonon. Pro project file and modify the file.
Subdirs = DS9
5. Delete the videorenderer_vmr9.cpp 172nd line
Setaspectratiomode (vmr9armode_none );
6. Same as the second in the first step. The phon_backend directory is generated under XX \ QT \ plugins. // Edit QT \ SRC \ plugins \ phonon. after the pro compilation is successful, it is to generate a plug-in that allows you to select the executable file box, but it may not be generated under plugins. It may be because the environment variables in PRO are not set and you must specify them by yourself.
# Phonon_ds9_dir =$ $ qt_source_tree/src/3 rdparty/phonon/DS9
Phonon_ds9_dir = http://www.cnblogs.com/../3rdparty/phonon/ds9
You can test the mediaplayer demo provided by QT.
At the same time, I would like to thank the netizens for their selfless sharing. Therefore, I will publish this article, hoping that the comrades in this article will be able to avoid detours.