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/SDK/Templates/genericMediaHandler.cpp b/SDK/Templates/genericMediaHandler.cpp
index 3254925..4a6ee78 100644
--- a/SDK/Templates/genericMediaHandler.cpp
+++ b/SDK/Templates/genericMediaHandler.cpp
@@ -3,6 +3,7 @@
#include "GENERICMediaHandler.h"
#include "pluglog.h"
+#include <string_view>
const char sep = separator();
const std::string TAG = "GENERIC";
@@ -11,10 +12,10 @@
namespace jami {
-GENERICMediaHandler::GENERICMediaHandler(std::map<std::string, std::string>&& ppm,
+GENERICMediaHandler::GENERICMediaHandler(std::map<std::string, std::string>&& preferences,
std::string&& datapath)
: datapath_ {datapath}
- , ppm_ {ppm}
+ , preferences_ {preferences}
{
setId(datapath_);
mediaSubscriber_ = std::make_shared<GENERICDATATYPESubscriber>(datapath_);
@@ -24,7 +25,7 @@
GENERICMediaHandler::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
@@ -57,8 +58,8 @@
void
GENERICMediaHandler::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 == "PREFERENCE1") {
// use preference
@@ -69,9 +70,9 @@
bool
GENERICMediaHandler::preferenceMapHasKey(const std::string& key)
-{
- ----------------if (key == "PREFERENCE2") { return true; }
- ----------------return false;
+{----------------
+ if (key == "PREFERENCE2") { return true; }----------------
+ return false;
}
void