VLC efforts targeting WinRT with open source tools could enable more open source ports

An email from VideoLAN concerning the port of the open source VLC media player to WinRT, the tablet platform in Windows 8, provides insight into some of the technical difficulties facing open source developers.

Large Orange VLC media player Traffic Cone Logo

This is the heart of the problem:

The build process of VLC is not integrated with Windows Tools, notably Visual Studio, because VLC uses Unix Tools to run on all platforms. This is one of the reasons why VLC media player works on Windows, Linux, BSD, Solaris, iOS, Android, OS/2 and so many other operating systems.

In order to qualify for Windows Store distribution, apps must pass Microsoft’s security requirements, avoiding prohibited API calls. The VLC developers have done most of that successfully, but hit a problem with the Microsoft C Runtime, MSVCRT. Many open source projects use the ancient version 6.0 for maximum compatibility, but:

on WinRT, one MUST use MSVCRT 11.0 in order to pass the validation. This meant that we had to modify our compiler and toolchain to be able to link with this version.

When we asked Microsoft, some engineers told us that this could not possibly succeed, since the validation would not allow application compiled with 3rd party compilers to link with MSVCRT110. We did not want to believe them, since this would have killed the project.

And, they were wrong. We did it, but this took us way more time than anything we had anticipated. The final work was shared and integrated in our toolchain, Mingw-W64. All other open source applications will benefit from that, from now on.

Apparently the final piece of work is working out how to call the WinRT interop layer (the bit that looks like COM but is not COM) from C code. That is now working too so VLC is now completing the work of rewriting headers to call these new APIs.

This work could have wider consequences. Since VLC is open source, all these efforts are available to others, which means that porting other open source projects that use a similar tool chain should be easier.

This is especially significant for Windows RT, the ARM port, where it is not possible to install desktop apps.

VideoLAN’s work could be a great benefit to the WinRT Platform. Microsoft’s engineers should be doing everything they can to help, rather than (as the email implies) telling the developers that it cannot work.

2 thoughts on “VLC efforts targeting WinRT with open source tools could enable more open source ports”

  1. The comments from the engineers worries me. Could it be that this method of passing validation is “a glitch” and could Microsoft decide to tighten the validation and break this method of passing validation in the future?

  2. Microsoft only supports Visual C++. If you ask Microsoft about any other compiler, they’ll simply say no. This certainly does not mean that other compilers can’t work.

    (See, e.g., the situation a couple of years ago with Microsoft Virtual PC and home SKUs of Windows. They were “not supported” — but they worked just fine.)

    In this particular case, it was just a matter of linking against the newest version of the Visual C++ library. Not particularly hard to pass validation, as long as you linked against it.

    VLC’s problem was not that they couldn’t pass validation — but that it crashed. MinGW has always linked against the non-versioned MSVCRT.DLL rather than the versioned one. So VLC was doing something that their compiler had never done before.

Comments are closed.