Scott Johnson
Scott Johnson

Reputation: 101

How to use Windows Media Foundation with UWP without a topology

I have been reading the Polinger book "Developing Microsoft Media Foundation Applications" in order to understand the Microsoft sample MixedRemoteViewCompositor for the Hololens. A key concept of the text is that Media Foundation components are COM objects that are connected into a graph structure called a Topology. However, the sample code is for Universal Windows Platform (UWP) and the word "topology" does not exist anywhere in the code. The call to create a topology does not exist in the code.

So my question is whether UWP applications use a topology in Media Foundation and if not how does one connect the Media Foundation COM components together to form a processing pipeline? The sample code has sources and sinks but I cannot tell how they connect.

Scott

Upvotes: 2

Views: 1384

Answers (1)

Evgeny Pereguda
Evgeny Pereguda

Reputation: 583

So my question is whether UWP applications use a topology in Media Foundation No.

Firstly, IMFTopologyNode interface is not allowed in UWP.

Secondly, IMFTopology interface which contains IMFTopologyNode, is not allowed in UWP.

Thirdly, IMFMediaSession interface which creates media pipeline by IMFTopology, is not allowed in UWP,

Fourthly, MFCreateMediaSession - "C" function which creates IMFMediaSession, is not allowed in UWP.

not how does one connect the Media Foundation COM components together to form a processing pipeline? - it is done behind of MF components with IMFSourceReader and IMFSinkWriter - developer CANNOT have direct access to those processing pipelines.

So is it possible to use Media Foundation Transforms (MFT) with the UWP architecture? Yes. If you want add your's component with IMFTransform interface - then you must use component with IMFSourceReaderEx interface - it has method AddTransformForStream - Adds a transform, such as an audio or video effect, to a stream.

About How create Source Reader you can read there - Source Reader

Upvotes: 1

Related Questions