Qt WinRT App cannot access file permission denied
-
I need to develop WinRT App using Qt and FFMPEG, I build the ffmpeg for WinRT based on the instruction here and I am able to link the library with my project. Now I need to open a video file using
avformat_open_input
but it always giving me the outputvideo decode error "Permission denied"
Below is the relevant part of the code,
int ret = avformat_open_input(&pFormatCtx, hls, NULL, NULL); if(ret != 0) { char errbuf[128]; av_strerror(ret, errbuf, 128); qDebug()<<"video decode error"<<QString::fromLatin1(errbuf); }
From the above error it seems some permission issue, do I need to add any additional permission on
AppxManifest.xml
currently I am using default manifest which is created by Qt creator. -
Where is the file located?
-
I'm not a WinRT expert but I think you need additional permissions for the Videos directory.
-
@patrikd said:
e package.appx
Hi Patrik
Here the complete Appmanifest.xml
<?xml version="1.0" encoding="utf-8"?> <Package xmlns="http://schemas.microsoft.com/appx/2010/manifest" xmlns:m2="http://schemas.microsoft.com/appx/2013/manifest"> <Identity Name="987a0812-0cf7-43ce-a1d1-d9057e6eb124" ProcessorArchitecture="x64" Publisher="CN=haris" Version="1.0.0.0" /> <Properties> <DisplayName>MyApp</DisplayName> <PublisherDisplayName>Default publisher display name</PublisherDisplayName> <Logo>assets/logo_store.png</Logo> </Properties> <Prerequisites> <OSMinVersion>6.3.0</OSMinVersion> <OSMaxVersionTested>6.3.0</OSMaxVersionTested> </Prerequisites> <Resources> <Resource Language="en" /> </Resources> <Applications> <Application Id="App" Executable="MyApp.exe" EntryPoint="MyApp.App"> <m2:VisualElements DisplayName="MyApp" Description="Default package description" BackgroundColor="green" ForegroundText="light" Square150x150Logo="assets/logo_150x150.png" Square30x30Logo="assets/logo_30x30.png"> <m2:DefaultTile Square310x310Logo="assets/logo_310x310.png" Wide310x150Logo="assets/logo_310x150.png" Square70x70Logo="assets/logo_70x70.png"> <m2:ShowNameOnTiles> <m2:ShowOn Tile="square150x150Logo" /> <m2:ShowOn Tile="wide310x150Logo" /> <m2:ShowOn Tile="square310x310Logo" /> </m2:ShowNameOnTiles> </m2:DefaultTile> <m2:SplashScreen Image="assets/logo_620x300.png" /> </m2:VisualElements> </Application> </Applications> <Capabilities> <Capability Name="musicLibrary" /> <Capability Name="internetClient" /> <Capability Name="videosLibrary" /> <Capability Name="picturesLibrary" /> </Capabilities> <Dependencies> <PackageDependency Name="Microsoft.VCLibs.120.00.Debug" /> </Dependencies> </Package> <!-- Generated by qmake using the winrt-x64-msvc2013 mkspec. -->
Where these lines
<Capabilities> <Capability Name="musicLibrary" /> <Capability Name="internetClient" /> <Capability Name="videosLibrary" /> <Capability Name="picturesLibrary" /> </Capabilities> I have added manually, but still no luck.
-
hi haris,
when I set this flag under vs2015 my entry in the manifest is a little different:<uap:Capability Name="videosLibrary" />
but no idea if this "uap:" is needed.
I'm sorry, I have only little experience on WinRT. Maybe the output is missleading. I would try to access a text file for debug in this folder directly from my application to make sure that this is really the reason.
best,
patrik