SDK: add ChatHandler options
- fix classes names to capitalize
- add set -e to bash scripts
- code cleanup
Change-Id: Icc5c096afac62b7fe88f15496b15c4bfb45a9b0d
GitLab: #5
diff --git a/GreenScreen/pluginMediaHandler.cpp b/GreenScreen/pluginMediaHandler.cpp
index fe6ab46..44d68c7 100644
--- a/GreenScreen/pluginMediaHandler.cpp
+++ b/GreenScreen/pluginMediaHandler.cpp
@@ -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 @@
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 @@
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 @@
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);