Commit f8f80f0a authored by Éloi Bail's avatar Éloi Bail

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
......@@ -227,6 +227,7 @@ constexpr static const char QUALITY [] = "CodecInfo.quality";
constexpr static const char MIN_QUALITY [] = "CodecInfo.min_quality";
constexpr static const char MAX_QUALITY [] = "CodecInfo.max_quality";
constexpr static const char CHANNEL_NUMBER [] = "CodecInfo.channelNumber";
constexpr static const char AUTO_QUALITY_ENABLED [] = "CodecInfo.autoQualityEnabled";
} //namespace DRing::Account::ConfProperties::CodecInfo
......
......@@ -23,6 +23,7 @@
#include "account_const.h"
#include "string_utils.h"
#include "logger.h"
#include <string>
#include <sstream>
......@@ -202,7 +203,8 @@ AccountVideoCodecInfo::getCodecSpecifications()
{DRing::Account::ConfProperties::CodecInfo::QUALITY, to_string(quality)},
{DRing::Account::ConfProperties::CodecInfo::MAX_QUALITY, to_string(systemCodecInfo.maxQuality)},
{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
it = details.find(DRing::Account::ConfProperties::CodecInfo::QUALITY);
if (it != details.end())
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()
......
......@@ -191,6 +191,7 @@ struct AccountVideoCodecInfo : AccountCodecInfo
unsigned frameRate;
unsigned profileId;
std::string parameters;
bool isAutoQualityEnabled{true};
};
bool operator== (SystemCodecInfo codec1, SystemCodecInfo codec2);
......
......@@ -104,8 +104,12 @@ void VideoRtpSession::startSender()
RING_ERR("%s", e.what());
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();
else if ((rtcpCheckerThread_.isRunning()) && (isAutoQualityEnabledStr.compare(FALSE_STR) == 0))
rtcpCheckerThread_.join();
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment