-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Deploy for WinRT
Windows store app is supported since QtAV 1.9.0. QtAV depends on ffmpeg dlls, so you have to deploy all those dlls too. But it seems that Qt does not give us a solution.
Qt5.5 and 5.6 is tested.
- Before Build
Copy ffmpeg development files and runtime dlls to Qt include, lib and bin dir
- Build
You can build QtAV in QtCreator. Visual studio is not necessary unless you want to publish your app.
- After Build
Run sdk_install.bat under build dir
windeployqt only deploys Qt own modules and files. You have to add QtAV dlls and depended dlls yourself. I find that windeployqt will create AppxMenifest.map
which contains the files to be deployed. winrtrunner
then reads AppxMenifest.map
and creates an app package and install to your device. So you can add your files in AppxMenifest.map
.
In QtCreator if you click Run
located in the left side, qtcreator will run windeployqt first, all your changes in AppxMenifest.map
will be overwritten. So you can click Run
only once(the first package is incomplete) to open Application Output
panel. There you can clik run/stop
without deployment. Then change AppxMenifest.map
. At last, click the run/stop
button to create a complete package and install to your device.
Of cause, you can run windeployqt and winrtrunner in cmd without qtcreator.
Here is an example to add lines in AppxMenifest.map
"E:\Qt\Qt5.6WinRT\5.6\winphone_arm\qml\QtAV\QmlAV.dll" "QtAV\QmlAV.dll"
"E:\Qt\Qt5.6WinRT\5.6\winphone_arm\qml\QtAV\Video.qml" "QtAV\Video.qml"
"E:\Qt\Qt5.6WinRT\5.6\winphone_arm\qml\QtAV\qmldir" "QtAV\qmldir"
"E:\Qt\Qt5.6WinRT\5.6\winphone_arm\bin\QtAV1.dll" "QtAV1.dll"
"E:\Qt\Qt5.6WinRT\5.6\winphone_arm\bin\avutil-55.dll" "avutil-55.dll"
"E:\Qt\Qt5.6WinRT\5.6\winphone_arm\bin\avcodec-57.dll" "avcodec-57.dll"
"E:\Qt\Qt5.6WinRT\5.6\winphone_arm\bin\avformat-57.dll" "avformat-57.dll"
"E:\Qt\Qt5.6WinRT\5.6\winphone_arm\bin\avfilter-6.dll" "avfilter-6.dll"
"E:\Qt\Qt5.6WinRT\5.6\winphone_arm\bin\swscale-4.dll" "swscale-4.dll"
"E:\Qt\Qt5.6WinRT\5.6\winphone_arm\bin\swresample-2.dll" "swresample-2.dll"
If assets folder does not exist in package, add these lines too
"D:\dev\QtAV\examples\QMLPlayer\assets-winrt\logo_store.png" "assets\logo_store.png"
"D:\dev\QtAV\examples\QMLPlayer\assets-winrt\logo_150x150.png" "assets\logo_150x150.png"
"D:\dev\QtAV\examples\QMLPlayer\assets-winrt\logo_44x44.png" "assets\logo_44x44.png"
"D:\dev\QtAV\examples\QMLPlayer\assets-winrt\logo_71x71.png" "assets\logo_71x71.png"
"D:\dev\QtAV\examples\QMLPlayer\assets-winrt\logo_310x150.png" "assets\logo_310x150.png"
"D:\dev\QtAV\examples\QMLPlayer\assets-winrt\logo_480x800.png" "assets\logo_480x800.png"
The first column is the file to copy, the second column is the target path(parent folders are created automatically). The target path can not be empty.
I find that in your qmake project, you can use DEPLOYMENT
var to add additional files to deploy. The official document says this var is only for wince. But winrt seems fine too. Read QtAV/examples/QMLPlayer/QMLPlayer_sdk.pro
for detail.
First, you have to create vs project. For example
qmake -tp vc QMLPlayer\QMLPlayer_sdk.pro "CONFIG+=windeployqt"
Then open in vs, build and deploy.