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 HTTPS authentication credentials can be controlled by attaching parameters to a context or to its input or any of its outputs. Parameters are represented as dictionary objects (collections of key-value pairs), where both the keys and values are strings. The parameters that apply to the context and its input and outputs depend on the media content being played or recorded.

Whether attaching parameters to the context, its input, or one of its 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 in the handle to the dictionary object that holds the context parameters. Similarly, call mmr_input_parameters() to attach input parameters, and call mmr_output_parameters() to attach output parameters. In each case, you must pass in a handle to a separate dictionary object populated with the appropriate key-value pairs.

To update parameters, call the appropriate function again, passing in a handle to a dictionary object populated with the new parameters. Note that the mmr_*_parameters() functions replace any previous set of parameters with the latest set, so the caller must keep track of which parameters have been defined. Also, the parameter functions consume the dictionary object handle in each call. If you want to keep the dictionary, call strm_dict_clone() to duplicate the handle before calling a parameter function.