Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
linphone-desktop
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
linphone-desktop
Commits
2ae919f2
Commit
2ae919f2
authored
Mar 15, 2017
by
Ronan Abhamon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(src/components/camera/Camera): provide a protection to render in other thread
parent
690f4bef
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
39 additions
and
4 deletions
+39
-4
CallModel.cpp
linphone-desktop/src/components/call/CallModel.cpp
+4
-0
Camera.cpp
linphone-desktop/src/components/camera/Camera.cpp
+16
-4
CoreManager.cpp
linphone-desktop/src/components/core/CoreManager.cpp
+2
-0
CoreManager.hpp
linphone-desktop/src/components/core/CoreManager.hpp
+17
-0
No files found.
linphone-desktop/src/components/call/CallModel.cpp
View file @
2ae919f2
...
...
@@ -143,7 +143,11 @@ void CallModel::acceptWithVideo () {
}
void
CallModel
::
terminate
()
{
CoreManager
*
core
=
CoreManager
::
getInstance
();
core
->
lockVideoRender
();
m_linphone_call
->
terminate
();
core
->
unlockVideoRender
();
}
void
CallModel
::
transfer
()
{
...
...
linphone-desktop/src/components/camera/Camera.cpp
View file @
2ae919f2
...
...
@@ -104,11 +104,23 @@ void CameraRenderer::render () {
f
->
glClear
(
GL_COLOR_BUFFER_BIT
|
GL_DEPTH_BUFFER_BIT
);
// Draw with ms filter.
MSFunctions
*
ms_functions
=
MSFunctions
::
getInstance
();
{
QOpenGLFunctions
*
f
=
QOpenGLContext
::
currentContext
()
->
functions
();
f
->
glClearColor
(
0.
f
,
0.
f
,
0.
f
,
0.
f
);
f
->
glClear
(
GL_COLOR_BUFFER_BIT
|
GL_DEPTH_BUFFER_BIT
);
CoreManager
*
core
=
CoreManager
::
getInstance
();
MSFunctions
*
ms_functions
=
MSFunctions
::
getInstance
();
ms_functions
->
bind
(
f
);
m_camera
->
getCall
()
->
getLinphoneCall
()
->
oglRender
(
m_camera
->
m_is_preview
);
ms_functions
->
bind
(
nullptr
);
core
->
lockVideoRender
();
ms_functions
->
bind
(
f
);
m_camera
->
getCall
()
->
getLinphoneCall
()
->
oglRender
(
m_camera
->
m_is_preview
);
ms_functions
->
bind
(
nullptr
);
core
->
unlockVideoRender
();
}
// Synchronize opengl calls with QML.
if
(
m_window
)
...
...
linphone-desktop/src/components/core/CoreManager.cpp
View file @
2ae919f2
...
...
@@ -68,7 +68,9 @@ void CoreManager::init (QObject *parent, const QString &config_path) {
QObject
::
connect
(
timer
,
&
QTimer
::
timeout
,
m_instance
,
[]()
{
m_instance
->
m_mutex_video_render
.
lock
();
m_instance
->
m_core
->
iterate
();
m_instance
->
m_mutex_video_render
.
unlock
();
}
);
}
...
...
linphone-desktop/src/components/core/CoreManager.hpp
View file @
2ae919f2
...
...
@@ -27,8 +27,11 @@
#include "../contacts/ContactsListModel.hpp"
#include "../settings/SettingsModel.hpp"
#include "../sip-addresses/SipAddressesModel.hpp"
#include "CoreHandlers.hpp"
#include <QMutex>
// =============================================================================
class
QTimer
;
...
...
@@ -49,6 +52,18 @@ public:
return
m_handlers
;
}
// ---------------------------------------------------------------------------
// Video render lock.
// ---------------------------------------------------------------------------
void
lockVideoRender
()
{
m_mutex_video_render
.
lock
();
}
void
unlockVideoRender
()
{
m_mutex_video_render
.
unlock
();
}
// ---------------------------------------------------------------------------
// Singleton models.
// ---------------------------------------------------------------------------
...
...
@@ -102,6 +117,8 @@ private:
QTimer
*
m_cbs_timer
;
QMutex
m_mutex_video_render
;
static
CoreManager
*
m_instance
;
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment