Above diagram shows a high-level view of the Media Foundation architecture.
Primitives and Platform
Starting from the bottom of the diagram, the primitives are helper objects used throughout the Media Foundation API:
- Attributes are a generic way to store information inside an object, as a list of key/value pairs.
- Media Types describe the format of a media data stream.
- Media Buffers hold chunks of media data, such as video frames and audio samples, and are used to transport data between objects.
- Media Samples are containers for media buffers. They also contain metadata about the buffers, such as time stamps.
Media Pipeline
The media pipeline contains three types of object that generate or process media data:
- Media Sources introduce data into the pipeline. A media source might get data from a local file, such as a video file; from a network stream; or from a hardware capture device.
- Media Foundation Transforms (MFTs) process data from a stream. Encoders and decoders are implemented as MFTs.
- Media Sinks consume the data; for example, by showing video on the display, playing audio, or writing the data to a media file.
Third parties can implement their own custom sources, sinks, and MFTs; for example, to support new media file formats.
The Media Session controls the flow of data through the pipeline, and handles tasks such as quality control, audio/video synchronization, and responding to format changes.
The Media Session controls the flow of data through the pipeline, and handles tasks such as quality control, audio/video synchronization, and responding to format changes.
Source Reader and Sink Writer
The Source Reader and Sink Writer provide an alternative way to use the basic Media Foundation components (media sources, transforms, and media sinks). The source reader hosts a media source and zero or more decoders, while the sink writer hosts a media sink and zero or more encoders. You can use the source reader to get compressed or uncompressed data from a media source, and use the sink writer to encode data and send the data to a media sink.
No comments:
Post a Comment