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
e6399831
Commit
e6399831
authored
Mar 21, 2017
by
Ronan Abhamon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(src/components/camera/Camera): limit cpu usage
parent
cb55e676
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
1 deletion
+11
-1
Camera.cpp
linphone-desktop/src/components/camera/Camera.cpp
+10
-1
Camera.hpp
linphone-desktop/src/components/camera/Camera.hpp
+1
-0
No files found.
linphone-desktop/src/components/camera/Camera.cpp
View file @
e6399831
...
...
@@ -83,6 +83,7 @@ QOpenGLFramebufferObject *CameraRenderer::createFramebufferObject (const QSize &
m_context_info
->
width
=
size
.
width
();
m_context_info
->
height
=
size
.
height
();
m_context_info
->
functions
=
MSFunctions
::
getInstance
()
->
getFunctions
();
m_update_context_info
=
true
;
// It's not the same thread as render.
core
->
lockVideoRender
();
...
...
@@ -136,6 +137,14 @@ void CameraRenderer::synchronize (QQuickFramebufferObject *item) {
}
void
CameraRenderer
::
updateWindowId
()
{
if
(
!
m_update_context_info
)
return
;
m_update_context_info
=
false
;
qInfo
()
<<
"Thread"
<<
QThread
::
currentThread
()
<<
QStringLiteral
(
"Set context info (width: %1, height: %2, is_preview: %3)."
)
.
arg
(
m_context_info
->
width
).
arg
(
m_context_info
->
height
).
arg
(
m_is_preview
);
if
(
m_is_preview
)
CoreManager
::
getInstance
()
->
getCore
()
->
setNativePreviewWindowId
(
m_context_info
);
else
if
(
m_linphone_call
)
...
...
@@ -152,7 +161,7 @@ Camera::Camera (QQuickItem *parent) : QQuickFramebufferObject(parent) {
setMirrorVertically
(
true
);
m_refresh_timer
=
new
QTimer
(
this
);
m_refresh_timer
->
setInterval
(
1
/
6
0
*
1000
);
m_refresh_timer
->
setInterval
(
1
/
3
0
*
1000
);
QObject
::
connect
(
m_refresh_timer
,
&
QTimer
::
timeout
,
this
,
&
QQuickFramebufferObject
::
update
);
m_refresh_timer
->
start
();
...
...
linphone-desktop/src/components/camera/Camera.hpp
View file @
e6399831
...
...
@@ -50,6 +50,7 @@ private:
void
updateWindowId
();
ContextInfo
*
m_context_info
;
bool
m_update_context_info
=
false
;
bool
m_is_preview
=
false
;
shared_ptr
<
linphone
::
Call
>
m_linphone_call
;
...
...
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