Modular Media Server - User Guide - API

From RidgeRun Developer Wiki





  Index  





Media Server

Media Server is the class that is responsible for managing the entire system. It functions as the interface to interact with the entire Modular Media Server. Among the features it has are:

  • Get the statuses of the multimedia groups.
  • Get the parameters of the entities.
  • Create, modify and interact with media groups.


Method Description Description
__init__ Initialize the Media server Logger: requires an logger entity
get_media_groups_names Gets all the media groups names that have bee created. No parameter
get_media_group_status Gets the media group status using its name. media_group_name (str): media group name of which we want the status.
get_element_names Gets all the names of the supported modules. No parameter
get_parameters_description Gets the GStreamer supported entities that the module can manage. No parameter
create_media_group Creates a media group based on a dictionary. media_group_name (str): name of the media group to create, entities_list_description (List): list with the description of the entities to create in the media group.
add_entity_to_media_group Adds an entity(s) to an existing media group. media_group_name (str): name of the media group to add the entity, entities_list_description (List): list with the entities to add.
get_media_group Get all the modules associated to a multimedia group. media_group_name (str): name of the media group from which the modules will be obtained.
start Changes a media group state to play. media_group_name (str): name of the media group to start.
stop Changes a media group state to stop. media_group_name (str): name of the media group to stop.
Table 1. Provided Methods of the Media Server


A basic example implementation of the Media Server is proposed in the next section.

Media Entity

Media Entity is the base class for all multimedia entities. All entities must inherit from this class. It provides the following methods:

Method Description Description
__init__ Initialize the Media server Logger: requires an logger entity
Table 2. Provided Methods of the Media Server

Logger

The logger is an interface that the project provides to manage generated messages from the application. The project offers a console logger that displays the message in the Linux terminal. You can create your own logger to handle generated messages according to your requirements. An example would be that messages are saved in a file instead of showing the messages to the console. This is free to implement. The Logger interface to implement is the following.

Method Description Description
log_error Logs all the error messages generate by the application. message (str): error message.
log_info Logs all the information messages generate by the application. message (str): info message.
log_debug Logs all the debug messages generate by the application. message (str): debug message.
Table 1. Logger inteface methods to implement custom logger



  Index