jb, 28y

Keyword - VLC

Entries feed - Comments feed

Tuesday, April 2 2013

New report about the WinRT port

News and Excuses

I must start this post by sharing some excuses of not doing enough updates lately.

The main reason is that we've been mostly under-water with the current development, that took most of our time.

News and report

The good news is that we have had tremendous progress...

The bad is that we have still a bit of work to do before sharing it on the store, as I will explain soon.

Pictures

But first, the current pictures:

Current start screen

Metro Start Screen

Metro Main Screen

Fully working playback

Metro Playback

Metro Playback 2

Technical update

If you followed closely, our main work, in addition to the UI, was to fight and replace the forbidden symbols not allowed on Windows App Store mode.

We've been quite efficient at that, working closely with Mingw-w64 project and GCC developers.

The biggest result is that we have now cut down 90% of our symbols, that are forbidden on Metro Mode.

We mostly did this by:

  • replacing our forbidden calls with newer authorized equivalent calls,
  • modifying gcc and Mingw-w64,
  • writing new code in a special library of ours,
  • writing dummy functions,
  • disabling VLC code that would not work on the Metro platform,
  • moving VLC to MSVCRT 11.0,
  • moving all the VLC codebase to UNICODE and WideChars to fit the new requirements.

We did also a lot of minor things to help the integration of libVLC and VLC in this modern platform.

What are we working on now:

We are now mainly working on 2 things:

  • make VLC work with MSVCRT 11.0 without crashing ;)
  • write headers and C/C++ code to access the new fashion of COM APIs in which WinRT is written in.

What we are gonna work just after:

  • ARM, ARM, ARM,
  • WP8

Goodies

They are gonna get shipped soon :)

Tuesday, February 12 2013

Technical update on the WinRT port

Status

So, a few weeks have passed, and I have not spoken a lot about the port on WinRT/Metro/Windows RT/WP8.

Of course, some of you will complain, but the main reason for that, is that I've been very busy on VLC :)

So here is what we did :)

VLC engine

The biggest part of the work resides in the port of the VLC engine to a WinRT compatible runtime.

A lot of the work we've done so far has been on that.

More specifically, we have:

  • ported VLC APIs call to UNICODE (wide chars),
  • allowed VLC to be compiled for Windows 8 API targets,
  • upgraded some VLC Win32 API calls,
  • removed some code-path when compiling for WinRT,
  • fixed some issues on mingw-w64 toolchain for Windows 8,
  • prepared a compatibility library,
  • changed our packaging for WinRT,
  • improved our audio output for Windows.

Winstore compatibility library

A lot of work has been and will be on this library, so let me speak a bit more about it.

Instead of ifdef-ing the VLC code everywhere for WinRT, we decided to reimplement the forbidden calls in a library that would expose the same old Win32 functions, but implemented with the allowed APIs.

The biggest advantage of this approach is that you don't need to modify a lot of your common codebase, and that you don't need to hack all the libraries that are linked to VLC. And this would have been a huge task. Moreover, it allows to adapt to newer versions of Windows more easily. Moreover, this library will be usable by every other project.

But as you can imagine, doing that is quite tricky, since we don't modify VLC, we don't modify the headers, but we insert it at link time...

We have done some of the work, but we still have a huge amount of work to do, notably on threads and Winsock reimplementation.

This library is hosted in the mingw-w64 repository and will be my focus for a bit of time.

Application

Above the VLC engine (libVLC), we have a CX/C++ wrapper, in order to expose VLC functions to the application, since libVLC is plain C, and it is compiled in Visual Studio.

Above the wrapper, we have the main application.

This application is written in C#, compiled in Visual Studio, and uses the wrapper in order to access playback functions.

So far, the application has a basic media library, and playback support using VLC engine. The media library UI follows more or less what we've shown in the KickStarter. The player UI wasn't shown, but it looks a bit like the normal Video application, in order to match the official style.

