Skip to content
Snippets Groups Projects
Commit 82678f3d authored by Aline Gondim Santos's avatar Aline Gondim Santos
Browse files

SDK: add ChatHandler options

- fix classes names to capitalize
- add set -e to bash scripts
- code cleanup

Change-Id: Icc5c096afac62b7fe88f15496b15c4bfb45a9b0d
GitLab: #5
parent 520da845
Branches
No related tags found
No related merge requests found
Showing
with 114 additions and 108 deletions
......@@ -37,15 +37,15 @@ set(CMAKE_CXX_STANDARD_REQUIRED True)
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MT")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MTd")
set(plugin_SRC filterMediaHandler.cpp
filterAudioSubscriber.cpp
set(plugin_SRC FilterMediaHandler.cpp
FilterAudioSubscriber.cpp
main.cpp
../lib/frameFilter.cpp
../lib/frameUtils.cpp
)
set(plugin_HDR filterMediaHandler.h
filterAudioSubscriber.h
set(plugin_HDR FilterMediaHandler.h
FilterAudioSubscriber.h
../lib/frameUtils.h
../lib/audioFormat.h
../lib/frameFilter.h
......
......@@ -18,7 +18,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "filterAudioSubscriber.h"
#include "FilterAudioSubscriber.h"
extern "C" {
#include <libavcodec/avcodec.h>
......
......@@ -18,9 +18,10 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "filterMediaHandler.h"
#include "FilterMediaHandler.h"
#include "pluglog.h"
#include <string_view>
const char sep = separator();
const std::string TAG = "filter";
......@@ -29,28 +30,28 @@ const std::string TAG = "filter";
namespace jami {
filterMediaHandler::filterMediaHandler(std::map<std::string, std::string>&& ppm,
FilterMediaHandler::FilterMediaHandler(std::map<std::string, std::string>&& preferences,
std::string&& datapath)
: datapath_ {datapath}
, ppm_ {ppm}
, preferences_ {preferences}
{
setId(datapath_);
auto it = ppm_.find("irFile");
if (it != ppm_.end())
auto it = preferences_.find("irFile");
if (it != preferences_.end())
mAS = std::make_shared<FilterAudioSubscriber>(datapath_, it->second);
}
void
filterMediaHandler::notifyAVFrameSubject(const StreamData& data, jami::avSubjectPtr subject)
FilterMediaHandler::notifyAVFrameSubject(const StreamData& data, jami::avSubjectPtr subject)
{
if (!mAS)
return;
std::ostringstream oss;
std::string direction = data.direction ? "Receive" : "Preview";
std::string_view direction = data.direction ? "Receive" : "Preview";
oss << "NEW SUBJECT: [" << data.id << "," << direction << "]" << std::endl;
bool preferredStreamDirection = false; // false for output; true for input
auto it = ppm_.find("streamlist");
if (it != ppm_.end()) {
auto it = preferences_.find("streamlist");
if (it != preferences_.end()) {
preferredStreamDirection = it->second == "in";
}
oss << "preferredStreamDirection " << preferredStreamDirection << std::endl;
......@@ -70,7 +71,7 @@ filterMediaHandler::notifyAVFrameSubject(const StreamData& data, jami::avSubject
}
std::map<std::string, std::string>
filterMediaHandler::getCallMediaHandlerDetails()
FilterMediaHandler::getCallMediaHandlerDetails()
{
return {{"name", NAME},
{"iconPath", datapath_ + sep + "icon.png"},
......@@ -80,10 +81,10 @@ filterMediaHandler::getCallMediaHandlerDetails()
}
void
filterMediaHandler::setPreferenceAttribute(const std::string& key, const std::string& value)
FilterMediaHandler::setPreferenceAttribute(const std::string& key, const std::string& value)
{
auto it = ppm_.find(key);
if (it != ppm_.end() && it->second != value) {
auto it = preferences_.find(key);
if (it != preferences_.end() && it->second != value) {
it->second = value;
if (key == "irFile")
mAS->setIRFile(value);
......@@ -91,7 +92,7 @@ filterMediaHandler::setPreferenceAttribute(const std::string& key, const std::st
}
bool
filterMediaHandler::preferenceMapHasKey(const std::string& key)
FilterMediaHandler::preferenceMapHasKey(const std::string& key)
{
if (key == "irFile")
return true;
......@@ -99,16 +100,16 @@ filterMediaHandler::preferenceMapHasKey(const std::string& key)
}
void
filterMediaHandler::detach()
FilterMediaHandler::detach()
{
attached_ = '0';
mAS->detach();
}
filterMediaHandler::~filterMediaHandler()
FilterMediaHandler::~FilterMediaHandler()
{
std::ostringstream oss;
oss << " ~filterMediaHandler from AudioFilter Plugin" << std::endl;
oss << " ~FilterMediaHandler from AudioFilter Plugin" << std::endl;
Plog::log(Plog::LogPriority::INFO, TAG, oss.str());
detach();
}
......
......@@ -20,7 +20,7 @@
#pragma once
#include "filterAudioSubscriber.h"
#include "FilterAudioSubscriber.h"
#include "plugin/jamiplugin.h"
#include "plugin/mediahandler.h"
......@@ -29,11 +29,11 @@ using avSubjectPtr = std::weak_ptr<jami::Observable<AVFrame*>>;
namespace jami {
class filterMediaHandler : public CallMediaHandler
class FilterMediaHandler : public CallMediaHandler
{
public:
filterMediaHandler(std::map<std::string, std::string>&& ppm, std::string&& dataPath);
~filterMediaHandler();
FilterMediaHandler(std::map<std::string, std::string>&& preferences, std::string&& dataPath);
~FilterMediaHandler();
virtual void notifyAVFrameSubject(const StreamData& data, avSubjectPtr subject) override;
virtual std::map<std::string, std::string> getCallMediaHandlerDetails() override;
......@@ -45,7 +45,7 @@ public:
private:
const std::string datapath_;
std::map<std::string, std::string> ppm_;
std::map<std::string, std::string> preferences_;
std::string attached_ {'0'};
};
} // namespace jami
#! /bin/bash
# Build the plugin for the project
set -e
export OSTYPE
ARCH=$(arch)
EXTRAPATH=''
......@@ -65,8 +66,8 @@ then
-I"${PLUGINS_LIB}" \
./../lib/frameFilter.cpp \
./../lib/frameUtils.cpp \
filterMediaHandler.cpp \
filterAudioSubscriber.cpp \
FilterMediaHandler.cpp \
FilterAudioSubscriber.cpp \
main.cpp \
-L"${CONTRIB_PATH}/${CONTRIB_PLATFORM}/lib/" \
-l:libavfilter.a \
......@@ -196,8 +197,8 @@ then
-I"${PLUGINS_LIB}" \
./../lib/frameFilter.cpp \
./../lib/frameUtils.cpp \
filterMediaHandler.cpp \
filterAudioSubscriber.cpp \
FilterMediaHandler.cpp \
FilterAudioSubscriber.cpp \
main.cpp \
-L"${CONTRIB_PATH}/${CONTRIB_PLATFORM}/lib/" \
-lavfilter \
......
......@@ -24,7 +24,7 @@
#include <memory>
#include <plugin/jamiplugin.h>
#include "filterMediaHandler.h"
#include "FilterMediaHandler.h"
#ifdef WIN32
#define EXPORT_PLUGIN __declspec(dllexport)
......@@ -53,14 +53,14 @@ JAMI_dynPluginInit(const JAMI_PluginAPI* api)
// If invokeService doesn't return an error
if (api) {
std::map<std::string, std::string> ppm;
api->invokeService(api, "getPluginPreferences", &ppm);
std::map<std::string, std::string> preferences;
api->invokeService(api, "getPluginPreferences", &preferences);
std::string dataPath;
api->invokeService(api, "getPluginDataPath", &dataPath);
auto fmpfilterMediaHandler = std::make_unique<jami::filterMediaHandler>(std::move(ppm),
auto fmpFilterMediaHandler = std::make_unique<jami::FilterMediaHandler>(std::move(preferences),
std::move(dataPath));
if (api->manageComponent(api, "CallMediaHandlerManager", fmpfilterMediaHandler.release())) {
if (api->manageComponent(api, "CallMediaHandlerManager", fmpFilterMediaHandler.release())) {
return nullptr;
}
}
......
......@@ -18,7 +18,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "botchathandler.h"
#include "BotChatHandler.h"
#include "pluglog.h"
......@@ -29,19 +29,19 @@ const std::string TAG = "bot";
namespace jami {
botChatHandler::botChatHandler(const JAMI_PluginAPI* api,
std::map<std::string, std::string>&& ppm,
BotChatHandler::BotChatHandler(const JAMI_PluginAPI* api,
std::map<std::string, std::string>&& preferences,
std::string&& dataPath)
: api_ {api}
, datapath_ {dataPath}
{
ppm_ = ppm;
preferences_ = preferences;
setId(datapath_);
peerChatSubscriber_ = std::make_shared<botPeerChatSubscriber>(api_, dataPath);
peerChatSubscriber_ = std::make_shared<BotPeerChatSubscriber>(api_, dataPath);
};
void
botChatHandler::notifyChatSubject(std::pair<std::string, std::string>& subjectConnection,
BotChatHandler::notifyChatSubject(std::pair<std::string, std::string>& subjectConnection,
chatSubjectPtr subject)
{
if (subjects.find(subject) == subjects.end()) {
......@@ -55,30 +55,30 @@ botChatHandler::notifyChatSubject(std::pair<std::string, std::string>& subjectCo
}
std::map<std::string, std::string>
botChatHandler::getChatHandlerDetails()
BotChatHandler::getChatHandlerDetails()
{
return {{"name", NAME}, {"iconPath", datapath_ + sep + "icon.png"}, {"pluginId", id()}};
}
void
botChatHandler::setPreferenceAttribute(const std::string& key, const std::string& value)
BotChatHandler::setPreferenceAttribute(const std::string& key, const std::string& value)
{
auto it = ppm_.find(key);
if (it != ppm_.end()) {
if (ppm_[key] != value) {
ppm_[key] = value;
auto it = preferences_.find(key);
if (it != preferences_.end()) {
if (preferences_[key] != value) {
preferences_[key] = value;
}
}
}
bool
botChatHandler::preferenceMapHasKey(const std::string& key)
BotChatHandler::preferenceMapHasKey(const std::string& key)
{
return false;
}
void
botChatHandler::detach(chatSubjectPtr subject)
BotChatHandler::detach(chatSubjectPtr subject)
{
if (subjects.find(subject) != subjects.end()) {
subject->detach(peerChatSubscriber_.get());
......@@ -86,7 +86,7 @@ botChatHandler::detach(chatSubjectPtr subject)
}
}
botChatHandler::~botChatHandler()
BotChatHandler::~BotChatHandler()
{
auto& copy(subjects);
for (const auto& subject : copy) {
......
......@@ -20,7 +20,7 @@
#pragma once
#include "botPeerChatSubscriber.h"
#include "BotPeerChatSubscriber.h"
#include "plugin/jamiplugin.h"
#include "plugin/chathandler.h"
......@@ -34,13 +34,13 @@ using chatSubjectPtr = std::shared_ptr<jami::PublishObservable<jami::pluginMessa
namespace jami {
class botChatHandler : public jami::ChatHandler
class BotChatHandler : public jami::ChatHandler
{
public:
botChatHandler(const JAMI_PluginAPI* api,
std::map<std::string, std::string>&& ppm,
BotChatHandler(const JAMI_PluginAPI* api,
std::map<std::string, std::string>&& preferences,
std::string&& dataPath);
~botChatHandler() override;
~BotChatHandler() override;
virtual void notifyChatSubject(std::pair<std::string, std::string>& subjectConnection,
chatSubjectPtr subject) override;
......@@ -49,12 +49,12 @@ public:
virtual void setPreferenceAttribute(const std::string& key, const std::string& value) override;
virtual bool preferenceMapHasKey(const std::string& key) override;
std::shared_ptr<botPeerChatSubscriber> peerChatSubscriber_;
std::shared_ptr<BotPeerChatSubscriber> peerChatSubscriber_;
private:
const JAMI_PluginAPI* api_;
const std::string datapath_;
std::map<std::string, std::string> ppm_;
std::map<std::string, std::string> preferences_;
std::set<chatSubjectPtr> subjects;
};
} // namespace jami
......@@ -18,19 +18,19 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "botPeerChatSubscriber.h"
#include "BotPeerChatSubscriber.h"
#include "pluglog.h"
const std::string TAG = "bot";
namespace jami {
botPeerChatSubscriber::botPeerChatSubscriber(const JAMI_PluginAPI* api, std::string& textAnswer)
BotPeerChatSubscriber::BotPeerChatSubscriber(const JAMI_PluginAPI* api, std::string& textAnswer)
: api_ {api}
, textAnswer_ {textAnswer}
{}
botPeerChatSubscriber::~botPeerChatSubscriber()
BotPeerChatSubscriber::~BotPeerChatSubscriber()
{
std::ostringstream oss;
oss << "~botChatProcessor" << std::endl;
......@@ -38,10 +38,10 @@ botPeerChatSubscriber::~botPeerChatSubscriber()
}
void
botPeerChatSubscriber::update(Observable<pluginMessagePtr>*, const pluginMessagePtr& message)
BotPeerChatSubscriber::update(Observable<pluginMessagePtr>*, const pluginMessagePtr& message)
{
if (isAttached) {
if (message->direction == "0") {
if (message->direction) {
std::map<std::string, std::string> sendMsg;
for (auto& pair : message->data) {
if (pair.first == "text/plain" && pair.second == "hi") {
......@@ -58,7 +58,7 @@ botPeerChatSubscriber::update(Observable<pluginMessagePtr>*, const pluginMessage
}
void
botPeerChatSubscriber::attached(Observable<pluginMessagePtr>* observable)
BotPeerChatSubscriber::attached(Observable<pluginMessagePtr>* observable)
{
if (observables_.find(observable) == observables_.end()) {
std::ostringstream oss;
......@@ -70,7 +70,7 @@ botPeerChatSubscriber::attached(Observable<pluginMessagePtr>* observable)
}
void
botPeerChatSubscriber::detached(Observable<pluginMessagePtr>* observable)
BotPeerChatSubscriber::detached(Observable<pluginMessagePtr>* observable)
{
if (observables_.find(observable) != observables_.end()) {
observables_.erase(observable);
......@@ -83,11 +83,11 @@ botPeerChatSubscriber::detached(Observable<pluginMessagePtr>* observable)
}
void
botPeerChatSubscriber::sendText(std::string& accountId,
BotPeerChatSubscriber::sendText(std::string& accountId,
std::string& peerId,
std::map<std::string, std::string>& sendMsg)
{
pluginMessagePtr botAnswer = std::make_shared<JamiMessage>(accountId, peerId, "0", sendMsg, true);
pluginMessagePtr botAnswer = std::make_shared<JamiMessage>(accountId, peerId, false, sendMsg, true);
api_->invokeService(api_, "sendTextMessage", botAnswer.get());
}
} // namespace jami
......@@ -31,11 +31,11 @@
namespace jami {
class botPeerChatSubscriber : public Observer<pluginMessagePtr>
class BotPeerChatSubscriber : public Observer<pluginMessagePtr>
{
public:
botPeerChatSubscriber(const JAMI_PluginAPI* api, std::string& textAnswer);
~botPeerChatSubscriber();
BotPeerChatSubscriber(const JAMI_PluginAPI* api, std::string& textAnswer);
~BotPeerChatSubscriber();
virtual void update(Observable<pluginMessagePtr>*, pluginMessagePtr const&) override;
virtual void attached(Observable<pluginMessagePtr>*) override;
virtual void detached(Observable<pluginMessagePtr>*) override;
......
......@@ -36,13 +36,13 @@ set(CMAKE_CXX_STANDARD_REQUIRED True)
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MT")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MTd")
set(plugin_SRC botchathandler.cpp
botPeerChatSubscriber.cpp
set(plugin_SRC BotChatHandler.cpp
BotPeerChatSubscriber.cpp
main.cpp
)
set(plugin_HDR botchathandler.h
botPeerChatSubscriber.h
set(plugin_HDR BotChatHandler.h
BotPeerChatSubscriber.h
./../lib/pluglog.h
)
......
#! /bin/bash
# Build the plugin for the project
set -e
export OSTYPE
ARCH=$(arch)
EXTRAPATH=''
......@@ -63,8 +64,8 @@ then
-I"${DAEMON_SRC}" \
-I"${CONTRIB_PATH}/${CONTRIB_PLATFORM}/include" \
-I"${PLUGINS_LIB}" \
botchathandler.cpp \
botPeerChatSubscriber.cpp \
BotChatHandler.cpp \
BotPeerChatSubscriber.cpp \
main.cpp \
-L"${CONTRIB_PATH}/${CONTRIB_PLATFORM}/lib/" \
-o "build-local/jpl/lib/${CONTRIB_PLATFORM_CURT}-linux-gnu/${SO_FILE_NAME}"
......@@ -183,8 +184,8 @@ then
-I"${DAEMON_SRC}" \
-I"${CONTRIB_PATH}/${CONTRIB_PLATFORM}/include" \
-I"${PLUGINS_LIB}" \
botchathandler.cpp \
botPeerChatSubscriber.cpp \
BotChatHandler.cpp \
BotPeerChatSubscriber.cpp \
main.cpp \
-L"${CONTRIB_PATH}/${CONTRIB_PLATFORM}/lib/" \
-llog -lz \
......
......@@ -24,7 +24,7 @@
#include <memory>
#include <map>
#include "plugin/jamiplugin.h"
#include "botchathandler.h"
#include "BotChatHandler.h"
#ifdef WIN32
#define EXPORT_PLUGIN __declspec(dllexport)
......@@ -53,15 +53,15 @@ JAMI_dynPluginInit(const JAMI_PluginAPI* api)
// If invokeService doesn't return an error
if (api) {
std::map<std::string, std::string> ppm;
api->invokeService(api, "getPluginPreferences", &ppm);
std::map<std::string, std::string> preferences;
api->invokeService(api, "getPluginPreferences", &preferences);
std::string dataPath;
api->invokeService(api, "getPluginDataPath", &dataPath);
auto fmpbotChatHandler = std::make_unique<jami::botChatHandler>(api,
std::move(ppm),
auto fmpBotChatHandler = std::make_unique<jami::BotChatHandler>(api,
std::move(preferences),
std::move(dataPath));
if (api->manageComponent(api, "ChatHandlerManager", fmpbotChatHandler.release())) {
if (api->manageComponent(api, "ChatHandlerManager", fmpBotChatHandler.release())) {
return nullptr;
}
}
......
#! /bin/bash
# Build the plugin for the project
set -e
export OSTYPE
ARCH=$(arch)
EXTRAPATH=''
......
......@@ -52,11 +52,11 @@ JAMI_dynPluginInit(const JAMI_PluginAPI* api)
// If invokeService doesn't return an error
if (api) {
std::map<std::string, std::string> ppm;
api->invokeService(api, "getPluginPreferences", &ppm);
std::map<std::string, std::string> preferences;
api->invokeService(api, "getPluginPreferences", &preferences);
std::string dataPath;
api->invokeService(api, "getPluginDataPath", &dataPath);
auto fmp = std::make_unique<jami::PluginMediaHandler>(std::move(ppm), std::move(dataPath));
auto fmp = std::make_unique<jami::PluginMediaHandler>(std::move(preferences), std::move(dataPath));
if (!api->manageComponent(api, "CallMediaHandlerManager", fmp.release())) {
return pluginExit;
......
......@@ -22,6 +22,7 @@
#include "pluginMediaHandler.h"
// Logger
#include "pluglog.h"
#include <string_view>
const char sep = separator();
const std::string TAG = "FORESEG";
......@@ -29,12 +30,12 @@ const std::string TAG = "FORESEG";
namespace jami {
PluginMediaHandler::PluginMediaHandler(std::map<std::string, std::string>&& ppm,
PluginMediaHandler::PluginMediaHandler(std::map<std::string, std::string>&& preferences,
std::string&& datapath)
: datapath_ {datapath}
, ppm_ {ppm}
, preferences_ {preferences}
{
setGlobalPluginParameters(ppm_);
setGlobalPluginParameters(preferences_);
setId(datapath_);
mVS = std::make_shared<VideoSubscriber>(datapath_);
}
......@@ -43,12 +44,12 @@ void
PluginMediaHandler::notifyAVFrameSubject(const StreamData& data, jami::avSubjectPtr subject)
{
std::ostringstream oss;
std::string direction = data.direction ? "Receive" : "Preview";
std::string_view direction = data.direction ? "Receive" : "Preview";
oss << "NEW SUBJECT: [" << data.id << "," << direction << "]" << std::endl;
bool preferredStreamDirection = false;
auto it = ppm_.find("streamslist");
if (it != ppm_.end()) {
auto it = preferences_.find("streamslist");
if (it != preferences_.end()) {
Plog::log(Plog::LogPriority::INFO, TAG, "SET PARAMETERS");
preferredStreamDirection = it->second == "in";
}
......@@ -80,8 +81,8 @@ PluginMediaHandler::getCallMediaHandlerDetails()
void
PluginMediaHandler::setPreferenceAttribute(const std::string& key, const std::string& value)
{
auto it = ppm_.find(key);
if (it != ppm_.end() && it->second != value) {
auto it = preferences_.find(key);
if (it != preferences_.end() && it->second != value) {
it->second = value;
if (key == "background") {
mVS->setBackground(value);
......
......@@ -35,7 +35,7 @@ namespace jami {
class PluginMediaHandler : public jami::CallMediaHandler
{
public:
PluginMediaHandler(std::map<std::string, std::string>&& ppm, std::string&& dataPath);
PluginMediaHandler(std::map<std::string, std::string>&& preferences, std::string&& dataPath);
~PluginMediaHandler();
virtual void notifyAVFrameSubject(const StreamData& data, avSubjectPtr subject) override;
......@@ -49,7 +49,7 @@ public:
private:
const std::string datapath_;
std::map<std::string, std::string> ppm_;
std::map<std::string, std::string> preferences_;
std::string attached_ {'0'};
};
} // namespace jami
......@@ -21,6 +21,7 @@
#include "CenterCircleMediaHandler.h"
#include "pluglog.h"
#include <string_view>
const char sep = separator();
const std::string TAG = "CenterCircle";
......@@ -29,15 +30,15 @@ const std::string TAG = "CenterCircle";
namespace jami {
CenterCircleMediaHandler::CenterCircleMediaHandler(std::map<std::string, std::string>&& ppm,
CenterCircleMediaHandler::CenterCircleMediaHandler(std::map<std::string, std::string>&& preferences,
std::string&& datapath)
: datapath_ {datapath}
, ppm_ {ppm}
, preferences_ {preferences}
{
setId(datapath_);
mVS = std::make_shared<CenterCircleVideoSubscriber>(datapath_);
auto it = ppm_.find("color");
if (it != ppm_.end()) {
auto it = preferences_.find("color");
if (it != preferences_.end()) {
mVS->setColor(it->second);
} else {
mVS->setColor("#0000FF");
......@@ -48,12 +49,12 @@ void
CenterCircleMediaHandler::notifyAVFrameSubject(const StreamData& data, jami::avSubjectPtr subject)
{
std::ostringstream oss;
std::string direction = data.direction ? "Receive" : "Preview";
std::string_view direction = data.direction ? "Receive" : "Preview";
oss << "NEW SUBJECT: [" << data.id << "," << direction << "]" << std::endl;
bool preferredStreamDirection = false; // false for output; true for input
auto it = ppm_.find("videostream");
if (it != ppm_.end()) {
auto it = preferences_.find("videostream");
if (it != preferences_.end()) {
preferredStreamDirection = it->second == "1";
}
oss << "preferredStreamDirection " << preferredStreamDirection << std::endl;
......@@ -85,8 +86,8 @@ CenterCircleMediaHandler::getCallMediaHandlerDetails()
void
CenterCircleMediaHandler::setPreferenceAttribute(const std::string& key, const std::string& value)
{
auto it = ppm_.find(key);
if (it != ppm_.end() && it->second != value) {
auto it = preferences_.find(key);
if (it != preferences_.end() && it->second != value) {
it->second = value;
if (key == "color") {
......
......@@ -31,7 +31,7 @@ namespace jami {
class CenterCircleMediaHandler : public jami::CallMediaHandler
{
public:
CenterCircleMediaHandler(std::map<std::string, std::string>&& ppm, std::string&& dataPath);
CenterCircleMediaHandler(std::map<std::string, std::string>&& preferences, std::string&& dataPath);
~CenterCircleMediaHandler();
virtual void notifyAVFrameSubject(const StreamData& data, avSubjectPtr subject) override;
......@@ -45,7 +45,7 @@ public:
private:
const std::string datapath_;
std::map<std::string, std::string> ppm_;
std::map<std::string, std::string> preferences_;
std::string attached_ {"0"};
};
} // namespace jami
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment