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
afba34e0
Commit
afba34e0
authored
Mar 22, 2017
by
Ronan Abhamon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(src/components/camera/Camera): remove useless code
parent
e6399831
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
28 deletions
+9
-28
Camera.cpp
linphone-desktop/src/components/camera/Camera.cpp
+9
-27
Camera.hpp
linphone-desktop/src/components/camera/Camera.hpp
+0
-1
No files found.
linphone-desktop/src/components/camera/Camera.cpp
View file @
afba34e0
...
...
@@ -31,29 +31,9 @@
#include <QThread>
#include <QTimer>
// =============================================================================
struct
CameraStateBinder
{
CameraStateBinder
()
{
QOpenGLFunctions
*
f
=
QOpenGLContext
::
currentContext
()
->
functions
();
f
->
glEnable
(
GL_DEPTH_TEST
);
f
->
glEnable
(
GL_CULL_FACE
);
f
->
glDepthMask
(
GL_TRUE
);
f
->
glDepthFunc
(
GL_LESS
);
f
->
glFrontFace
(
GL_CCW
);
f
->
glCullFace
(
GL_BACK
);
}
~
CameraStateBinder
()
{
QOpenGLFunctions
*
f
=
QOpenGLContext
::
currentContext
()
->
functions
();
#define MAX_FPS 30
f
->
glDisable
(
GL_CULL_FACE
);
f
->
glDisable
(
GL_DEPTH_TEST
);
}
};
// -----------------------------------------------------------------------------
// =============================================================================
struct
ContextInfo
{
GLuint
width
;
...
...
@@ -74,7 +54,6 @@ CameraRenderer::~CameraRenderer () {
QOpenGLFramebufferObject
*
CameraRenderer
::
createFramebufferObject
(
const
QSize
&
size
)
{
QOpenGLFramebufferObjectFormat
format
;
format
.
setAttachment
(
QOpenGLFramebufferObject
::
CombinedDepthStencil
);
format
.
setInternalTextureFormat
(
GL_RGBA8
);
format
.
setSamples
(
4
);
...
...
@@ -94,8 +73,6 @@ QOpenGLFramebufferObject *CameraRenderer::createFramebufferObject (const QSize &
}
void
CameraRenderer
::
render
()
{
CameraStateBinder
state
;
if
(
!
m_linphone_call
)
return
;
...
...
@@ -161,9 +138,14 @@ Camera::Camera (QQuickItem *parent) : QQuickFramebufferObject(parent) {
setMirrorVertically
(
true
);
m_refresh_timer
=
new
QTimer
(
this
);
m_refresh_timer
->
setInterval
(
1
/
30
*
1000
);
m_refresh_timer
->
setInterval
(
1
/
MAX_FPS
*
1000
);
QObject
::
connect
(
m_refresh_timer
,
&
QTimer
::
timeout
,
this
,
&
QQuickFramebufferObject
::
update
,
Qt
::
DirectConnection
);
QObject
::
connect
(
m_refresh_timer
,
&
QTimer
::
timeout
,
this
,
&
QQuickFramebufferObject
::
update
);
m_refresh_timer
->
start
();
}
...
...
linphone-desktop/src/components/camera/Camera.hpp
View file @
afba34e0
...
...
@@ -35,7 +35,6 @@ struct ContextInfo;
class
CameraRenderer
:
public
QQuickFramebufferObject
::
Renderer
{
friend
class
Camera
;
friend
struct
CameraStateBinder
;
public:
CameraRenderer
();
...
...
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