diff --git a/.gitlab-ci-files/job-macosx-desktop.yml b/.gitlab-ci-files/job-macosx-desktop.yml index 4af82f9f2..2ee18b2b0 100644 --- a/.gitlab-ci-files/job-macosx-desktop.yml +++ b/.gitlab-ci-files/job-macosx-desktop.yml @@ -96,7 +96,7 @@ job-macosx-makefile-package: - $PACKAGE_MACOSX - $DEPLOY_MACOSX variables: - CMAKE_OPTIONS: -DENABLE_APP_PACKAGING=YES -DENABLE_G729=ON -DLINPHONE_SDK_MAKE_RELEASE_FILE_URL=$MAKE_RELEASE_FILE_URL/$MACOS_PLATFORM/$APP_FOLDER + CMAKE_OPTIONS: -DENABLE_APP_PACKAGING=YES -DENABLE_G729=ON -DLINPHONE_SDK_MAKE_RELEASE_FILE_URL=$MAKE_RELEASE_FILE_URL/$MACOSX_PLATFORM/$APP_FOLDER extends: job-macosx-makefile script: - *build_all_script diff --git a/linphone-app/src/components/camera/Camera.cpp b/linphone-app/src/components/camera/Camera.cpp index 6345e7bf4..8835171b6 100644 --- a/linphone-app/src/components/camera/Camera.cpp +++ b/linphone-app/src/components/camera/Camera.cpp @@ -62,6 +62,8 @@ Camera::Camera (QQuickItem *parent) : QQuickFramebufferObject(parent) { Camera::~Camera(){ if(mIsPreview) deactivatePreview(); +// else + // resetWindowId(); } void Camera::resetWindowId() { @@ -69,9 +71,10 @@ void Camera::resetWindowId() { CoreManager::getInstance()->getCore()->setNativePreviewWindowId(NULL); else if( mCallModel && mCallModel->getCall()) mCallModel->getCall()->setNativeVideoWindowId(NULL); - else if(mParticipantDeviceModel) - mParticipantDeviceModel->getDevice()->setNativeVideoWindowId(NULL); - else + else if(mParticipantDeviceModel){ + if(mParticipantDeviceModel->getDevice()) + mParticipantDeviceModel->getDevice()->setNativeVideoWindowId(NULL); + }else CoreManager::getInstance()->getCore()->setNativeVideoWindowId(NULL); } diff --git a/linphone-app/src/components/participant/ParticipantDeviceListModel.cpp b/linphone-app/src/components/participant/ParticipantDeviceListModel.cpp index 031536d26..aad3f46dc 100644 --- a/linphone-app/src/components/participant/ParticipantDeviceListModel.cpp +++ b/linphone-app/src/components/participant/ParticipantDeviceListModel.cpp @@ -128,7 +128,7 @@ bool ParticipantDeviceListModel::add(std::shared_ptr(); if(deviceModel->getDevice() == deviceToAdd) { qWarning() << "Device already exist. Send video update event"; - emit deviceModel->videoEnabledChanged(); + deviceModel->updateVideoEnabled(); return false; } } @@ -142,8 +142,10 @@ bool ParticipantDeviceListModel::add(std::shared_ptr deviceToRemove){ int row = 0; - for(auto device : mList){ - if( device.objectCast()->getDevice() == deviceToRemove){ + for(auto item : mList){ + auto device = item.objectCast(); + if( device->getDevice() == deviceToRemove){ + device->setIsLeft(true); removeRow(row); return true; }else @@ -292,6 +294,7 @@ void ParticipantDeviceListModel::onParticipantDeviceMediaCapabilityChanged(const device->updateVideoEnabled(); else onParticipantDeviceAdded(participantDevice); + device = get(participantDevice); if( device && device->isMe()){ // Capability change for me. Update all videos. for(auto item : mList) { diff --git a/linphone-app/src/components/participant/ParticipantDeviceModel.cpp b/linphone-app/src/components/participant/ParticipantDeviceModel.cpp index 3ed3e4f77..333a6ece4 100644 --- a/linphone-app/src/components/participant/ParticipantDeviceModel.cpp +++ b/linphone-app/src/components/participant/ParticipantDeviceModel.cpp @@ -146,11 +146,11 @@ void ParticipantDeviceModel::setIsSpeaking(bool speaking){ } void ParticipantDeviceModel::updateVideoEnabled(){ - bool enabled = mParticipantDevice && mParticipantDevice->getStreamAvailability(linphone::StreamType::Video) && + bool enabled = !mIsLeft && (mParticipantDevice && mParticipantDevice->getStreamAvailability(linphone::StreamType::Video) && ( mParticipantDevice->getStreamCapability(linphone::StreamType::Video) == linphone::MediaDirection::SendRecv || mParticipantDevice->getStreamCapability(linphone::StreamType::Video) == linphone::MediaDirection::SendOnly ) - || isMe(); + || isMe()); if( mIsVideoEnabled != enabled && mCall && mCall->getCall()->getState() == linphone::Call::State::StreamsRunning) { qWarning() << "VideoEnabled: " << enabled << ", old=" << mIsVideoEnabled << (mParticipantDevice ? mParticipantDevice->getAddress()->asString().c_str() : "") << ", me=" << isMe() << ", CallState=" << (mCall ? (int)mCall->getCall()->getState() : -1); mIsVideoEnabled = enabled; @@ -158,6 +158,11 @@ void ParticipantDeviceModel::updateVideoEnabled(){ } } +void ParticipantDeviceModel::setIsLeft(bool left) { + mIsLeft = left; + updateVideoEnabled(); +} + bool ParticipantDeviceModel::isMe() const{ return mIsMe; } diff --git a/linphone-app/src/components/participant/ParticipantDeviceModel.hpp b/linphone-app/src/components/participant/ParticipantDeviceModel.hpp index 3f7b558fa..e5b5f47e9 100644 --- a/linphone-app/src/components/participant/ParticipantDeviceModel.hpp +++ b/linphone-app/src/components/participant/ParticipantDeviceModel.hpp @@ -81,6 +81,7 @@ public: void connectTo(ParticipantDeviceListener * listener); void updateVideoEnabled(); + void setIsLeft(bool left); public slots: void onSecurityLevelChanged(std::shared_ptr device); @@ -98,6 +99,7 @@ private: bool mIsVideoEnabled; bool mIsPaused = false; bool mIsSpeaking = false; + bool mIsLeft = false; std::shared_ptr mParticipantDevice; std::shared_ptr mParticipantDeviceListener; // This is passed to linpĥone object and must be in shared_ptr diff --git a/linphone-app/ui/modules/Common/Popup/Popup.qml b/linphone-app/ui/modules/Common/Popup/Popup.qml index 0425c18a1..443932600 100644 --- a/linphone-app/ui/modules/Common/Popup/Popup.qml +++ b/linphone-app/ui/modules/Common/Popup/Popup.qml @@ -8,7 +8,7 @@ import Utils 1.0 Item { id: wrapper - + // Optionnal parameters, set the position of popup relative to this item. property var relativeTo property int relativeX: 0 @@ -70,8 +70,8 @@ Item { Controls.Popup { id: popup - height: wrapper._content.height - width: wrapper._content.width + height: wrapper.height + width: wrapper.width background: Rectangle { color: PopupStyle.backgroundColor diff --git a/linphone-app/ui/modules/Linphone/Calls/CallStatistics.qml b/linphone-app/ui/modules/Linphone/Calls/CallStatistics.qml index 11e41796e..b60738420 100644 --- a/linphone-app/ui/modules/Linphone/Calls/CallStatistics.qml +++ b/linphone-app/ui/modules/Linphone/Calls/CallStatistics.qml @@ -11,14 +11,12 @@ Popup { id: callStatistics property var call - // --------------------------------------------------------------------------- Rectangle { color: CallStatisticsStyle.color - height: CallStatisticsStyle.height + height: callStatistics.height width: callStatistics.width - Row { anchors { fill: parent diff --git a/linphone-app/ui/modules/Linphone/Camera/CameraItem.qml b/linphone-app/ui/modules/Linphone/Camera/CameraItem.qml index 9ced48d3a..1ba5e6f24 100644 --- a/linphone-app/ui/modules/Linphone/Camera/CameraItem.qml +++ b/linphone-app/ui/modules/Linphone/Camera/CameraItem.qml @@ -22,7 +22,7 @@ Item { property bool hideCamera: false //callModel.pausedByUser property bool isPaused: false - property bool isVideoEnabled: !container.currentDevice || (container.currentDevice && container.currentDevice.videoEnabled) + property bool isVideoEnabled: enabled && (!container.currentDevice || (container.currentDevice && container.currentDevice.videoEnabled)) function resetActive(){ resetTimer.resetActive() @@ -49,7 +49,7 @@ Item { anchors.fill: parent - active: !resetActive && container.isVideoEnabled //avatarCell.currentDevice && (avatarCell.currentDevice.videoEnabled && !conference._fullscreen) + active: container.enabled && !resetActive && container.isVideoEnabled //avatarCell.currentDevice && (avatarCell.currentDevice.videoEnabled && !conference._fullscreen) sourceComponent: container.isVideoEnabled && !container.isPaused? camera : null Timer{ @@ -75,8 +75,8 @@ Item { isPreview: container.isPreview onRequestNewRenderer: {resetTimer.resetActive()} - Component.onDestruction: {resetWindowId()} - Component.onCompleted: console.log("Completed Camera") + Component.onDestruction: {resetWindowId(); console.log("Destroyed Camera [" + isPreview + "] : " + camera)} + Component.onCompleted: console.log("Completed Camera [" + isPreview + "] : " + camera) } } diff --git a/linphone-app/ui/modules/Linphone/Camera/CameraView.qml b/linphone-app/ui/modules/Linphone/Camera/CameraView.qml index 46274fdd2..92966382c 100644 --- a/linphone-app/ui/modules/Linphone/Camera/CameraView.qml +++ b/linphone-app/ui/modules/Linphone/Camera/CameraView.qml @@ -13,6 +13,7 @@ Item{ property alias currentDevice: camera.currentDevice property alias hideCamera: camera.hideCamera property alias isPaused: camera.isPaused + property alias isPreview: camera.isPreview property bool showCloseButton: true property color color : CameraViewStyle.backgroundColor signal closeRequested() diff --git a/linphone-app/ui/views/App/Calls/Incall.qml b/linphone-app/ui/views/App/Calls/Incall.qml index d3f1707be..e1c6cf78d 100644 --- a/linphone-app/ui/views/App/Calls/Incall.qml +++ b/linphone-app/ui/views/App/Calls/Incall.qml @@ -108,6 +108,7 @@ Rectangle { call: incall.call width: container.width + height: container.height relativeTo: callQuality relativeY: CallStyle.header.stats.relativeY diff --git a/linphone-app/ui/views/App/Calls/VideoConference.qml b/linphone-app/ui/views/App/Calls/VideoConference.qml index c28af99f1..cac836fac 100644 --- a/linphone-app/ui/views/App/Calls/VideoConference.qml +++ b/linphone-app/ui/views/App/Calls/VideoConference.qml @@ -26,7 +26,7 @@ Rectangle { property ConferenceModel conferenceModel: callModel && callModel.getConferenceModel() property var _fullscreen: null property bool listCallsOpened: true - + signal openListCallsRequest() // --------------------------------------------------------------------------- @@ -224,15 +224,23 @@ Rectangle { delegate: Item{ id: avatarCell property ParticipantDeviceModel currentDevice: gridModel.participantDevices.getAt(index) - onCurrentDeviceChanged: console.log("currentDevice changed: " +currentDevice + (currentDevice?", me:"+currentDevice.isMe:'')+" ["+index+"]") + onCurrentDeviceChanged: { + console.log("currentDevice changed: " +currentDevice+"/"+cameraView.currentDevice + (currentDevice?", me:"+currentDevice.isMe:'')+" ["+index+"]") + if(index < 0) cameraView.enabled = false // this is a delegate destruction. We need to stop camera before Qt change its currentDevice (and then, let CameraView to delete wrong renderer) + + } //color: 'black' /*!conference.callModel && gridModel.defaultList.get(index).color ? gridModel.defaultList.get(index).color : */ //color: gridModel.model.get(index) && gridModel.model.get(index).color ? gridModel.model.get(index).color : '' // modelIndex is a custom index because by Mosaic modelisation, it is not accessible. //color: $modelData.color ? $modelData.color : '' height: grid.cellHeight - 10 width: grid.cellWidth - 10 - Component.onCompleted: console.log("Completed: ["+index+"] " +(currentDevice?currentDevice.peerAddress+", isMe:"+currentDevice.isMe : '') ) + Component.onCompleted: { + console.log("Completed: ["+index+"] " +(currentDevice?currentDevice.peerAddress+", isMe:"+currentDevice.isMe : '') ) + } CameraView{ + id: cameraView + enabled: index >=0 anchors.fill: parent currentDevice: avatarCell.currentDevice isPaused: callModel.pausedByUser || avatarCell.currentDevice && avatarCell.currentDevice.isPaused //callModel.pausedByUser @@ -375,7 +383,7 @@ Rectangle { colorSet: VideoConferenceStyle.buttons.callQuality percentageDisplayed: 0 - onClicked: {console.log("opening stats");Logic.openCallStatistics();console.log("Stats should be opened")} + onClicked: {Logic.openCallStatistics();} Timer { interval: 500 repeat: true @@ -390,17 +398,6 @@ Rectangle { callQuality.percentageDisplayed = 0 } } - - CallStatistics { - id: callStatistics - - call: callModel - width: conference.width - relativeTo: keypadButton - relativeY: CallStyle.header.stats.relativeY - onClosed: Logic.handleCallStatisticsClosed() - onOpened: console.log("Stats Opened: " +call+", " +width +", "+relativeY) - } } ActionButton{ isCustom: true @@ -413,7 +410,17 @@ Rectangle { // --------------------------------------------------------------------------- // TelKeypad. // --------------------------------------------------------------------------- - + CallStatistics { + id: callStatistics + + call: conference.callModel + width: conference.width - 20 + height: conference.height * 2/3 + relativeTo: conference + relativeY: CallStyle.header.stats.relativeY + relativeX: 10 + onClosed: Logic.handleCallStatisticsClosed() + } TelKeypad { id: telKeypad diff --git a/linphone-app/ui/views/App/Calls/WaitingRoom.qml b/linphone-app/ui/views/App/Calls/WaitingRoom.qml index 2f6de0b40..b20951f57 100644 --- a/linphone-app/ui/views/App/Calls/WaitingRoom.qml +++ b/linphone-app/ui/views/App/Calls/WaitingRoom.qml @@ -17,6 +17,12 @@ Rectangle { signal cancel() + function close(){ + loader.active = false + } + function open(){ + } + ColumnLayout { anchors.fill: parent Text{ @@ -28,9 +34,12 @@ Rectangle { font.pointSize: WaitingRoomStyle.title.pointSize horizontalAlignment: Qt.AlignCenter } - Item{ + Loader{ + id: loader Layout.fillWidth: true Layout.fillHeight: true + sourceComponent: Component{ + CameraView{ id: previewLoader showCloseButton: false @@ -39,6 +48,7 @@ Rectangle { width : height } } + } // ------------------------------------------------------------------------- // Action Buttons. // ------------------------------------------------------------------------- @@ -105,12 +115,15 @@ Rectangle { TextButtonA { text: 'CANCEL' - onClicked: mainItem.cancel() + onClicked: { + mainItem.close() + mainItem.cancel() + } } TextButtonB { text: 'DEMARRER' - onClicked: CallsListModel.launchVideoCall(conferenceInfoModel.uri, '', 0, {video: camera.cameraEnabled, micro:!micro.microMuted, audio:!speaker.speakerMuted}) + onClicked: {mainItem.close(); CallsListModel.launchVideoCall(conferenceInfoModel.uri, '', 0, {video: camera.cameraEnabled, micro:!micro.microMuted, audio:!speaker.speakerMuted}) } } } diff --git a/linphone-sdk b/linphone-sdk index 809b278c0..b4d326a67 160000 --- a/linphone-sdk +++ b/linphone-sdk @@ -1 +1 @@ -Subproject commit 809b278c08b43c821205d4f4ef4c86b2de49d393 +Subproject commit b4d326a67d890048f6e869027350ea6ffb8cf8cb