linphone-desktop/linphone-app/ui/modules/Linphone/Camera/CameraItem.qml
Julien Wadel 6325f6885c - Update to new API on participant joined/left.
- Move active speaker managment to list instead of proxy (to be next to the new API state changes).
- Update participants on conference created event to avoid losing me and other devices (SDK callbakcs are not usable before create event).
- Fix selected active speaker when being in conference without participants.
- Fix active speaker on new/left participants.
- Protect mosaic transitions from deletion.
- Username selection from IncallAvatar.
- Deletion protection on camera when changing layouts by introducing a minor delay.
- Shutdown preview when going out from waiting room.
- Update design of waiting room.
- Change flipping transition to opacity.
- Update SDK (fix the camera reset of Active speaker when new participant)
- Fix blanks lines in chat menu.
2022-07-08 22:36:47 +02:00

81 lines
2.5 KiB
QML

import QtQuick 2.7
import QtQuick.Layouts 1.3
import QtGraphicalEffects 1.12
import App.Styles 1.0
import Common 1.0
import Common.Styles 1.0
import Linphone 1.0
import Linphone.Styles 1.0
import UtilsCpp 1.0
import 'qrc:/ui/scripts/Utils/utils.js' as Utils
// =============================================================================
Item {
id: container
property bool isCameraFromDevice: true
property ParticipantDeviceModel currentDevice
property CallModel callModel
property bool isPreview: (!callModel && !container.currentDevice) || ( container.currentDevice && container.currentDevice.isMe)
property bool isFullscreen: false
property bool hideCamera: false
property bool isPaused: false
property bool deactivateCamera: true
property bool isVideoEnabled: deactivateCamera && (!callModel || callModel.videoEnabled)
&& (!container.currentDevice || callModel && (container.currentDevice
&& (container.currentDevice.videoEnabled || (container.currentDevice.isMe && callModel.cameraEnabled))))
property bool a : callModel && callModel.videoEnabled
property bool b: container.currentDevice && container.currentDevice.videoEnabled
property bool c: container.currentDevice && container.currentDevice.isMe
property bool d : callModel && callModel.cameraEnabled
property bool isReady: cameraLoader.item && cameraLoader.item.isReady
signal videoDefinitionChanged()
onCurrentDeviceChanged: {if(container.isCameraFromDevice) resetActive()}
Component.onDestruction: isVideoEnabled=false
function resetActive(){
resetTimer.resetActive()
}
Loader {
id: cameraLoader
property bool resetActive: false
anchors.fill: parent
active: !resetActive && container.isVideoEnabled
sourceComponent: container.isVideoEnabled && !container.isPaused? camera : null
Timer{
id: resetTimer
interval: 100
repeat: false
onTriggered: if(!cameraLoader.active){
cameraLoader.resetActive = false
}else{
start() // Let some more time to propagate active event
}
function resetActive(){
start()// Do it first to avoid deleting caller while processing
cameraLoader.resetActive = true
}
}
Component {
id: camera
Camera {
participantDeviceModel: container.currentDevice
call: container.isCameraFromDevice ? null : container.callModel
anchors.fill: parent
isPreview: container.isPreview
onRequestNewRenderer: {resetTimer.resetActive()}
onVideoDefinitionChanged: container.videoDefinitionChanged()
}
}
}
}