Context management

Each mm-renderer context manages a separate media flow independently of other contexts. The media flow is determined by the input and the outputs that you attach to the context as well as the input and output parameters. You can also set context parameters, which are independent of the media files being played.

To create a context, call mmr_context_create(). Depending on the mm-renderer configuration, you may be able to open an existing context by calling mmr_context_open(). Both of these functions return a context handle that you must pass in to subsequent API calls to perform media operations on the same context.

The sequence of API calls needed to access a context, set its parameters, define an input and output (and set their parameters), and start playback is outlined in "Playing media".

When you're finished using a context, you must close it to properly free resources. You may want to or have to destroy the context in addition to closing it, based on your application needs and mm-renderer configuration. The behavior of the mm-renderer service when closing context handles is complex, as explained in detail in "Working with contexts".