Ring Daemon 16.0.0
Loading...
Searching...
No Matches
jami::CallServicesManager Class Reference

This class provides the interface between loaded MediaHandlers and call's audio/video streams. More...

#include <callservicesmanager.h>

Collaboration diagram for jami::CallServicesManager:
Collaboration graph

Public Member Functions

 CallServicesManager (PluginManager &pluginManager)
 Constructor registers MediaHandler API services to the PluginManager instance.
 
void clearAVSubject (const std::string &callId)
 Clears all stream subjects related to the callId.
 
void clearCallHandlerMaps (const std::string &callId)
 Removes call from mediaHandlerToggled_ mapping.
 
void createAVSubject (const StreamData &data, AVSubjectSPtr subject)
 Stores a AV stream subject with StreamData properties.
 
std::map< std::string, std::string > getCallMediaHandlerDetails (const std::string &mediaHandlerIdStr)
 Returns details Map from MediaHandler implementation.
 
std::vector< std::string > getCallMediaHandlers ()
 List all MediaHandlers available.
 
std::vector< std::string > getCallMediaHandlerStatus (const std::string &callId)
 Returns a list of active MediaHandlers for a given call.
 
 NON_COPYABLE (CallServicesManager)
 
bool setPreference (const std::string &key, const std::string &value, const std::string &rootPath)
 Sets a preference that may be changed while MediaHandler is active.
 
void toggleCallMediaHandler (const std::string &mediaHandlerId, const std::string &callId, const bool toggle)
 (De)Activates a given MediaHandler to a given call.
 
 ~CallServicesManager ()
 

Detailed Description

This class provides the interface between loaded MediaHandlers and call's audio/video streams.

Besides it: (1) stores pointers to all loaded MediaHandlers; (2) stores pointers to available streams subjects, and; (3) lists MediaHandler state with respect to each call. In other words, for a given call, we store if a MediaHandler is active or not.

Definition at line 43 of file callservicesmanager.h.

Constructor & Destructor Documentation

◆ CallServicesManager()

jami::CallServicesManager::CallServicesManager ( PluginManager pluginManager)

Constructor registers MediaHandler API services to the PluginManager instance.

These services will store MediaHandler pointers or clean them from the Plugin System once a plugin is loaded or unloaded.

Parameters
pluginManager

Definition at line 30 of file callservicesmanager.cpp.

References jami::emitSignal().

Here is the call graph for this function:

◆ ~CallServicesManager()

jami::CallServicesManager::~CallServicesManager ( )

Definition at line 35 of file callservicesmanager.cpp.

Member Function Documentation

◆ clearAVSubject()

void jami::CallServicesManager::clearAVSubject ( const std::string &  callId)

Clears all stream subjects related to the callId.

Parameters
callId

Definition at line 85 of file callservicesmanager.cpp.

◆ clearCallHandlerMaps()

void jami::CallServicesManager::clearCallHandlerMaps ( const std::string &  callId)

Removes call from mediaHandlerToggled_ mapping.

Parameters
callId

Definition at line 238 of file callservicesmanager.cpp.

◆ createAVSubject()

void jami::CallServicesManager::createAVSubject ( const StreamData data,
AVSubjectSPtr  subject 
)

Stores a AV stream subject with StreamData properties.

During the storage process, if a MediaHandler is supposed to be activated for the call to which the subject is related, the activation function is called.

Parameters
data
subject

Definition at line 43 of file callservicesmanager.cpp.

References DIR_SEPARATOR_CH, StreamData::direction, jami::emitSignal(), jami::PluginPreferencesUtils::getAlwaysPreference(), StreamData::id, StreamData::source, toggleCallMediaHandler(), and StreamData::type.

Here is the call graph for this function:

◆ getCallMediaHandlerDetails()

std::map< std::string, std::string > jami::CallServicesManager::getCallMediaHandlerDetails ( const std::string &  mediaHandlerIdStr)

Returns details Map from MediaHandler implementation.

Parameters
mediaHandlerIdStr
Returns
Details map from the MediaHandler implementation

Definition at line 167 of file callservicesmanager.cpp.

References jami::emitSignal().

Here is the call graph for this function:

◆ getCallMediaHandlers()

std::vector< std::string > jami::CallServicesManager::getCallMediaHandlers ( )

List all MediaHandlers available.

Returns
Vector with stored MediaHandlers pointers.

Definition at line 144 of file callservicesmanager.cpp.

References jami::emitSignal().

Here is the call graph for this function:

◆ getCallMediaHandlerStatus()

std::vector< std::string > jami::CallServicesManager::getCallMediaHandlerStatus ( const std::string &  callId)

Returns a list of active MediaHandlers for a given call.

Parameters
callId
Returns
Vector with active MediaHandler ids for a given call.

Definition at line 209 of file callservicesmanager.cpp.

References jami::emitSignal().

Here is the call graph for this function:

◆ NON_COPYABLE()

jami::CallServicesManager::NON_COPYABLE ( CallServicesManager  )

◆ setPreference()

bool jami::CallServicesManager::setPreference ( const std::string &  key,
const std::string &  value,
const std::string &  rootPath 
)

Sets a preference that may be changed while MediaHandler is active.

Parameters
key
value
rootPath
Returns
False if preference was changed.

Definition at line 221 of file callservicesmanager.cpp.

References jami::emitSignal().

Referenced by jami::JamiPluginManager::setPluginPreference().

Here is the call graph for this function:

◆ toggleCallMediaHandler()

void jami::CallServicesManager::toggleCallMediaHandler ( const std::string &  mediaHandlerId,
const std::string &  callId,
const bool  toggle 
)

(De)Activates a given MediaHandler to a given call.

If the MediaHandler receives video frames from a hardware decoder, we need to restart the sender to unlink our encoder and decoder. When we deactivate a MediaHandler, we try to relink the encoder and decoder by restarting the sender.

Parameters
mediaHandlerId
callId
togglenotify with new subjects if true, detach if false.

Definition at line 155 of file callservicesmanager.cpp.

References jami::emitSignal(), JAMI_ERR, and toggleCallMediaHandler().

Referenced by createAVSubject(), and toggleCallMediaHandler().

Here is the call graph for this function:

The documentation for this class was generated from the following files: