With an MFSink object, you can use 2 special options to deliver your content: virtual devices, and mp:// links.
Using virtual devices
A virtual device is a DirectShow video capture source created by an MFSink object that can be used in third-party applications or DirectShow graphs.
To enable a virtual device you need to create an MFSink object and put frames into it just like into any other receiver object:
MFSinkClass m_objMFSink;
m_objMFSink = new MFSinkClass();
Initialize it. The sink name (for mp:// links) is "MFReaderSink" and the virtual device name "MFormats VSource":
m_objMFSink.SinkInit("MFReaderSink", "MFormats VSource", null);
Put frames into sink objects as to a common receiver object:
m_objMFSink.ReceiverFramePut(pFrame, -1, "");
Once this is done you can use this device in DirectShow graphs or third party applications.
Using mp:// links (our internal transmission protocol)
The MFSink object creates a mp:// link that can be played by MFReader just like a common network URL. You can use mp:// links to share your object between several applications based on MForamts SDK or to use a single source multiple times.
Once you have initialized MFSink object as described above, you can enumerate available sinks in other MFormats application, build the URL and playback it.
The URL structure is very simple: it's just a sink name with leading "mp://". For example for the URL for the sink created with the code above is "mp://MFReaderSink":
Create MFReader class object to play the external mp:// link
MFReaderClass m_objReader = new MFReaderClass();
Get available senders number
int nCount = 0;
m_objReader.SendersGetCount(out nCount);
Enumerate available senders if needed and get required sender's name
string strName;
M_VID_PROPS vidProps;
M_AUD_PROPS audProps;
m_objReader.SendersGetByIndex(0, out strName, out vidProps, out audProps);
As you have got the sender name, you can build the sender URL:
string senderURL = "mp://" + strName;
Now you can open a reader and playback the URL just like a common network stream
m_objReader.ReaderOpen(senderURL, "");
// ... some code to make a loop for picking frames from the reader ...
// Get frames as you do with any other source
m_objReader.SourceFrameConvertedGet(ref m_avProps, -1, out pFrame, "");