The video, so far, is rendered into a memory buffer from libVLC and then is displayed using Direct2D in a video surface. This is not yet the best method, but it is good enough for now.

What's next

So, what are we going to work on now:

  • the winstore compat library
  • the winstore compat library (threads) ,
  • the winstore compat library (MSVCRT),
  • the interface, in order to match our promises,
  • the audio and video outputs, to go faster.

A lot of the work is going to go faster now that we have done correctly the beginning and a beta as soon as possible for our backers.

Tuesday, December 11 2012

Why we need a KickStarter for VLC on Metro

KickStarter for VLC on Metro

As you might have heard, some developers of the VideoLAN team have started a kickstarter quest to crowdfound a port of VLC on WinRT.

The reason for this kickstarter is that porting VLC to WinRT will be hard and long, if we don't speed it up.

And yet, quite a few people seem to think the task will be simple, like on neowin or Hacker News.

I'm all for funding 40k pounds for VLC (they deserve it), but 40k under the guise of Metro seems a bit much, no?

I dont know but just creating a metro UI shouldn't be that hard should it?

The Windows RT app should be trivial to make... As long as they aren't using Win32 API's, it should just be a matter of recompiling for RT and correcting whatever few bugs they encounter.

Well, no, this is not too much.
We are not the kind of person asking money for nothing, I think we've proven that during all those years.

Let me explain why.

Why we need a KickStarter for VLC on Metro

Designing a UI above VLC, for the "Modern Experience" is quite easy, and we've already done a few proofs of concept.
Finding a designer would be simple and 1k$ for the project would be too much already :) It would take a couple of months and we would be done with it.

The issue is to get on the store. And this is hard.

Why is that?

VLC (and its underlying libraries, including codecs, networking access or demuxers) represents around 7 Million Lines of Code in C, C++ and ASM languages. And all of this code is following C99 standard and has inline ASM.

Visual Studio cannot eat that code in any way. Believe me, we tried. A lot. So we need to compile the VLC for Windows on Linux, using gcc and mingw.

Unfortunately, this does not work on WinRT ("Modern UI" or whatever you like to call it). WinRT restricts a lot the Win32 APIs. And only the Windows Store knows which ones are allowed.

For example, the BSD sockets are gone... Yes, this is not a joke.
They work on Linux, Windows, Mac, iOS, Solaris, Android, QNX, WP8, WinCE but not WinRT.

Roadmap

So, we need to:

  • change and update our toolchains,
  • fix MingW for WinRT, in the best way we can,
  • link to the newer Windows runtime,
  • list the problematic APIs,
  • rewrite the code that is using Win32 APIs since 10 years (and in all underlying libraries too...),
  • drop some modules or isolate some code,
  • write new replacement code,
  • write a new interface above all this,
  • design the interface correctly,
  • fix the code using windows HWND,
  • port the audio and video outputs,
  • work-around the sandbox for DVD and BluRay playback,
  • probably write a WinSock2 replacement library to build all the cross-platform libraries that expect a BSD-socket-like library,
  • port to ARM,
  • etc...

Add to that the need to modify MingW to output dlls that we can load on ARM (Windows RT) and do the same project for the different APIs present on WP8.

Conclusion

As you can see, a lot of the work is not really on VLC, but on being able to compile for WinRT with open source tools, since Microsoft tools are not enough. And a lot of work will be work-around the limitations of WinRT.

Of course, a lot of the work will be re-usable to other projects.

So, yes, we will need quite a few developers to do all that. We can do the Android route, and it might take a couple of years to get it there, or we can try to get some money to speed it up...

Tuesday, November 20 2012

How to properly(?) relicense a large open source project - part 3

Relicensing VLC to LGPL

As you might know, or might have read, I have spent a lot of my time to relicense libVLC, aka VLC engine, from GPL to LGPL.

This is a continuation of the LGPL posts, please read the previous posts, if you have not done it already.

Here is the last part, that should answer a few questions I've had.

Part 3: numbers and Q/A

