Skip to content
Snippets Groups Projects
Commit b4c7661a authored by Sébastien Blin's avatar Sébastien Blin
Browse files

calls: follow API changes (add accountId for calls and conferences)

Change-Id: I54f0c6c144bcf6774883f58ec3bc4fac4bc4ef49
parent a126eb69
Branches
Tags
No related merge requests found
......@@ -88,11 +88,12 @@ AvAdapter::shareEntireScreen(int screenNumber)
return;
QRect rect = screen->geometry();
auto resource = lrcInstance_->avModel().getDisplay(getScreenNumber(),
rect.x(),
rect.y(),
rect.width() * screen->devicePixelRatio(),
rect.height() * screen->devicePixelRatio());
auto resource = lrcInstance_->getCurrentCallModel()
->getDisplay(getScreenNumber(),
rect.x(),
rect.y(),
rect.width() * screen->devicePixelRatio(),
rect.height() * screen->devicePixelRatio());
auto callId = lrcInstance_->getCurrentCallId();
lrcInstance_->getCurrentCallModel()
->requestMediaChange(callId,
......@@ -100,7 +101,8 @@ AvAdapter::shareEntireScreen(int screenNumber)
resource,
lrc::api::NewCallModel::MediaRequestType::SCREENSHARING,
false);
set_currentRenderingDeviceType(lrcInstance_->avModel().getCurrentRenderedDevice(callId).type);
set_currentRenderingDeviceType(
lrcInstance_->getCurrentCallModel()->getCurrentRenderedDevice(callId).type);
}
void
......@@ -108,11 +110,11 @@ AvAdapter::shareAllScreens()
{
const auto arrangementRect = getAllScreensBoundingRect();
auto resource = lrcInstance_->avModel().getDisplay(getScreenNumber(),
arrangementRect.x(),
arrangementRect.y(),
arrangementRect.width(),
arrangementRect.height());
auto resource = lrcInstance_->getCurrentCallModel()->getDisplay(getScreenNumber(),
arrangementRect.x(),
arrangementRect.y(),
arrangementRect.width(),
arrangementRect.height());
auto callId = lrcInstance_->getCurrentCallId();
lrcInstance_->getCurrentCallModel()
->requestMediaChange(callId,
......@@ -120,7 +122,8 @@ AvAdapter::shareAllScreens()
resource,
lrc::api::NewCallModel::MediaRequestType::SCREENSHARING,
false);
set_currentRenderingDeviceType(lrcInstance_->avModel().getCurrentRenderedDevice(callId).type);
set_currentRenderingDeviceType(
lrcInstance_->getCurrentCallModel()->getCurrentRenderedDevice(callId).type);
}
void
......@@ -189,7 +192,7 @@ AvAdapter::shareFile(const QString& filePath)
lrc::api::NewCallModel::MediaRequestType::FILESHARING,
false);
set_currentRenderingDeviceType(
lrcInstance_->avModel().getCurrentRenderedDevice(callId).type);
lrcInstance_->getCurrentCallModel()->getCurrentRenderedDevice(callId).type);
}
}
......@@ -203,11 +206,11 @@ AvAdapter::shareScreenArea(unsigned x, unsigned y, unsigned width, unsigned heig
QTimer::singleShot(100, [=]() mutable {
x = y = width = height = 0;
xrectsel(&x, &y, &width, &height);
auto resource = lrcInstance_->avModel().getDisplay(getScreenNumber(),
x,
y,
width < 128 ? 128 : width,
height < 128 ? 128 : height);
auto resource = lrcInstance_->getCurrentCallModel()->getDisplay(getScreenNumber(),
x,
y,
width < 128 ? 128 : width,
height < 128 ? 128 : height);
auto callId = lrcInstance_->getCurrentCallId();
lrcInstance_->getCurrentCallModel()
->requestMediaChange(callId,
......@@ -216,14 +219,14 @@ AvAdapter::shareScreenArea(unsigned x, unsigned y, unsigned width, unsigned heig
lrc::api::NewCallModel::MediaRequestType::SCREENSHARING,
false);
set_currentRenderingDeviceType(
lrcInstance_->avModel().getCurrentRenderedDevice(callId).type);
lrcInstance_->getCurrentCallModel()->getCurrentRenderedDevice(callId).type);
});
#else
auto resource = lrcInstance_->avModel().getDisplay(getScreenNumber(),
x,
y,
width < 128 ? 128 : width,
height < 128 ? 128 : height);
auto resource = lrcInstance_->getCurrentCallModel()->getDisplay(getScreenNumber(),
x,
y,
width < 128 ? 128 : width,
height < 128 ? 128 : height);
auto callId = lrcInstance_->getCurrentCallId();
lrcInstance_->getCurrentCallModel()
->requestMediaChange(callId,
......@@ -231,7 +234,8 @@ AvAdapter::shareScreenArea(unsigned x, unsigned y, unsigned width, unsigned heig
resource,
lrc::api::NewCallModel::MediaRequestType::SCREENSHARING,
false);
set_currentRenderingDeviceType(lrcInstance_->avModel().getCurrentRenderedDevice(callId).type);
set_currentRenderingDeviceType(
lrcInstance_->getCurrentCallModel()->getCurrentRenderedDevice(callId).type);
#endif
}
......
......@@ -682,7 +682,8 @@ CallAdapter::saveConferenceSubcalls()
const auto& currentConvId = lrcInstance_->get_selectedConvUid();
const auto& convInfo = lrcInstance_->getConversationFromConvUid(currentConvId);
if (!convInfo.confId.isEmpty()) {
currentConfSubcalls_ = lrcInstance_->getConferenceSubcalls(convInfo.confId);
auto* callModel = lrcInstance_->getAccountInfo(accountId_).callModel.get();
currentConfSubcalls_ = callModel->getConferenceSubcalls(convInfo.confId);
}
}
......
......@@ -69,12 +69,6 @@ LRCInstance::LRCInstance(migrateCallback willMigrateCb,
}
};
VectorString
LRCInstance::getConferenceSubcalls(const QString& callId)
{
return lrc_->getConferenceSubcalls(callId);
}
RenderManager*
LRCInstance::renderer()
{
......
......@@ -122,7 +122,6 @@ public:
void monitor(bool continous);
bool hasActiveCall(bool withVideo = false);
VectorString getConferenceSubcalls(const QString& callId);
QString get_selectedConvUid();
......
......@@ -273,7 +273,7 @@ VideoDevices::setDefaultDevice(int index, bool useSourceModel)
lrcInstance_->avModel().setDefaultDevice(deviceId);
if (!callId.isEmpty())
lrcInstance_->avModel().switchInputTo(deviceId, callId);
lrcInstance_->getCurrentCallModel()->switchInputTo(deviceId, callId);
updateData();
}
......@@ -435,6 +435,7 @@ void
VideoDevices::onVideoDeviceEvent()
{
auto& avModel = lrcInstance_->avModel();
auto* callModel = lrcInstance_->getCurrentCallModel();
auto defaultDevice = avModel.getDefaultDevice();
QString callId = lrcInstance_->getCurrentCallId();
......@@ -455,11 +456,12 @@ VideoDevices::onVideoDeviceEvent()
auto cb = [this, currentDeviceListSize, deviceEvent, defaultDevice, callId] {
auto& avModel = lrcInstance_->avModel();
auto* callModel = lrcInstance_->getCurrentCallModel();
if (currentDeviceListSize == 0) {
avModel.switchInputTo({}, callId);
callModel->switchInputTo({}, callId);
avModel.stopPreview(this->getDefaultDevice());
} else if (deviceEvent == DeviceEvent::Removed) {
avModel.switchInputTo(defaultDevice, callId);
callModel->switchInputTo(defaultDevice, callId);
}
updateData();
......@@ -475,7 +477,7 @@ VideoDevices::onVideoDeviceEvent()
if (callId.isEmpty()) {
Q_EMIT deviceAvailable();
} else {
avModel.switchInputTo(defaultDevice, callId);
callModel->switchInputTo(defaultDevice, callId);
}
Q_EMIT deviceListChanged(currentDeviceListSize);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment