lucas-j / libmpeg2-winrt

MPEG-2 decoder for Windows 8 apps
15 stars 16 forks source link

Compiling App for win rt 8.1 ARM #7

Closed leonardant closed 10 years ago

leonardant commented 10 years ago

Hi,

I wonder if you can help, I am having an issue compiling and executing the app [mpeg2-player] for Windows RT 8.1 ARM, every time I compile the app [in release mode] I get the following in output... ... F:\libmpeg2-winrt-master\mpeg2-player\mpeg2-player.csproj : XamlCompiler error WMC1006: Cannot resolve Assembly or Windows Metadata file 'Windows.Media.winmd' ...

When I run the app on the tablet it works decoding mpeg4 streams but not mpeg2.

The source I am working with is the latest zip downloaded from the project homepage @ https://github.com/lucas-j/libmpeg2-winrt.

Am I missing something when compiling the libmpeg2 [references or c++ compiler/linker options] OR am i missing some reference from the mpeg2-player c# project.

Any help / pointers would be appreciated

silverdragon727 commented 10 years ago

@leonardant You'll run into this error if you leave the WinMD unresolved. In fact you need to resolve the WinMD which the project outputs by using a tool named MdMerge before using it. The solution is simple. A custom build step works well.

  1. Open the property of libmpeg2. MIDL->Output->Metadata file. Clear its value.
  2. Find the Custom Build Step option.
  3. Fill in the blanks with the information below:
Item Content
Command mdmerge -metadata_dir "$(WindowsSDK_MetadataPath)" -o "$(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)" -i "$(MSBuildProjectDirectory)" -v -partial
Outputs $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\$(ProjectName).winmd;%(Outputs)
CustomBuildAfterTargets Midl
leonardant commented 10 years ago

Perfect, can now compile and see mpeg2 and mpeg4 without issue,

many thanks for this pointer!