Quantcast
Channel: Media Foundation Development for Windows Desktop forum
Viewing all articles
Browse latest Browse all 1079

Loopback recording using IMFAsyncCallback

$
0
0

Hi,

i have plan to put my loopback recording of the systems audio mix in a seperated thread to not block the main thread and to avoid audio loss i experienced and as measured and described by othershere.

But before i start implementing the Async Callback and then create an Async Result and put a work item into a "private" work queue there are a few things i would like to know. First and most important question is :

Can i write audio samples with the sink writer while also writing video samples at the same time ? Because i have 2 streams on my sink writer i also have 2 MFTs there, one for video and one for audio. MSDN says that by default a MFT is using synchronous methods, but can the sink writer be accessed multithreaded so that it can deliver to the MFTs for the streams simultaniously ? Does a MFT directly get the sample pointer and process the data instantly when the ->WriteSample function is called, does the sink writer accept orders from multiple threads and send the sample pointers as soon as possible to the MFTs so that they can process the data ( the sink writer calls ->ProcessInput on the MFT right ) ? This would imply that the sink writer would use his own work queue right ?

And another question would be how to hold audio sync then. My app encodes real time/live the system audio and the backbuffer of games. Currently my app is working and the only thing left is audio synchronisation, my audio plays a bit to fast ( speeded up ) and ends before video ends. How to work with IAudioClient->Start() and Stop() on real time encoding apps, is it just math or is there a straight foward manner ?

regards

coOKie





Viewing all articles
Browse latest Browse all 1079

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>