Skip to content
Snippets Groups Projects
Commit f8f80f0a authored by Eloi Bail's avatar Eloi Bail
Browse files

media/video: put adapative algorithm configurable

Add codec properties accessible by client and LRC to enable or
disable adaptative algorithm

Change-Id: Ia1baaad8a4fec6713e9657af4759ffe071be4ab5
Tuleap: #215
parent cffdc750
Branches
No related tags found
No related merge requests found
...@@ -227,6 +227,7 @@ constexpr static const char QUALITY [] = "CodecInfo.quality"; ...@@ -227,6 +227,7 @@ constexpr static const char QUALITY [] = "CodecInfo.quality";
constexpr static const char MIN_QUALITY [] = "CodecInfo.min_quality"; constexpr static const char MIN_QUALITY [] = "CodecInfo.min_quality";
constexpr static const char MAX_QUALITY [] = "CodecInfo.max_quality"; constexpr static const char MAX_QUALITY [] = "CodecInfo.max_quality";
constexpr static const char CHANNEL_NUMBER [] = "CodecInfo.channelNumber"; constexpr static const char CHANNEL_NUMBER [] = "CodecInfo.channelNumber";
constexpr static const char AUTO_QUALITY_ENABLED [] = "CodecInfo.autoQualityEnabled";
} //namespace DRing::Account::ConfProperties::CodecInfo } //namespace DRing::Account::ConfProperties::CodecInfo
......
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
#include "account_const.h" #include "account_const.h"
#include "string_utils.h" #include "string_utils.h"
#include "logger.h"
#include <string> #include <string>
#include <sstream> #include <sstream>
...@@ -202,7 +203,8 @@ AccountVideoCodecInfo::getCodecSpecifications() ...@@ -202,7 +203,8 @@ AccountVideoCodecInfo::getCodecSpecifications()
{DRing::Account::ConfProperties::CodecInfo::QUALITY, to_string(quality)}, {DRing::Account::ConfProperties::CodecInfo::QUALITY, to_string(quality)},
{DRing::Account::ConfProperties::CodecInfo::MAX_QUALITY, to_string(systemCodecInfo.maxQuality)}, {DRing::Account::ConfProperties::CodecInfo::MAX_QUALITY, to_string(systemCodecInfo.maxQuality)},
{DRing::Account::ConfProperties::CodecInfo::MIN_QUALITY, to_string(systemCodecInfo.minQuality)}, {DRing::Account::ConfProperties::CodecInfo::MIN_QUALITY, to_string(systemCodecInfo.minQuality)},
{DRing::Account::ConfProperties::CodecInfo::FRAME_RATE, to_string(frameRate)} {DRing::Account::ConfProperties::CodecInfo::FRAME_RATE, to_string(frameRate)},
{DRing::Account::ConfProperties::CodecInfo::AUTO_QUALITY_ENABLED, bool_to_str(isAutoQualityEnabled)}
}; };
} }
...@@ -220,6 +222,10 @@ AccountVideoCodecInfo::setCodecSpecifications(const std::map<std::string, std::s ...@@ -220,6 +222,10 @@ AccountVideoCodecInfo::setCodecSpecifications(const std::map<std::string, std::s
it = details.find(DRing::Account::ConfProperties::CodecInfo::QUALITY); it = details.find(DRing::Account::ConfProperties::CodecInfo::QUALITY);
if (it != details.end()) if (it != details.end())
quality = ring::stoi(it->second); quality = ring::stoi(it->second);
it = details.find(DRing::Account::ConfProperties::CodecInfo::AUTO_QUALITY_ENABLED);
if (it != details.end())
isAutoQualityEnabled = (it->second == TRUE_STR) ? true : false;
} }
AccountVideoCodecInfo::~AccountVideoCodecInfo() AccountVideoCodecInfo::~AccountVideoCodecInfo()
......
...@@ -191,6 +191,7 @@ struct AccountVideoCodecInfo : AccountCodecInfo ...@@ -191,6 +191,7 @@ struct AccountVideoCodecInfo : AccountCodecInfo
unsigned frameRate; unsigned frameRate;
unsigned profileId; unsigned profileId;
std::string parameters; std::string parameters;
bool isAutoQualityEnabled{true};
}; };
bool operator== (SystemCodecInfo codec1, SystemCodecInfo codec2); bool operator== (SystemCodecInfo codec1, SystemCodecInfo codec2);
......
...@@ -104,8 +104,12 @@ void VideoRtpSession::startSender() ...@@ -104,8 +104,12 @@ void VideoRtpSession::startSender()
RING_ERR("%s", e.what()); RING_ERR("%s", e.what());
send_.enabled = false; send_.enabled = false;
} }
if (not rtcpCheckerThread_.isRunning()) auto codecVideo = std::static_pointer_cast<ring::AccountVideoCodecInfo>(send_.codec);
auto isAutoQualityEnabledStr = codecVideo->getCodecSpecifications()[DRing::Account::ConfProperties::CodecInfo::AUTO_QUALITY_ENABLED];
if ((not rtcpCheckerThread_.isRunning()) && (isAutoQualityEnabledStr.compare(TRUE_STR) == 0))
rtcpCheckerThread_.start(); rtcpCheckerThread_.start();
else if ((rtcpCheckerThread_.isRunning()) && (isAutoQualityEnabledStr.compare(FALSE_STR) == 0))
rtcpCheckerThread_.join();
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment