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

modify mediaHandlerDetails

Change-Id: I07b8ff9e9df44109859bf954dd54acdcfc506ac3
parent ef9f8562
No related branches found
No related tags found
No related merge requests found
......@@ -15,9 +15,9 @@
"key": "modellist",
"title": "Model to load",
"summary": "Select the model to use",
"defaultValue": "model_256_Qlatency.tflite",
"entries": ["mv2_DLV3_256_MQ", "mv2_DLV3_256_QLATENCY_16", "mv2_DLV3_256_QLATENCY_8"],
"entryValues": ["mobilenet_v2_deeplab_v3_256_myquant.tflite", "model_256_Qlatency_16.tflite", "model_256_Qlatency.tflite"]
"defaultValue": "frozen_inference_graph.pb",
"entries": ["frozen_inference_graph", "mv2_DLV3_256_MQ", "mv2_DLV3_256_QLATENCY_16", "mv2_DLV3_256_QLATENCY_8"],
"entryValues": ["frozen_inference_graph", "mobilenet_v2_deeplab_v3_256_myquant.tflite", "model_256_Qlatency_16.tflite", "model_256_Qlatency.tflite"]
},
{
"category" : "ImageBackground",
......@@ -25,7 +25,7 @@
"key": "backgroundlist",
"title": "Background image",
"summary": "Select the image background to use",
"defaultValue": "background2.png",
"defaultValue": "background1.png",
"entries": ["background1", "background2"],
"entryValues": ["background1.png", "background2.png"]
}
......
/*
* Copyright (C) 2004-2020 Savoir-faire Linux Inc.
* Copyright (C) 2020 Savoir-faire Linux Inc.
*
* Author: Aline Gondim Santos <aline.gondimsantos@savoirfairelinux.com>
*
......@@ -24,7 +24,7 @@
const char sep = separator();
const std::string TAG = "FORESEG";
namespace jami
namespace jami
{
PluginMediaHandler::PluginMediaHandler(std::map<std::string, std::string>&& ppm, std::string &&datapath):
datapath_{datapath}, ppm_{ppm}
......@@ -32,8 +32,6 @@ namespace jami
setGlobalPluginParameters(ppm_);
setId(datapath_);
mVS = std::make_shared<VideoSubscriber>(datapath_);
// mpInput = std::make_shared<VideoSubscriber>(datapath_);
// mpReceive = std::make_shared<VideoSubscriber>(datapath_);
}
void PluginMediaHandler::notifyAVFrameSubject(const StreamData &data, jami::avSubjectPtr subject)
......@@ -43,30 +41,20 @@ namespace jami
std::string direction = data.direction ? "Receive" : "Preview";
oss << "NEW SUBJECT: [" << data.id << "," << direction << "]" << std::endl;
bool preferredStreamDirection = false;
if (!ppm_.empty() && ppm_.find("streamslist") != ppm_.end())
if (!ppm_.empty() && ppm_.find("streamslist") != ppm_.end())
{
Plog::log(Plog::LogPriority::INFO, TAG, "SET PARAMETERS");
// PluginParameters* mPluginParameters = nullptr;
// getGlobalPluginParameters(mPluginParameters);
// Plog::log(Plog::LogPriority::INFO, TAG, "GOT PARAMETERS");
preferredStreamDirection = ppm_.at("streamslist")=="in"?true:false;
// if(mPluginParameters != nullptr)
// {
// preferredStreamDirection = mPluginParameters->stream=="in"?true:false;
// }
}
oss << "preferredStreamDirection " << preferredStreamDirection << std::endl;
if (data.type == StreamType::video && !data.direction && data.direction == preferredStreamDirection)
if (data.type == StreamType::video && !data.direction && data.direction == preferredStreamDirection)
{
subject->attach(mVS.get()); // my image
// subject->attach(mpInput.get()); // my image
oss << "got my sent image attached" << std::endl;
} else if (data.type == StreamType::video && data.direction && data.direction == preferredStreamDirection)
} else if (data.type == StreamType::video && data.direction && data.direction == preferredStreamDirection)
{
subject->attach(mVS.get()); // the image i receive from the others on the call
// subject->attach(mpReceive.get()); // the image i receive from the others on the call
oss << "got my received image attached" << std::endl;
}
Plog::log(Plog::LogPriority::INFO, TAG, oss.str());
......@@ -74,7 +62,13 @@ namespace jami
std::map<std::string, std::string> PluginMediaHandler::getCallMediaHandlerDetails()
{
return {{"icoPath", datapath_ + sep + "icon.png"}};
std::map<std::string, std::string> mediaHandlerDetails = {};
mediaHandlerDetails["name"] = "Foreground Segmentation";
mediaHandlerDetails["iconPath"] = datapath_ + sep + "icon.png";
mediaHandlerDetails["pluginId"] = id();
return mediaHandlerDetails;
}
void PluginMediaHandler::setPreferenceAttribute(const std::string &key, const std::string &value)
......@@ -84,7 +78,7 @@ namespace jami
bool PluginMediaHandler::preferenceMapHasKey(const std::string &key)
{
if (ppm_.find(key) == ppm_.end())
if (ppm_.find(key) == ppm_.end())
{
return false;
}
......@@ -94,11 +88,9 @@ namespace jami
void PluginMediaHandler::detach()
{
mVS->detach();
// mpInput->detach();
// mpReceive->detach();
}
PluginMediaHandler::~PluginMediaHandler()
PluginMediaHandler::~PluginMediaHandler()
{
std::ostringstream oss;
oss << " ~FORESEG Plugin" << std::endl;
......
......@@ -44,8 +44,6 @@ namespace jami
virtual void setPreferenceAttribute(const std::string& key, const std::string& value) override;
std::shared_ptr<VideoSubscriber> mVS;
// std::shared_ptr<VideoSubscriber> mpInput;
// std::shared_ptr<VideoSubscriber> mpReceive;
std::string dataPath() const { return datapath_; }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment