Commit 410da09a authored by Andrea Gianarda's avatar Andrea Gianarda
Browse files

Improve backward compatibility handling scenario when a conference server...

Improve backward compatibility handling scenario when a conference server doesn't advertise the thumbnail stream in the NOTIFY
parent 6e1da75a
1 merge request!2945Improve backward compatibility handling scenario when a conference server...
Showing with 19 additions and 16 deletions
...@@ -30,9 +30,9 @@ ...@@ -30,9 +30,9 @@
#include "linphone/utils/utils.h" #include "linphone/utils/utils.h"
#include "conference.h" #include "conference.h"
#include "conference/session/media-session.h"
#include "conference/participant.h" #include "conference/participant.h"
#include "conference/remote-conference.h" #include "conference/remote-conference.h"
#include "conference/session/media-session.h"
#include "content/content-manager.h" #include "content/content-manager.h"
#include "content/content-type.h" #include "content/content-type.h"
#include "content/content.h" #include "content/content.h"
...@@ -355,8 +355,7 @@ void RemoteConferenceEventHandler::conferenceInfoNotifyReceived(const string &xm ...@@ -355,8 +355,7 @@ void RemoteConferenceEventHandler::conferenceInfoNotifyReceived(const string &xm
conf->participants.push_back(participant); conf->participants.push_back(participant);
lInfo() << "Participant " << *participant << " is successfully added - conference " lInfo() << "Participant " << *participant << " is successfully added - conference "
<< conferenceAddressString << " has " << conf->getParticipantCount() << " participants"; << conferenceAddressString << " has " << conf->getParticipantCount() << " participants";
if (!isFullState || if (!isFullState || (!oldParticipants.empty() && (pIt == oldParticipants.cend()) && !isMe)) {
(!oldParticipants.empty() && (pIt == oldParticipants.cend()) && !isMe)) {
conf->notifyParticipantAdded(creationTime, isFullState, participant); conf->notifyParticipantAdded(creationTime, isFullState, participant);
} }
} }
...@@ -527,21 +526,26 @@ void RemoteConferenceEventHandler::conferenceInfoNotifyReceived(const string &xm ...@@ -527,21 +526,26 @@ void RemoteConferenceEventHandler::conferenceInfoNotifyReceived(const string &xm
} }
} }
const auto &mainSession = conf->getMainSession(); const auto &mainSession = conf->getMainSession();
if (mainSession && isMe && !thumbnailTagFound) { if (!thumbnailTagFound) {
lInfo() << "It seems that we are dealing with a legacy conference server that doesn't provide device's thumbnail informations."; lInfo() << "It seems that we are dealing with a legacy conference server that doesn't provide "
const auto &remoteAddress = mainSession->getRemoteAddress(); "device's thumbnail informations.";
if (remoteAddress && remoteAddress->uriEqual(*device->getAddress())) { const auto &remoteAddress = mainSession ? mainSession->getRemoteAddress() : nullptr;
bool thumbnailEnabled = false;
if (isMe && remoteAddress && remoteAddress->uriEqual(*device->getAddress())) {
const auto &ms = dynamic_pointer_cast<MediaSession>(mainSession); const auto &ms = dynamic_pointer_cast<MediaSession>(mainSession);
if (ms) { if (ms) {
const auto &params = ms->getMediaParams(); const auto &params = ms->getMediaParams();
const auto &cameraEnabled = params->cameraEnabled(); thumbnailEnabled = params->cameraEnabled();
if (cameraEnabled) {
device->setThumbnailStreamLabel(device->getLabel(LinphoneStreamTypeVideo));
if (device->setThumbnailStreamCapability(LinphoneMediaDirectionSendOnly)) {
mediaCapabilityChanged.insert(LinphoneStreamTypeVideo);
}
}
} }
} else {
const auto &deviceCapability = device->getStreamCapability(LinphoneStreamTypeVideo);
thumbnailEnabled = ((deviceCapability == LinphoneMediaDirectionSendOnly) ||
(deviceCapability == LinphoneMediaDirectionSendRecv));
}
device->setThumbnailStreamLabel(device->getLabel(LinphoneStreamTypeVideo));
if (device->setThumbnailStreamCapability(thumbnailEnabled ? LinphoneMediaDirectionSendOnly
: LinphoneMediaDirectionInactive)) {
mediaCapabilityChanged.insert(LinphoneStreamTypeVideo);
} }
} }
conf->setCachedScreenSharingDevice(); conf->setCachedScreenSharingDevice();
...@@ -644,8 +648,7 @@ void RemoteConferenceEventHandler::conferenceInfoNotifyReceived(const string &xm ...@@ -644,8 +648,7 @@ void RemoteConferenceEventHandler::conferenceInfoNotifyReceived(const string &xm
if (state == StateType::full) { if (state == StateType::full) {
lInfo() << "Participant device " << *gruu << " has been successfully added"; lInfo() << "Participant device " << *gruu << " has been successfully added";
bool sendNotify = bool sendNotify = (!oldParticipants.empty() && (pIt == oldParticipants.cend())) && !isMe;
(!oldParticipants.empty() && (pIt == oldParticipants.cend())) && !isMe;
if (pIt != oldParticipants.cend()) { if (pIt != oldParticipants.cend()) {
const auto &oldDevices = (*pIt)->getDevices(); const auto &oldDevices = (*pIt)->getDevices();
const auto &dIt = const auto &dIt =
......
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