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
02b7f39c
Commit
02b7f39c
authored
Feb 01, 2017
by
Ronan Abhamon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(src/components/camera/Camera): supports preview
parent
b580d24d
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
31 additions
and
21 deletions
+31
-21
Camera.cpp
linphone-desktop/src/components/camera/Camera.cpp
+18
-11
Camera.hpp
linphone-desktop/src/components/camera/Camera.hpp
+3
-4
CoreManager.cpp
linphone-desktop/src/components/core/CoreManager.cpp
+1
-0
Incall.qml
linphone-desktop/ui/views/App/Calls/Incall.qml
+8
-5
linphone
submodules/linphone
+1
-1
No files found.
linphone-desktop/src/components/camera/Camera.cpp
View file @
02b7f39c
...
...
@@ -2,7 +2,10 @@
#include <QOpenGLFunctions>
#include <QOpenGLTexture>
#include <QtMath>
#include "../core/CoreManager.hpp"
#include "Camera.hpp"
// =============================================================================
...
...
@@ -52,8 +55,12 @@ QOpenGLFramebufferObject *CameraRenderer::createFramebufferObject (const QSize &
shared_ptr
<
linphone
::
Call
>
linphone_call
=
m_camera
->
m_call
->
getLinphoneCall
();
linphone
::
CallState
state
=
linphone_call
->
getState
();
if
(
state
==
linphone
::
CallStateConnected
||
state
==
linphone
::
CallStateStreamsRunning
)
linphone_call
->
setNativeVideoWindowId
(
context_info
);
if
(
state
==
linphone
::
CallStateConnected
||
state
==
linphone
::
CallStateStreamsRunning
)
{
if
(
m_camera
->
m_is_preview
)
CoreManager
::
getInstance
()
->
getCore
()
->
setNativePreviewWindowId
(
context_info
);
else
linphone_call
->
setNativeVideoWindowId
(
context_info
);
}
return
new
QOpenGLFramebufferObject
(
size
,
format
);
}
...
...
@@ -63,10 +70,10 @@ void CameraRenderer::render () {
QOpenGLFunctions
*
f
=
QOpenGLContext
::
currentContext
()
->
functions
();
f
->
glClearColor
(
0.
f
,
0.
f
,
0.
f
,
1
.
f
);
f
->
glClearColor
(
0.
f
,
0.
f
,
0.
f
,
0
.
f
);
f
->
glClear
(
GL_COLOR_BUFFER_BIT
|
GL_DEPTH_BUFFER_BIT
);
m_camera
->
getCall
()
->
getLinphoneCall
()
->
oglRender
();
m_camera
->
getCall
()
->
getLinphoneCall
()
->
oglRender
(
m_camera
->
m_is_preview
);
update
();
}
...
...
@@ -91,14 +98,10 @@ QQuickFramebufferObject::Renderer *Camera::createRenderer () const {
return
new
CameraRenderer
(
this
);
}
void
Camera
::
hoverMoveEvent
(
QHoverEvent
*
)
{}
void
Camera
::
mousePressEvent
(
QMouseEvent
*
)
{
setFocus
(
true
);
}
void
Camera
::
keyPressEvent
(
QKeyEvent
*
)
{}
// -----------------------------------------------------------------------------
CallModel
*
Camera
::
getCall
()
const
{
...
...
@@ -111,8 +114,12 @@ void Camera::setCall (CallModel *call) {
shared_ptr
<
linphone
::
Call
>
linphone_call
=
call
->
getLinphoneCall
();
linphone
::
CallState
state
=
linphone_call
->
getState
();
if
(
state
==
linphone
::
CallStateConnected
||
state
==
linphone
::
CallStateStreamsRunning
)
linphone_call
->
setNativeVideoWindowId
(
m_context_info
);
if
(
state
==
linphone
::
CallStateConnected
||
state
==
linphone
::
CallStateStreamsRunning
)
{
if
(
m_is_preview
)
CoreManager
::
getInstance
()
->
getCore
()
->
setNativePreviewWindowId
(
m_context_info
);
else
linphone_call
->
setNativeVideoWindowId
(
m_context_info
);
}
}
m_call
=
call
;
...
...
linphone-desktop/src/components/camera/Camera.hpp
View file @
02b7f39c
...
...
@@ -32,6 +32,7 @@ class Camera : public QQuickFramebufferObject {
Q_OBJECT
;
Q_PROPERTY
(
CallModel
*
call
READ
getCall
WRITE
setCall
NOTIFY
callChanged
);
Q_PROPERTY
(
bool
isPreview
MEMBER
m_is_preview
NOTIFY
isPreviewChanged
);
public:
Camera
(
QQuickItem
*
parent
=
Q_NULLPTR
);
...
...
@@ -41,19 +42,17 @@ public:
signals:
void
callChanged
(
CallModel
*
call
);
void
isPreviewChanged
(
bool
is_preview
);
protected:
void
hoverMoveEvent
(
QHoverEvent
*
event
)
override
;
void
mousePressEvent
(
QMouseEvent
*
event
)
override
;
void
keyPressEvent
(
QKeyEvent
*
event
)
override
;
private:
CallModel
*
getCall
()
const
;
void
setCall
(
CallModel
*
call
);
bool
m_is_preview
=
false
;
CallModel
*
m_call
=
nullptr
;
ContextInfo
*
m_context_info
;
};
...
...
linphone-desktop/src/components/core/CoreManager.cpp
View file @
02b7f39c
...
...
@@ -14,6 +14,7 @@ CoreManager::CoreManager (QObject *parent) : QObject(parent), m_handlers(make_sh
m_core
=
linphone
::
Factory
::
get
()
->
createCore
(
m_handlers
,
Paths
::
getConfigFilepath
(),
""
);
m_core
->
setVideoDisplayFilter
(
"MSOGL"
);
m_core
->
usePreviewWindow
(
true
);
setDatabasesPaths
();
}
...
...
linphone-desktop/ui/views/App/Calls/Incall.qml
View file @
02b7f39c
...
...
@@ -17,6 +17,7 @@ Rectangle {
// ---------------------------------------------------------------------------
property
var
_contactObserver
:
SipAddressesModel
.
getContactObserver
(
sipAddress
)
property
var
_call
:
call
// ---------------------------------------------------------------------------
...
...
@@ -128,8 +129,6 @@ Rectangle {
Item
{
id
:
container
property
var
_call
:
call
Layout.fillWidth
:
true
Layout.fillHeight
:
true
Layout.margins
:
CallStyle
.
container
.
margins
...
...
@@ -182,7 +181,7 @@ Rectangle {
Camera
{
height
:
container
.
height
width
:
container
.
width
call
:
container
.
_call
call
:
incall
.
_call
}
}
...
...
@@ -239,11 +238,15 @@ Rectangle {
}
}
Item
{
Camera
{
anchors.centerIn
:
parent
height
:
CallStyle
.
actionArea
.
userVideo
.
height
visible
:
Boolean
(
incall
.
width
>=
CallStyle
.
actionArea
.
lowWidth
&&
call
.
videoOutputEnabled
)
width
:
CallStyle
.
actionArea
.
userVideo
.
width
isPreview
:
true
call
:
incall
.
_call
visible
:
Boolean
(
incall
.
width
>=
CallStyle
.
actionArea
.
lowWidth
&&
call
.
videoOutputEnabled
)
}
ActionBar
{
...
...
linphone
@
aa4d6d03
Subproject commit
d398c2c61904dd2c128c830dfaa0936be35a039b
Subproject commit
aa4d6d035d292463f7d523f8fa947142c035ef71
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