1
0
Fork 0
mirror of https://git.jami.net/savoirfairelinux/jami-client-qt.git synced 2025-08-04 06:45:45 +02:00

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

Change-Id: I54f0c6c144bcf6774883f58ec3bc4fac4bc4ef49
This commit is contained in:
Sébastien Blin 2021-10-26 12:15:17 -04:00
parent a126eb69cb
commit b4c7661a8e
5 changed files with 37 additions and 37 deletions

View file

@ -88,11 +88,12 @@ AvAdapter::shareEntireScreen(int screenNumber)
return; return;
QRect rect = screen->geometry(); QRect rect = screen->geometry();
auto resource = lrcInstance_->avModel().getDisplay(getScreenNumber(), auto resource = lrcInstance_->getCurrentCallModel()
rect.x(), ->getDisplay(getScreenNumber(),
rect.y(), rect.x(),
rect.width() * screen->devicePixelRatio(), rect.y(),
rect.height() * screen->devicePixelRatio()); rect.width() * screen->devicePixelRatio(),
rect.height() * screen->devicePixelRatio());
auto callId = lrcInstance_->getCurrentCallId(); auto callId = lrcInstance_->getCurrentCallId();
lrcInstance_->getCurrentCallModel() lrcInstance_->getCurrentCallModel()
->requestMediaChange(callId, ->requestMediaChange(callId,
@ -100,7 +101,8 @@ AvAdapter::shareEntireScreen(int screenNumber)
resource, resource,
lrc::api::NewCallModel::MediaRequestType::SCREENSHARING, lrc::api::NewCallModel::MediaRequestType::SCREENSHARING,
false); false);
set_currentRenderingDeviceType(lrcInstance_->avModel().getCurrentRenderedDevice(callId).type); set_currentRenderingDeviceType(
lrcInstance_->getCurrentCallModel()->getCurrentRenderedDevice(callId).type);
} }
void void
@ -108,11 +110,11 @@ AvAdapter::shareAllScreens()
{ {
const auto arrangementRect = getAllScreensBoundingRect(); const auto arrangementRect = getAllScreensBoundingRect();
auto resource = lrcInstance_->avModel().getDisplay(getScreenNumber(), auto resource = lrcInstance_->getCurrentCallModel()->getDisplay(getScreenNumber(),
arrangementRect.x(), arrangementRect.x(),
arrangementRect.y(), arrangementRect.y(),
arrangementRect.width(), arrangementRect.width(),
arrangementRect.height()); arrangementRect.height());
auto callId = lrcInstance_->getCurrentCallId(); auto callId = lrcInstance_->getCurrentCallId();
lrcInstance_->getCurrentCallModel() lrcInstance_->getCurrentCallModel()
->requestMediaChange(callId, ->requestMediaChange(callId,
@ -120,7 +122,8 @@ AvAdapter::shareAllScreens()
resource, resource,
lrc::api::NewCallModel::MediaRequestType::SCREENSHARING, lrc::api::NewCallModel::MediaRequestType::SCREENSHARING,
false); false);
set_currentRenderingDeviceType(lrcInstance_->avModel().getCurrentRenderedDevice(callId).type); set_currentRenderingDeviceType(
lrcInstance_->getCurrentCallModel()->getCurrentRenderedDevice(callId).type);
} }
void void
@ -189,7 +192,7 @@ AvAdapter::shareFile(const QString& filePath)
lrc::api::NewCallModel::MediaRequestType::FILESHARING, lrc::api::NewCallModel::MediaRequestType::FILESHARING,
false); false);
set_currentRenderingDeviceType( 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 { QTimer::singleShot(100, [=]() mutable {
x = y = width = height = 0; x = y = width = height = 0;
xrectsel(&x, &y, &width, &height); xrectsel(&x, &y, &width, &height);
auto resource = lrcInstance_->avModel().getDisplay(getScreenNumber(), auto resource = lrcInstance_->getCurrentCallModel()->getDisplay(getScreenNumber(),
x, x,
y, y,
width < 128 ? 128 : width, width < 128 ? 128 : width,
height < 128 ? 128 : height); height < 128 ? 128 : height);
auto callId = lrcInstance_->getCurrentCallId(); auto callId = lrcInstance_->getCurrentCallId();
lrcInstance_->getCurrentCallModel() lrcInstance_->getCurrentCallModel()
->requestMediaChange(callId, ->requestMediaChange(callId,
@ -216,14 +219,14 @@ AvAdapter::shareScreenArea(unsigned x, unsigned y, unsigned width, unsigned heig
lrc::api::NewCallModel::MediaRequestType::SCREENSHARING, lrc::api::NewCallModel::MediaRequestType::SCREENSHARING,
false); false);
set_currentRenderingDeviceType( set_currentRenderingDeviceType(
lrcInstance_->avModel().getCurrentRenderedDevice(callId).type); lrcInstance_->getCurrentCallModel()->getCurrentRenderedDevice(callId).type);
}); });
#else #else
auto resource = lrcInstance_->avModel().getDisplay(getScreenNumber(), auto resource = lrcInstance_->getCurrentCallModel()->getDisplay(getScreenNumber(),
x, x,
y, y,
width < 128 ? 128 : width, width < 128 ? 128 : width,
height < 128 ? 128 : height); height < 128 ? 128 : height);
auto callId = lrcInstance_->getCurrentCallId(); auto callId = lrcInstance_->getCurrentCallId();
lrcInstance_->getCurrentCallModel() lrcInstance_->getCurrentCallModel()
->requestMediaChange(callId, ->requestMediaChange(callId,
@ -231,7 +234,8 @@ AvAdapter::shareScreenArea(unsigned x, unsigned y, unsigned width, unsigned heig
resource, resource,
lrc::api::NewCallModel::MediaRequestType::SCREENSHARING, lrc::api::NewCallModel::MediaRequestType::SCREENSHARING,
false); false);
set_currentRenderingDeviceType(lrcInstance_->avModel().getCurrentRenderedDevice(callId).type); set_currentRenderingDeviceType(
lrcInstance_->getCurrentCallModel()->getCurrentRenderedDevice(callId).type);
#endif #endif
} }