How many lines of code were relicensed?

I have not done the total count, but the LGPL modules are now around 230,000 lines of code.

The GPL modules are now around 150,000 lines of code.

Does this mean the VLC will come back on the iOS store?

Well, the honest answer is still maybe. I do not have a crystal ball.

First, I have no checked the compatibility between the AppStore and the LGPL, and then, as far as I know, MobileVLCKit, MediaLibraryKit and the VLC audio and video outputs for iOS are still totally GPL.

And, as far as I know the legality of the AppStore terms and the GPL is still shady.

Did you have to contact companies?

Yes. There was a limited number of people who used their corporate email and therefore, we needed the check from their hierarchy. I can think about SFR, Viotech, BBC, M2X, Jutel and Actech, but their might have been more.

When working for companies, it is probable that you handed over our patrimonial rights to the company. Therefore, we needed to get the OK. Since this is more a singularity than the norm, this went quite smoothly, in all cases.

Are you crazy?

Probably, yes. Why?

Did you have some difficulties to convince some people?

Well, yes. Some people, notably very old contributors, wanted more details and information with the change. But a couple of mail or a call were enough to explain everything.

Do you think the GPL is a bad license?

No, the GPL is a great license, but it is not the magic silver bullet that works all the time. Moreover, times have changed, and a lot of companies know that contributing back is more cost-effective than forking a project, licensed under a more liberal license.

Did you learn stuff doing this?

A lot. Legally, mostly, but also socially and about our community.

What about other modules?

The main question is about the streaming modules. So far, I don't know. It might come, or might not. This will depend a bit of the first reactions on the current relicensing.

Are you available for hire?

Yes :)

What if you did a mistake?

Well, I am quite sure I did not. I've spent a lot of time to make stuff correctly, and it was long and boring.

Yet, in the unlikely eventuality I did a mistake, here are the failsafes:

  • I am quite sure of the support of the top 32 (2⁵) contributors of VLC, which account for more than 47200 commits which represent over 91% of all VLC commits,
  • I have received 230 people agreements, which is a large chunk of coders contributors on VLC, probably more than the half,
  • The code from people not responding was not relicensed,
  • The process was correctly done and validated,
  • VideoLAN and ECP support the change,
  • VLC would very likely be considered as an Œuvre collective under the direction of VideoLAN by legal ruling in France. I will detail this point in the next part,
  • Unknown contributors that we haven't heard back from will probably be considered as missing, in a similar case than the case of an œuvre orpheline.

Therefore, I don't think I did a mistake, and if I did a mistake, I think it will be only on a very limited piece of code (easy rewritable), and I think VideoLAN and VLC authors would be allowed to relicense it anyway.

French Authorship law and community projects

NOTA BENE: if you are an idealist developer, you are forbidden to read the following because you will not like it.

There are 3 main cases for intellectual works done by a group of authors: l'œuvre composite, l'œuvre collaborative and l'œuvre collective. Of course, those concepts apply very badly for software.

  • The composite work is clearly not in the scope of VLC, because the GPL takes care of that.
  • The collaborative work implies that we only deal with physical entities, which is not true; and that the software is finished, in order to be divulgué, which is clearly not the case for VLC.
  • The collective work implies that some entity is in charge of publication, which is more or less true, seeing that VIA and VideoLAN have done that so far; but it implies that each contribution cannot be traced back to a single author, which is also not true.

We are in a mix here, because no situation perfectly fit. Seeing the jurisprudence of the last 30 years on this, we would probably be considered to be in the last case by a judge.

Seeing that the very large majority of contributors have agreed, that we have contacted all the contributors (and I have proofs of that), that VideoLAN is doing the coordination, that we are not denaturing the spirit of the final work, a French judge would very likely consider that VideoLAN and the main VLC authors have the rights to relicense the last pieces anyway.

This was confirmed by a few lawyer friends of mine.

Do I like this situation?

Not really, but dura lex sed lex.

And it probably saves us from overzealot annoying people.

