Skip to content
Snippets Groups Projects
Commit f35992be authored by Pierre Lespagnol's avatar Pierre Lespagnol
Browse files

conference: allow to receive the new confInfo

Gitlab: #468

Change-Id: I2c94823bb8efab6fccddd59de1ae96f290745691
parent b3c4f995
Branches
No related tags found
No related merge requests found
...@@ -643,6 +643,23 @@ Call::setConferenceInfo(const std::string& msg) ...@@ -643,6 +643,23 @@ Call::setConferenceInfo(const std::string& msg)
Json::CharReaderBuilder rbuilder; Json::CharReaderBuilder rbuilder;
auto reader = std::unique_ptr<Json::CharReader>(rbuilder.newCharReader()); auto reader = std::unique_ptr<Json::CharReader>(rbuilder.newCharReader());
if (reader->parse(msg.data(), msg.data() + msg.size(), &json, &err)) { if (reader->parse(msg.data(), msg.data() + msg.size(), &json, &err)) {
if (json.isObject()) {
// new confInfo
if (json.isMember("p")) {
for (const auto& participantInfo : json["p"]) {
ParticipantInfo pInfo;
if (!participantInfo.isMember("uri"))
continue;
pInfo.fromJson(participantInfo);
newInfo.emplace_back(pInfo);
}
}
if (json.isMember("w"))
newInfo.w = json["w"].asInt();
if (json.isMember("h"))
newInfo.h = json["h"].asInt();
} else {
// old confInfo
for (const auto& participantInfo : json) { for (const auto& participantInfo : json) {
ParticipantInfo pInfo; ParticipantInfo pInfo;
if (!participantInfo.isMember("uri")) if (!participantInfo.isMember("uri"))
...@@ -651,6 +668,7 @@ Call::setConferenceInfo(const std::string& msg) ...@@ -651,6 +668,7 @@ Call::setConferenceInfo(const std::string& msg)
newInfo.emplace_back(pInfo); newInfo.emplace_back(pInfo);
} }
} }
}
{ {
std::lock_guard<std::mutex> lk(confInfoMutex_); std::lock_guard<std::mutex> lk(confInfoMutex_);
......
...@@ -111,6 +111,8 @@ struct ParticipantInfo ...@@ -111,6 +111,8 @@ struct ParticipantInfo
struct ConfInfo : public std::vector<ParticipantInfo> struct ConfInfo : public std::vector<ParticipantInfo>
{ {
std::vector<std::map<std::string, std::string>> toVectorMapStringString() const; std::vector<std::map<std::string, std::string>> toVectorMapStringString() const;
int h {0};
int w {0};
}; };
using ParticipantSet = std::set<std::string>; using ParticipantSet = std::set<std::string>;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment