Sure. Turns out you don't need to have a video playing in both windows. Just turn off composting in preferences. Open 2 browser windows. Play a video in one window and make full screen, then bring the window in the back to the front or move either window around and you will see the issue. The video "paints" over the other window.
You need to render into the window's rastport using DoHookClipRects(). Set the CompositeTags() destination rectangle to the clipping region (it's a clipping rectangle, which is perfect for the task).
Pushed the first draft of AHI device API implementation. I have been testing it with Youtube. For some reason the initial volume level between audio and GUI is not in sync for me. I have to always touch the volume control.
Regarding implementation, I just randomized something for buffer sizes etc. They may need some tuning.
Signal handling is a bit of a mess. I was using originally more signals to control the playback (pause, resume, kill and AHI) but it was so tricky to get right so I stepped back for a simpler solution. Now the whole thing is more or less dominated by the AHI double-buffering scheme, and it seems to be working, for me at least.
I guess the problem is that I'm not initializing new "volume" field in _Stream struct so if "audioSetVolume()" is not called, it could be 0. Should be simple to fix.
@Capehill Tested version with latest fix about initialize volume:
1). all builds without warnings 2). it runs! 3). it works! Tested on html5videoplayer with that "toystory" video, and with couple of youtube vids. 4). At first time noticed there heavier cpu loading, but then realize that debug enabled, so after disabling speed back to the same as with LIBRARY_API version. 5). Tested with all possible ahi settings (be it music unit as 0, or as name of sound card) - in all cases now can run as much as want audio apps at the same time with odyssey.
But i think i got new crash which i didn't before: when i chooice "loop" , in options of player, then after video about to be ended and after a while new loop should be started, i got a crash with such stack trace:
But it seems random , at least can't reproduce it right now again. Try to run some video , set it on loop and wait a bit (i also will try to made more tests in that terms)
The problem is in line 3718 & 3719: COMPTAG_DestWidth,hookData->right, COMPTAG_DestHeight,hookData->bottom,
The width and height should be the width and height of the clip rectangle, which comes from msg. It should be something like: COMPTAG_DestWidth, msg->Bounds.MaxX - msg->Bounds.MinX, COMPTAG_DestHeight, msg->Bounds.MaxY - msg->Bounds.MinY,
@Hans Thanks ! But while it fix our overlapping issue when more than one window is used, it leave us with 2 new issues:
1. With that change i have vertical black line in about 35% from the left side of the video (open in new tab for fullsize):
2. When i move another window on top of one with video, sometime i had some strange horisontal artifact-kind line on the left-top side of second window (open in new tab for fullsize):
Noticed through another issue when i had compositing effects disabled in gui : when i move any window over the one with composited video , it leave some artifacts for a frame, which disappear on a next one , and which effect i didn't have when compositing effects enabled. See what i mean:
Not sure through if it something to worry about, but as it different between compositing effects enabled/disabled, i just think maybe it's something we need to take care of. Not big deal for sure, but if things can be better why not :)
@K-L I seems don't have tearing. Do you have vsync works everywhere else, right ? (i had issue with VSYNC which was very visibly with warp3dnova logo demo (can be good test case for), and it ends up being bad VGA cable , and things fixes when i replace it on HDMI one).
Noticed through another issue when i had compositing effects disabled in gui : when i move any window over the one with composited video , it leave some artifacts for a frame, which disappear on a next one , and which effect i didn't have when compositing effects enabled. See what i mean:
Not sure through if it something to worry about, but as it different between compositing effects enabled/disabled, i just think maybe it's something we need to take care of. Not big deal for sure, but if things can be better why not :)
Not quite sure why that happens, although it's a minor issue because those areas are being cleared to black.
Maybe its related to the window's refresh method, or the black areas are drawn by the background fill hook. If there's a background fill hook active, then a custom one could be written to fill in the missing part of the current frame.
@Hans Yeah, that for sure of not real needs to be deal with, as anyway those ones who have compositing video should have compositing effects enabled. But even if they didn't , everything works, and that difference not worth of time wasting.
@Capehill Doesn't you mind if i update main repo with your ahi-rewrite, and made another beta, so all can test if it just on my setup i have random crash when video about to be looped ?