Once my brain recovered from friday nights substance abuse (waking up still high on caffine is an... intresting... experiance, heh) I took a poke at the video encoding code again and made a couple of changes under the hood.
Firstly, added multiple colour destination buffers and gave the user the ability to swap between RGB and RGBA. I still need to check it lines up correctly on memory access but meh.
Also, the file is opened on construction as before, however the buffers are also grabbed at construction. The file isn't closed and the buffers aren't released until the class is deleted from memory.
I've also sorted the code out so the framebuffer turns up the right way up now [grin]
This happens at no real extra cost compared to how I was doing it, just needed to do some magic backwards line walking to get the right data at the right point.
Tomorrow I might take a few mins to try and thread this.
The main points of contention are pushing and poping from the two stacks I use to maintain a free/used buffers list.
Main thread pops from the free and pushes to the used.
Encoding thread will pop from the used and push onto the free.
I'll probably just go simple and do it with locks or something like that, unless the locking proves to be a point of contention... which I see as being unlikely at best.
Anyways... I was going to write more, but a mate of mine has just informed me he has a date... so, as I now figure we are living in the end times I don't see the point [wink]
Seriously, it's thrown me, heh