Context management

Updated: October 26, 2022

Each mm-renderer context manages a separate media flow independently of other contexts. The media flow is defined by the input and the outputs, and can be configured by parameters.

To create a context, call mmr_context_create(). Depending on the mm-renderer command-line options, you may be able to access an existing context by calling mmr_context_open(). Both functions return a context handle that you must pass into subsequent API calls to perform operations on the same context. These operations include setting context parameters, attaching an input and outputs and setting their parameters, and controlling playback.

When you're finished using a context handle, you must close it with mmr_context_close() to properly free its resources. You may also want to or need to destroy the context (with mmr_context_destroy()), based on your application needs.