Modular Media Server/User Guide/API: Difference between revisions
No edit summary |
No edit summary |
||
Line 175: | Line 175: | ||
[[Category: | [[Category:Modular Media Server]] |
Revision as of 16:25, 27 May 2022
Modular Media Server |
---|
Introduction |
Building and Installation |
User Guide |
Contact Us |
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. |
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 |
---|---|---|
get_output_name | Gets the unique string name where others elements can listen to. | No parameter |
get_property | Gets the value of a property of the GStreamer element that the entity uses. | No parameter |
set_property | Sets the value of a property of the GStreamer element that the entity uses. | No parameter |
get_properties | Gets a dictionary with the properties and its values of all the properties of the entity. | No parameter |
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. |