On top of that, these are some of the changes exclusive to the MP2 version:

You can now change the settings for AtmoLight without having to restart MP2. Before lots of the settings would not be considered until MP2 got restarted. This also means that you can add or remove targets (e.g. AtmoWin) on the fly.

We added the VUMeter and VUMeter Rainbow effect from the MP1 version. This effect will light up your leds according to the music you are listening to.

Blackbar detection and removal has been added. If you are watching an old tv show or a bluray, and the blackbars are encoded in the video, then AtmoLight can now remove them, so that the leds light up even with the bars. Note that this will not change how the video looks on your screen.

We fixed a bug where AtmoLight would not change the effect if a video ended on its own.

Finally, we added Picture-in-Picture support. The leds will always light up according to the primary videoplayer, if you switch the player, then the lights will switch aswell. Also AtmoLight now handles the effects correctly when you start or stop a player in PiP mode.

I think you need to Dispose the returned Surface by GetSurfaceLevel, but only the one from player, not the RenderTarget.

A conceptional question: why do you take the video surface if it is present? Isn't it better to capture the finished rendered backbuffer? It should give you better results, i.e. if there are 2 PiP video players, the actual screen position of video frames need to be considered (fullscreen background+PiP window overlay).

I dont even know what that means , "if it is present". As said before, everything directx and so on is pretty much just me trying everything i can think of until it works. MP1 uses surfaces, so thats what i was looking for in MP2. If you know of a better solution (im sure you do), please, go for it. Implement it and either provide me with a patch, or i can give you the rights on GitHub so you can just push it. But giving me hints on how to make it better is not going to give us any results, as i dont have the background in all this render stuff and currently using my free time for other things .
If you want to leave it up to me, thats fine aswell, and im going to do it, at some point. But i have no idea when.

A generic solution in all case (no video, 1 or 2 video players) is the latter one, the finished rendered back buffer frame.

Click to expand...

I see, but my comment in the code should then show why i used 2 different approaches. The backbuffer was the first approach i ever did. However using the frame surface is faster, or atleast it was faster when i implemented it, and it has the nice effect that blackbars that are not encoded into the video will not be in the frame, as far as i can remember this also is true for osd and so on.
So whenever a frame surface from the videoplayer is available, it gets used, because its more desireble. Otherwise we fall back to the backbuffer which gives us everything we can see on screen (e.g. while browsing menus, looking at pictures and so on).

Found some time to have a look. Here is an intermittent version which works with the snapshot from 2015-08-01.
As soon as we are ready to release a new AtmoLight version for MP1, we will also update this one properly.