View file

@ -682,7 +682,8 @@ CallAdapter::saveConferenceSubcalls()
const auto& currentConvId = lrcInstance_->get_selectedConvUid(); const auto& currentConvId = lrcInstance_->get_selectedConvUid();
const auto& convInfo = lrcInstance_->getConversationFromConvUid(currentConvId); const auto& convInfo = lrcInstance_->getConversationFromConvUid(currentConvId);
if (!convInfo.confId.isEmpty()) { if (!convInfo.confId.isEmpty()) {
currentConfSubcalls_ = lrcInstance_->getConferenceSubcalls(convInfo.confId); auto* callModel = lrcInstance_->getAccountInfo(accountId_).callModel.get();
currentConfSubcalls_ = callModel->getConferenceSubcalls(convInfo.confId);
} }
} }

View file

@ -69,12 +69,6 @@ LRCInstance::LRCInstance(migrateCallback willMigrateCb,
} }
}; };
VectorString
LRCInstance::getConferenceSubcalls(const QString& callId)
{
return lrc_->getConferenceSubcalls(callId);
}
RenderManager* RenderManager*
LRCInstance::renderer() LRCInstance::renderer()
{ {

View file

@ -122,7 +122,6 @@ public:
void monitor(bool continous); void monitor(bool continous);
bool hasActiveCall(bool withVideo = false); bool hasActiveCall(bool withVideo = false);
VectorString getConferenceSubcalls(const QString& callId);
QString get_selectedConvUid(); QString get_selectedConvUid();

View file

@ -273,7 +273,7 @@ VideoDevices::setDefaultDevice(int index, bool useSourceModel)
lrcInstance_->avModel().setDefaultDevice(deviceId); lrcInstance_->avModel().setDefaultDevice(deviceId);
if (!callId.isEmpty()) if (!callId.isEmpty())
lrcInstance_->avModel().switchInputTo(deviceId, callId); lrcInstance_->getCurrentCallModel()->switchInputTo(deviceId, callId);
updateData(); updateData();
} }
@ -435,6 +435,7 @@ void
VideoDevices::onVideoDeviceEvent() VideoDevices::onVideoDeviceEvent()
{ {
auto& avModel = lrcInstance_->avModel(); auto& avModel = lrcInstance_->avModel();
auto* callModel = lrcInstance_->getCurrentCallModel();
auto defaultDevice = avModel.getDefaultDevice(); auto defaultDevice = avModel.getDefaultDevice();
QString callId = lrcInstance_->getCurrentCallId(); QString callId = lrcInstance_->getCurrentCallId();
@ -455,11 +456,12 @@ VideoDevices::onVideoDeviceEvent()
auto cb = [this, currentDeviceListSize, deviceEvent, defaultDevice, callId] { auto cb = [this, currentDeviceListSize, deviceEvent, defaultDevice, callId] {
auto& avModel = lrcInstance_->avModel(); auto& avModel = lrcInstance_->avModel();
auto* callModel = lrcInstance_->getCurrentCallModel();
if (currentDeviceListSize == 0) { if (currentDeviceListSize == 0) {
avModel.switchInputTo({}, callId); callModel->switchInputTo({}, callId);
avModel.stopPreview(this->getDefaultDevice()); avModel.stopPreview(this->getDefaultDevice());
} else if (deviceEvent == DeviceEvent::Removed) { } else if (deviceEvent == DeviceEvent::Removed) {
avModel.switchInputTo(defaultDevice, callId); callModel->switchInputTo(defaultDevice, callId);
} }
updateData(); updateData();
@ -475,7 +477,7 @@ VideoDevices::onVideoDeviceEvent()
if (callId.isEmpty()) { if (callId.isEmpty()) {
Q_EMIT deviceAvailable(); Q_EMIT deviceAvailable();
} else { } else {
avModel.switchInputTo(defaultDevice, callId); callModel->switchInputTo(defaultDevice, callId);
} }
Q_EMIT deviceListChanged(currentDeviceListSize); Q_EMIT deviceListChanged(currentDeviceListSize);