Contexts

The mm-renderer service provides contexts, each of which can play a stream of media content concurrently with and independently of other contexts. Each context can direct output to a different set of hardware devices or files, creating independent zones of operation.

The operations that are available for a context at a particular time depend on the input and outputs attached to it. For example, changing playlists won't work unless your input type is a playlist, and seeking to a new track position doesn't apply for some input streams (e.g., radio stations) or devices (e.g., microphones). You can use a context for operations other than playing, by setting its output appropriately. For instance, you can record rather than play an audio stream by setting a context's output to a file and its input to an audio capture device (i.e., a microphone).

Your application must connect to the mm-renderer service before it can create a context. When your application creates a context, the context has a unique name but no other properties are set. For subsequent operations, your application accesses the context through the handle returned by mm-renderer when it created the context. Depending on its configuration, mm-renderer may behave differently when you close context handles.

You can control properties of the context's operation (e.g., audio volume) by attaching parameters to the context, its input, or each of its outputs (for details, see "Parameters").