Updated: October 28, 2024 |
To play or record media content, an application must configure the mm-renderer service by defining a context, specify an input and one or more outputs, configure any necessary parameters, and begin issuing playback commands.
If you want to define a new context, call mmr_context_create(), passing in the connection handle returned by the connection function, and also a context name.
Depending on your application needs and mm-renderer configuration, you may prefer to open an existing context by calling mmr_context_open(). See Working with contexts for more details.
Attach at least one output using mmr_output_attach(). For this function call and the subsequent ones used to define media flow and control playback, you must pass in the context handle returned by the function called in the second step.
If the media content you want to play has multiple components, you must call the output attachment function for each one. For example, to play a movie, you would call this function once to define where to direct the audio output and then again to define the video output device.
When your application is finished using a context, it should call mmr_context_close() to free the context's resources. Depending on the mm-renderer configuration and the handle passed in, this function might also destroy the context. Or, you may need to wait until you know the context isn't being used anymore and explicitly call mmr_context_destroy(). See Closing context handles for a description of the different handle types and the cases when mm-renderer destroys a context.
When it's finished using mm-renderer altogether, the application should disconnect from the service by calling mmr_disconnect().