Yet, I don't think I did a mistake.

Wednesday, November 14 2012

I did it!

Hello HN: you should really read part 1, part 2 and part 3 about this change.

This afternoon, I finished the relicensing of most of the code of VLC to LGPL, like promised:

VLC modules LGPL commit.

F*ck Yeah

You should read my posts on this subject.

Thanks to all VLC contributors, especially the important ones!

Last year, I also did the VLC core LGPL commit.

Wednesday, November 7 2012

How to properly(?) relicense a large open source project - part 1

Relicensing VLC to LGPL

As you might know, or might have read, I am spending a lot of my time to relicense libVLC, aka VLC engine, from GPL to LGPL.

There are quite a few good reasons to do so, some more obvious than others, but notably competition, necessity to have more professional developers around VLC and AppStores. Other reasons also exist, but this is not the place and time to discuss those.

This is a crazy task, because every developer keeps all its rights, and VideoLAN has little rights on VLC. This involves contacting a few hundred developers, some who were active only 10 years ago, some with bouncing mails, and people spread across continents, countries, languages, OS...

Yet, I did it. Here is the first part of how I did it...

Copyright, droit d'auteurs, public domain and VLC.

As all VideoLAN projects, like x264 or DVBlast, VLC is governed under the French law, even if some don't like this fact.

This means, we are not under a copyright system, but under an author rights system. As such, every author has moral rights and patrimonial rights. The first ones are nontransferable while the later ones can be transfered to another legal entity. This is quite different from copyright.

Moreover, this explains why public domain is not a valid concept for everyone on this planet.

Unlike a lot of large open source projects, authors of VLC keep all their rights on their code, even if the code is minimal. Therefore, to change the license, one must contact every author, even small contributors. From a community management point-of-view, this also makes sense :).

VLC authors, core and modules

VLC is split in several parts, but most of the code is in the core or in some modules.

The core

The core, that was successfully relicensed last year, involved around 150 developers and 80000 lines of code, and the very vast majority of the code was done by two dozens of people, most of whom I have not lost contact with.

The modules

The modules are a different piece of cake.

Even, if we concentrate on the playback modules, which I did, we speak here of 300 developers and 300000 lines of code and the repartition is distributed more evenly.

Listing the right people

The first step, which is the most important, is to correctly list the authors.

This would seem simple from an external point of view, but it is not, mostly because there was no split between authors and commiters in the CVS and SVN days. Moreover, some code was stolen imported from Xine or MPlayer... And sometimes, the author is not even credited in the commit log.

And this should be the time were you think I am completely crazy.

Tools

To get a proper listing of contributors, I used 3 things:

  1. git blame
  2. git log
  3. grep, awk

on our vlc git repository.

Blaming

The first obvious thing to do, is to use git blame on all the files you care, so you know, lines-by-line who actually wrote the code, even after code copy, code move or re-indentation.

I ran it, with extra protection, like this: git blame -C -C -C20 -M -M10 -e $file.

Of course, as some Git expert told me, this should have been enough: git blame -C -C -M -e $file but I preferred to be extra-safe.

Logging

The second obvious thing to do, was to check all the logs on the specific modules folder or file, in case :

  • someone did some commits on one module
  • the code was quite changed, so blaming does not find it
  • yet the idea behind the code is the same.

This solves what I call the authorship leak.

git shortlog -sne $file was used for that task.

Grepping

Finally, some people where only mentioned in the commits logs or just had their names in the final file.

For this, I grepped "patch", "original" "at", "@" in the commit logs.
I also grepped the author sections of every file to check if there were any other author missing.

Conclusion

After those steps, I had a quite accurate list of people to contact. I'll skip you the de-duplicating step, because this is obvious and boring.

The next posts will be about how I contacted and found people, and how they did react.

- page 1 of 7


Jean-Baptiste KEMPF | jean-baptiste.kempf _(at)_ via.ecp.fr | Powered by Chaussure | xHtml et CSS valide