From cad264ef9a42e3866d3901c4a2b8e2a4434b7b8e Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 16 Mar 2017 13:58:53 +0100 Subject: [PATCH] feat(src/components/camera/Camera): add comments --- linphone-desktop/src/components/camera/Camera.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/linphone-desktop/src/components/camera/Camera.cpp b/linphone-desktop/src/components/camera/Camera.cpp index 4716a6355..6c952cedc 100644 --- a/linphone-desktop/src/components/camera/Camera.cpp +++ b/linphone-desktop/src/components/camera/Camera.cpp @@ -84,14 +84,13 @@ QOpenGLFramebufferObject *CameraRenderer::createFramebufferObject (const QSize & CoreManager *core = CoreManager::getInstance(); - core->lockVideoRender(); - m_context_info->width = size.width(); m_context_info->height = size.height(); m_context_info->functions = MSFunctions::getInstance()->getFunctions(); + // It's not the same thread as render. + core->lockVideoRender(); updateWindowId(); - core->unlockVideoRender(); return new QOpenGLFramebufferObject(size, format); @@ -128,6 +127,8 @@ void CameraRenderer::render () { } void CameraRenderer::synchronize (QQuickFramebufferObject *item) { + // No mutex needed here. It's a synchronized area. + m_window = item->window(); Camera *camera = qobject_cast(item);