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/HelloWorld/CoinCircleMediaHandler.cpp b/HelloWorld/CoinCircleMediaHandler.cpp
index ae31281..8da2fd2 100644
--- a/HelloWorld/CoinCircleMediaHandler.cpp
+++ b/HelloWorld/CoinCircleMediaHandler.cpp
@@ -20,6 +20,7 @@
#include "CoinCircleMediaHandler.h"
#include "pluglog.h"
+#include <string_view>
const char sep = separator();
const std::string TAG = "CoinCircle";
@@ -28,15 +29,15 @@
namespace jami {
-CoinCircleMediaHandler::CoinCircleMediaHandler(std::map<std::string, std::string>&& ppm,
+CoinCircleMediaHandler::CoinCircleMediaHandler(std::map<std::string, std::string>&& preferences,
std::string&& datapath)
: datapath_ {datapath}
- , ppm_ {ppm}
+ , preferences_ {preferences}
{
setId(datapath_);
mVS = std::make_shared<CoinCircleVideoSubscriber>(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");
@@ -47,12 +48,12 @@
CoinCircleMediaHandler::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;
@@ -84,8 +85,8 @@
void
CoinCircleMediaHandler::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;
}
}