Page 1 of 1

A peek under the hood part 1

Posted: Fri Mar 09, 2018 5:44 pm
by jachin99
The goal of this series is to provide some technical background for Media Center application authors who are interested in what the Windows Media Center Presentation Layer is and how it works.

This post takes an introductory look at the Windows Media Center Presentation Layer’s internal components and architecture. Future posts will provide additional detail on the topics discussed here. Some implementation detail has been simplified so we can focus squarely on the functionality authors can use from MCML.

Architecture
The Windows Media Center Presentation Layer has three distinct architectural components: a User Experience Framework and a portable Rendering Engine with an asynchronous Messaging System connecting them.



Each component has a different role. The User Experience Framework makes complex 10-foot UI problems tractable and easy. The Rendering Engine delivers composited UI and video at high and stable frame rates. The Messaging System decouples the operation of the other two components with a high-performance, queued-command interconnect.

This configuration provides several important benefits:
•It allows the User Experience Framework to employ computationally expensive UI algorithms without compromising the performance of the rendering path.
•It allows the User Experience Framework and Rendering Engine to run in different security contexts if needed.
•It allows the User Experience Framework and Rendering Engine to be on different physical devices without sacrificing UI interactivity or fidelity.
•It allows the Rendering Engine to be shared by multiple client processes and gracefully tolerate client failures.
•It allows the Rendering Engine to employ custom, media-oriented timing algorithms that would otherwise burden UI code with unusual constraints.

The Messaging System doesn’t have a lot of internal complexity. For the rest of this discussion, we’ll dig a little deeper into the designs of the User Experience Framework and Rendering Engine. As we will see, both components are highly modular, allowing for (and owing to) rapid evolution over short product cycles.

Here’s a modified diagram that highlights the major architectural features of the User Experience Framework and Rendering Engine:



As the User Experience Framework and Rendering Engine have different design goals, they also have substantially different internal architectures. Where the User Experience Framework focuses on high-functionality and configurability, the Rendering Engine implements narrow set of functionality with an extreme emphasis on efficiency. The User Experience Framework is 100% managed code based on the Microsoft .Net Framework. Its primary external programming model is declarative XML. In contrast, the Rendering Engine is 100% unmanaged code whose primary programming model is an optimized binary command stream.

Here’s a summary of the components in the diagram above:

User Experience Framework
•Common Primitives - Defines a library of useful objects for MCML authors (images, text, video, list handling…). Exposes rendering features and advanced UI customization support from the libraries.
•MCML UI Description Model - Ties together underlying UI and rendering services to provide the core MCML authoring model.
•UI Library - Implements a variety of modular UI services (layout, input, data binding, web resource fetching…).
•Rendering Library - Provides a low level programming model for communicating with and controlling the Rendering Engine.
•Core Services - Implements core UI interoperability and scheduling models to facilitate modular design and integration of framework components.

Rendering Engine
•Animation System - Provides facilities for describing modifications to the Presentation Model according to a timeline. Allows the Rendering Engine to modify UI scenes on a per-frame basis without looping in the User Experience Framework on each clock tick.
•Presentation Model - Defines an abstract model for describing a scene (visuals, transforms, sounds…).
•Output Drivers - Provides technology-specific implementations of the Presentation Model (DirectX, XBOX, Win32/GDI…).
•Core Services - Forms the foundation for Rendering Engine features and communication with the User Experience Framework. Implements memory management, an unmanaged object system, a scheduling layer and a transport endpoint for the Messaging System.

It’s interesting to note that only the top two layers of the User Experience Framework (MCML UI Description Model and Common Primitives) are exposed as public API surface. The rest of the layers are just how we bring the functionality to you while leaving room to grow in the future.

The other day I commented in our Windows Media Center Presentation Layer Web Applications intro post that this post would provide answers about how MCML-based applications can get native fidelity on XBOX 360 while their markup and code run on the Media Center PC. The answer should be clear at this point: we’ve ported the Rendering Engine and its end of the Messaging System to XBOX 360.

This concludes our architectural introduction to the Windows Media Center Presentation Layer. I hope this post helps situate MCML in your mind and provides some context for what’s going on under the markup.

Francis