Ring Daemon
16.0.0
Loading...
Searching...
No Matches
mediahandler.h
Go to the documentation of this file.
1
/*
2
* Copyright (C) 2004-2025 Savoir-faire Linux Inc.
3
*
4
* This program is free software: you can redistribute it and/or modify
5
* it under the terms of the GNU General Public License as published by
6
* the Free Software Foundation, either version 3 of the License, or
7
* (at your option) any later version.
8
*
9
* This program is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
* GNU General Public License for more details.
13
*
14
* You should have received a copy of the GNU General Public License
15
* along with this program. If not, see <https://www.gnu.org/licenses/>.
16
*/
17
#pragma once
18
19
#include "
streamdata.h
"
20
#include "
observer.h
"
21
22
#include <string>
23
#include <memory>
24
#include <map>
25
26
extern
"C"
{
27
struct
AVFrame;
28
}
29
30
namespace
jami
{
31
32
using
avSubjectPtr
= std::shared_ptr<Observable<AVFrame*>>;
33
38
class
MediaHandler
39
{
40
public
:
41
virtual
~MediaHandler
() =
default
;
42
46
std::string
id
()
const
{
return
id_; }
47
52
virtual
void
setId
(
const
std::string&
id
)
final
{ id_ =
id
; }
53
54
private
:
55
// Must be set with plugin's dataPath.
56
std::string id_;
57
};
58
65
class
CallMediaHandler
:
public
MediaHandler
66
{
67
public
:
73
virtual
void
notifyAVFrameSubject
(
const
StreamData
& data,
avSubjectPtr
subject
) = 0;
74
83
virtual
std::map<std::string, std::string>
getCallMediaHandlerDetails
() = 0;
84
88
virtual
void
detach
() = 0;
89
96
virtual
void
setPreferenceAttribute
(
const
std::string& key,
const
std::string&
value
) = 0;
97
104
virtual
bool
preferenceMapHasKey
(
const
std::string& key) = 0;
105
};
106
}
// namespace jami
jami::CallMediaHandler
This abstract class is an API we need to implement from plugin side.
Definition
mediahandler.h:66
jami::CallMediaHandler::detach
virtual void detach()=0
Should detach the plugin data process (Observer).
jami::CallMediaHandler::setPreferenceAttribute
virtual void setPreferenceAttribute(const std::string &key, const std::string &value)=0
If a preference can be changed without the need to reload the plugin, it should be done through this ...
jami::CallMediaHandler::getCallMediaHandlerDetails
virtual std::map< std::string, std::string > getCallMediaHandlerDetails()=0
Should return a map with handler's name, iconPath, pluginId, attached, and dataType.
jami::CallMediaHandler::notifyAVFrameSubject
virtual void notifyAVFrameSubject(const StreamData &data, avSubjectPtr subject)=0
Should attach a AVSubject (Observable) to the plugin data process (Observer).
jami::CallMediaHandler::preferenceMapHasKey
virtual bool preferenceMapHasKey(const std::string &key)=0
If a preference can be changed without the need to reload the plugin, this function should return Tru...
jami::MediaHandler
It's the base object of the CallMediaHandler.
Definition
mediahandler.h:39
jami::MediaHandler::setId
virtual void setId(const std::string &id) final
Should be called by the MediaHandler creator to set the plugins id_ variable with dataPath.
Definition
mediahandler.h:52
jami::MediaHandler::~MediaHandler
virtual ~MediaHandler()=default
jami::MediaHandler::id
std::string id() const
Returns the dataPath of the plugin that created this MediaHandler.
Definition
mediahandler.h:46
jami
Definition
account.cpp:61
jami::emitSignal
void emitSignal(Args... args)
Definition
ring_signal.h:64
jami::avSubjectPtr
std::shared_ptr< Observable< AVFrame * > > avSubjectPtr
Definition
mediahandler.h:32
observer.h
streamdata.h
StreamData
Contains information about an AV subject.
Definition
streamdata.h:29
src
plugin
mediahandler.h
Generated on Thu Jun 19 2025 15:50:37 for Ring Daemon by
1.9.8