diff --git a/linphone-desktop/src/components/camera/Camera.cpp b/linphone-desktop/src/components/camera/Camera.cpp index 5d8cd2bea..f558cd461 100644 --- a/linphone-desktop/src/components/camera/Camera.cpp +++ b/linphone-desktop/src/components/camera/Camera.cpp @@ -136,6 +136,11 @@ Camera::Camera (QQuickItem *parent) : QQuickFramebufferObject(parent) { } Camera::~Camera () { + if (m_is_preview) + CoreManager::getInstance()->getCore()->setNativePreviewWindowId(nullptr); + else + m_call->getLinphoneCall()->setNativeVideoWindowId(nullptr); + delete m_context_info; } diff --git a/linphone-desktop/ui/views/App/Calls/Incall.qml b/linphone-desktop/ui/views/App/Calls/Incall.qml index e12159caf..e5b713ece 100644 --- a/linphone-desktop/ui/views/App/Calls/Incall.qml +++ b/linphone-desktop/ui/views/App/Calls/Incall.qml @@ -312,19 +312,28 @@ Rectangle { } } + // ----------------------------------------------------------------------- + // Preview. + // ----------------------------------------------------------------------- + Loader { anchors.centerIn: parent height: CallStyle.actionArea.userVideo.height width: CallStyle.actionArea.userVideo.width - visible: incall.width >= CallStyle.actionArea.lowWidth && call.videoEnabled && !_fullscreen + Component { + id: preview - Camera { - anchors.fill: parent - isPreview: true - - Component.onCompleted: call = incall.call + Camera { + anchors.fill: parent + call: incall.call + isPreview: true + } } + + sourceComponent: incall.width >= CallStyle.actionArea.lowWidth && call.videoEnabled && !_fullscreen + ? preview + : null } ActionBar {