Defining Parameters

Parameters allow you to set various properties that influence how media files are accessed and rendered during playback.

Properties such as the audio volume or video display size can be controlled by attaching parameters to a context or to its inputs or outputs. Parameters are represented as dictionary objects (collections of key-value pairs), where both the key and the value are strings. The parameters that apply to the context and its inputs and outputs depend on the media content being played or recorded.

Whether attaching parameters to the context or its inputs or outputs, your application has to call strm_dict_new() to create a new dictionary object if none exists. Use strm_dict_set() to set the key-value pairs for the parameters you want to attach.

To attach parameters to the context, call the function mmr_context_parameters(), passing the handle to the dictionary object that holds the context parameters. Similarly, call mmr_input_parameters() to attach the input parameters, and call mmr_output_parameters() to attach the output parameters. In each case, pass a handle to a separate dictionary object that's populated with the appropriate parameter key-value pairs.

To modify parameters, call the appropriate function again, passing a handle to a dictionary object populated with the new parameters. Note that the mmr_*_parameters() functions consume the dictionary object handle. If you want to keep the object, call the function strm_dict_clone() to duplicate the handle before calling one of the parameter functions.