Hi,
i never had any issues with queuing and playing normal topologies before but this one realy makes me struggle. I am on it for almost 3 complete days ( i know its just a trivial problem ... ) but no luck.
I am queuing Live Recording Topologies, kinda bit like the CPlayer example from the MSDN docs but as Recorder. I create a media session on application startup and shutdown/release it before the app quits. When the user is pressing a hotkey/button a recording starts or stops, which means a topology is either queued and played or shutdown and cleared.
The first topology plays fine, start and stop work as expected. But when i am queuing the next topology and try to start it, the media session still trys to play the first topology. In the Topology there are 3-4 live sources, 2 are custom implemented and 2 are device sources. Since live sources do not send an MEEndOfStream, there is never an MEEndOfPresentation and so the media session doesnt know when to switch to the next topology. The process for playing 2 or more topologys is this :
->
1. Create first topology and queue it
2. Start Media Session.
3. Stop Media Session
4. On MESessionStopped shutdown media sources, asynchronous MFTs and call BeginFinalize Sink
5. On the callback of the sink call EndFinalize and then clear the current topology
6. Queue next topology
7. Start media Session
<-
And here at 7 it fails with HRESULT of "Invalid Request because shutdown has been called" ( MF_E_SHUTDOWN ). This makes sense as i just shutdown all the sources, transforms and sinks in the first topology so it cannot be started again.
As the MSDN doc states "The media session might keep the topology even after clear was called". Well its exactly what happens. It doesnt matter if you call SetTopology with the MFSESSION_SETTOPOLOGY_CLEAR_CURRENT flag or ClearTopologies, the session always keeps the first topology. The problem with switching to the next presentation is that there is no MEEndOfStream from the presentation streams and thus no MEEndOfPresentation. So the session still sees the first topology as the current presentation. Create and shutdown down a media session for each recording works of course, but thats not a fine solution.
My question is simple. How to switch to the next presentation/topology in the media session when using live sources? I tryed sending MEEndOfPresentation but with no effect. And my sources cant send MEEndOfStream as they are not all custom written, some of them are Device Sources.
I know that is walls of text for such a trivial problem, but i tested almost everything and read thousands of sites in the past 3 days, and i am almost going crazy.
Please can somebody point me to it.
Regards
co0Kie