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 defining parameters for a context or for its input or any of its outputs. Parameters are represented as dictionary objects (collections of key-value pairs), where both the key and value are strings. The parameters that apply to the context and its input and outputs depend on the media content being played or recorded.

Whether defining parameters for 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 that you want to define.

To set parameters for 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 set input parameters and mmr_output_parameters() for output parameters. In each case, you must pass in a handle to a separate dictionary object populated with the appropriate key-value pairs.

To modify 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 parameter settings with the latest settings, 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 a dictionary, call strm_dict_clone() to duplicate the handle before calling one of the parameter functions.