Modular Media Server/User Guide/API: Difference between revisions
Line 14: | Line 14: | ||
=== Media Group === | === Media Group === | ||
A Media Group is a group of entities that are connected and | A Media Group is a group of entities that are connected and operate as a whole. This allows us to configure all the entities belonging to a whole group in a simpler way. For example, not having to put all the entities individually in play, but we put the multimedia group in play and it will take care of changing the status of all its entities. See figure 2. | ||
[[File:MediaGroup.png|thumb|center|700px|Figure 2: Media Group example ]] | [[File:MediaGroup.png|thumb|center|700px|Figure 2: Media Group example ]] | ||
A more complex system that could use two media groups could be the one in figure 3. This provides that the capture and encoder entities could be paused/played independently of the file recorders. | |||
[[File:MultipleMediaGroups.png|thumb|center|700px|Figure 3: Multiple Media Group example ]] | |||
== Media Server == | == Media Server == |
Revision as of 17:22, 23 June 2022
Modular Media Server |
---|
Introduction |
Building and Installation |
User Guide |
Contact Us |
Important concepts
Entity
An entity is a module encapsulating multimedia functionality, such as encoding, capture, or recording. For example, see figure 1 of an V4L2CaptureEntity that captures using v4l2src GStreamer component.
Media Group
A Media Group is a group of entities that are connected and operate as a whole. This allows us to configure all the entities belonging to a whole group in a simpler way. For example, not having to put all the entities individually in play, but we put the multimedia group in play and it will take care of changing the status of all its entities. See figure 2.
A more complex system that could use two media groups could be the one in figure 3. This provides that the capture and encoder entities could be paused/played independently of the file recorders.
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 media 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. |