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
2402bb2f
Commit
2402bb2f
authored
Feb 02, 2017
by
Ronan Abhamon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(ui/views/App/Calls/Incall): supports set/unset video in call
parent
38b629fa
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
126 additions
and
46 deletions
+126
-46
en.ts
linphone-desktop/assets/languages/en.ts
+8
-0
fr.ts
linphone-desktop/assets/languages/fr.ts
+8
-0
CallModel.cpp
linphone-desktop/src/components/call/CallModel.cpp
+48
-11
CallModel.hpp
linphone-desktop/src/components/call/CallModel.hpp
+7
-7
AbstractStartingCall.qml
linphone-desktop/ui/views/App/Calls/AbstractStartingCall.qml
+2
-0
CallsWindow.qml
linphone-desktop/ui/views/App/Calls/CallsWindow.qml
+19
-6
Incall.qml
linphone-desktop/ui/views/App/Calls/Incall.qml
+32
-13
OutgoingCall.qml
linphone-desktop/ui/views/App/Calls/OutgoingCall.qml
+2
-9
No files found.
linphone-desktop/assets/languages/en.ts
View file @
2402bb2f
...
@@ -363,6 +363,14 @@ Server url not configured.</translation>
...
@@ -363,6 +363,14 @@ Server url not configured.</translation>
<
source
>
saveScreenshotTitle
<
/source
>
<
source
>
saveScreenshotTitle
<
/source
>
<
translation
type
=
"
unfinished
"
><
/translation
>
<
translation
type
=
"
unfinished
"
><
/translation
>
<
/message
>
<
/message
>
<
message
>
<
source
>
acceptVideoDescription
<
/source
>
<
translation
type
=
"
unfinished
"
><
/translation
>
<
/message
>
<
message
>
<
source
>
acceptVideoTitle
<
/source
>
<
translation
type
=
"
unfinished
"
><
/translation
>
<
/message
>
<
/context
>
<
/context
>
<
context
>
<
context
>
<
name
>
MainWindow
<
/name
>
<
name
>
MainWindow
<
/name
>
...
...
linphone-desktop/assets/languages/fr.ts
View file @
2402bb2f
...
@@ -351,6 +351,14 @@ Url du serveur non configurée.</translation>
...
@@ -351,6 +351,14 @@ Url du serveur non configurée.</translation>
<
source
>
saveScreenshotTitle
<
/source
>
<
source
>
saveScreenshotTitle
<
/source
>
<
translation
type
=
"
unfinished
"
><
/translation
>
<
translation
type
=
"
unfinished
"
><
/translation
>
<
/message
>
<
/message
>
<
message
>
<
source
>
acceptVideoDescription
<
/source
>
<
translation
type
=
"
unfinished
"
><
/translation
>
<
/message
>
<
message
>
<
source
>
acceptVideoTitle
<
/source
>
<
translation
type
=
"
unfinished
"
><
/translation
>
<
/message
>
<
/context
>
<
/context
>
<
context
>
<
context
>
<
name
>
IncomingCall
<
/name
>
<
name
>
IncomingCall
<
/name
>
...
...
linphone-desktop/src/components/call/CallModel.cpp
View file @
2402bb2f
...
@@ -36,6 +36,20 @@ CallModel::CallModel (shared_ptr<linphone::Call> linphone_call) {
...
@@ -36,6 +36,20 @@ CallModel::CallModel (shared_ptr<linphone::Call> linphone_call) {
m_paused_by_user
=
false
;
m_paused_by_user
=
false
;
break
;
break
;
case
linphone
:
:
CallStateUpdatedByRemote
:
{
shared_ptr
<
linphone
::
Core
>
core
=
CoreManager
::
getInstance
()
->
getCore
();
if
(
!
m_linphone_call
->
getCurrentParams
()
->
videoEnabled
()
&&
m_linphone_call
->
getRemoteParams
()
->
videoEnabled
()
)
{
CoreManager
::
getInstance
()
->
getCore
()
->
deferCallUpdate
(
m_linphone_call
);
emit
videoRequested
();
}
}
break
;
default:
default:
break
;
break
;
}
}
...
@@ -63,6 +77,16 @@ void CallModel::transfer () {
...
@@ -63,6 +77,16 @@ void CallModel::transfer () {
// TODO
// TODO
}
}
void
CallModel
::
acceptVideoRequest
()
{
shared_ptr
<
linphone
::
CallParams
>
params
=
m_linphone_call
->
getCurrentParams
()
->
copy
();
params
->
enableVideo
(
true
);
CoreManager
::
getInstance
()
->
getCore
()
->
acceptCallUpdate
(
m_linphone_call
,
params
);
}
void
CallModel
::
rejectVideoRequest
()
{
CoreManager
::
getInstance
()
->
getCore
()
->
acceptCallUpdate
(
m_linphone_call
,
m_linphone_call
->
getCurrentParams
());
}
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
QString
CallModel
::
getSipAddress
()
const
{
QString
CallModel
::
getSipAddress
()
const
{
...
@@ -135,6 +159,15 @@ bool CallModel::getPausedByUser () const {
...
@@ -135,6 +159,15 @@ bool CallModel::getPausedByUser () const {
}
}
void
CallModel
::
setPausedByUser
(
bool
status
)
{
void
CallModel
::
setPausedByUser
(
bool
status
)
{
switch
(
m_linphone_call
->
getState
())
{
case
linphone
:
:
CallStateConnected
:
case
linphone
:
:
CallStateStreamsRunning
:
case
linphone
:
:
CallStatePaused
:
case
linphone
:
:
CallStatePausedByRemote
:
break
;
default:
return
;
}
if
(
status
)
{
if
(
status
)
{
if
(
!
m_paused_by_user
)
if
(
!
m_paused_by_user
)
CoreManager
::
getInstance
()
->
getCore
()
->
pauseCall
(
m_linphone_call
);
CoreManager
::
getInstance
()
->
getCore
()
->
pauseCall
(
m_linphone_call
);
...
@@ -146,20 +179,24 @@ void CallModel::setPausedByUser (bool status) {
...
@@ -146,20 +179,24 @@ void CallModel::setPausedByUser (bool status) {
CoreManager
::
getInstance
()
->
getCore
()
->
resumeCall
(
m_linphone_call
);
CoreManager
::
getInstance
()
->
getCore
()
->
resumeCall
(
m_linphone_call
);
}
}
bool
CallModel
::
getVideo
Input
Enabled
()
const
{
bool
CallModel
::
getVideoEnabled
()
const
{
shared_ptr
<
linphone
::
CallParams
>
params
=
m_linphone_call
->
get
Remote
Params
();
shared_ptr
<
linphone
::
CallParams
>
params
=
m_linphone_call
->
get
Current
Params
();
return
params
&&
params
->
videoEnabled
()
&&
getStatus
()
==
CallStatusConnected
;
return
params
&&
params
->
videoEnabled
()
&&
getStatus
()
==
CallStatusConnected
;
}
}
void
CallModel
::
setVideoInputEnabled
(
bool
status
)
{
void
CallModel
::
setVideoEnabled
(
bool
status
)
{
// TODO
switch
(
m_linphone_call
->
getState
())
{
}
case
linphone
:
:
CallStateConnected
:
case
linphone
:
:
CallStateStreamsRunning
:
break
;
default:
return
;
}
bool
CallModel
::
getVideoOutputEnabled
()
const
{
if
(
status
==
getVideoEnabled
())
shared_ptr
<
linphone
::
CallParams
>
params
=
m_linphone_call
->
getCurrentParams
();
return
;
return
params
&&
params
->
videoEnabled
()
&&
getStatus
()
==
CallStatusConnected
;
}
void
CallModel
::
setVideoOutputEnabled
(
bool
status
)
{
shared_ptr
<
linphone
::
CallParams
>
params
=
CoreManager
::
getInstance
()
->
getCore
()
->
createCallParams
(
m_linphone_call
);
// TODO
params
->
enableVideo
(
status
);
CoreManager
::
getInstance
()
->
getCore
()
->
updateCall
(
m_linphone_call
,
params
);
}
}
linphone-desktop/src/components/call/CallModel.hpp
View file @
2402bb2f
...
@@ -16,8 +16,7 @@ class CallModel : public QObject {
...
@@ -16,8 +16,7 @@ class CallModel : public QObject {
Q_PROPERTY
(
float
quality
READ
getQuality
CONSTANT
);
// Same idea.
Q_PROPERTY
(
float
quality
READ
getQuality
CONSTANT
);
// Same idea.
Q_PROPERTY
(
bool
microMuted
READ
getMicroMuted
WRITE
setMicroMuted
NOTIFY
microMutedChanged
);
Q_PROPERTY
(
bool
microMuted
READ
getMicroMuted
WRITE
setMicroMuted
NOTIFY
microMutedChanged
);
Q_PROPERTY
(
bool
pausedByUser
READ
getPausedByUser
WRITE
setPausedByUser
NOTIFY
statusChanged
);
Q_PROPERTY
(
bool
pausedByUser
READ
getPausedByUser
WRITE
setPausedByUser
NOTIFY
statusChanged
);
Q_PROPERTY
(
bool
videoInputEnabled
READ
getVideoInputEnabled
WRITE
setVideoInputEnabled
NOTIFY
statusChanged
);
Q_PROPERTY
(
bool
videoEnabled
READ
getVideoEnabled
WRITE
setVideoEnabled
NOTIFY
statusChanged
);
Q_PROPERTY
(
bool
videoOutputEnabled
READ
getVideoOutputEnabled
WRITE
setVideoOutputEnabled
NOTIFY
statusChanged
);
public:
public:
enum
CallStatus
{
enum
CallStatus
{
...
@@ -43,9 +42,13 @@ public:
...
@@ -43,9 +42,13 @@ public:
Q_INVOKABLE
void
terminate
();
Q_INVOKABLE
void
terminate
();
Q_INVOKABLE
void
transfer
();
Q_INVOKABLE
void
transfer
();
Q_INVOKABLE
void
acceptVideoRequest
();
Q_INVOKABLE
void
rejectVideoRequest
();
signals:
signals:
void
statusChanged
(
CallStatus
status
);
void
statusChanged
(
CallStatus
status
);
void
microMutedChanged
(
bool
status
);
void
microMutedChanged
(
bool
status
);
void
videoRequested
();
private:
private:
QString
getSipAddress
()
const
;
QString
getSipAddress
()
const
;
...
@@ -64,11 +67,8 @@ private:
...
@@ -64,11 +67,8 @@ private:
bool
getPausedByUser
()
const
;
bool
getPausedByUser
()
const
;
void
setPausedByUser
(
bool
status
);
void
setPausedByUser
(
bool
status
);
bool
getVideoInputEnabled
()
const
;
bool
getVideoEnabled
()
const
;
void
setVideoInputEnabled
(
bool
status
);
void
setVideoEnabled
(
bool
status
);
bool
getVideoOutputEnabled
()
const
;
void
setVideoOutputEnabled
(
bool
status
);
bool
m_micro_muted
=
false
;
bool
m_micro_muted
=
false
;
bool
m_paused_by_remote
=
false
;
bool
m_paused_by_remote
=
false
;
...
...
linphone-desktop/ui/views/App/Calls/AbstractStartingCall.qml
View file @
2402bb2f
...
@@ -10,6 +10,8 @@ import App.Styles 1.0
...
@@ -10,6 +10,8 @@ import App.Styles 1.0
// =============================================================================
// =============================================================================
Rectangle
{
Rectangle
{
property
var
call
default
property
alias
_actionArea
:
actionArea
.
data
default
property
alias
_actionArea
:
actionArea
.
data
property
var
_contactObserver
:
SipAddressesModel
.
getContactObserver
(
sipAddress
)
property
var
_contactObserver
:
SipAddressesModel
.
getContactObserver
(
sipAddress
)
...
...
linphone-desktop/ui/views/App/Calls/CallsWindow.qml
View file @
2402bb2f
...
@@ -15,11 +15,10 @@ Window {
...
@@ -15,11 +15,10 @@ Window {
// ---------------------------------------------------------------------------
// ---------------------------------------------------------------------------
property
var
call
:
calls
.
selectedCall
readonly
property
bool
chatIsOpened
:
!
rightPaned
.
isClosed
()
readonly
property
bool
chatIsOpened
:
!
rightPaned
.
isClosed
()
// `{}` is a workaround to avoid `TypeError: Cannot read property...` in `Incall` component.
property
string
sipAddress
:
call
?
call
.
sipAddress
:
''
property
var
call
:
calls
.
selectedCall
||
{}
property
string
sipAddress
:
call
.
sipAddress
||
''
// ---------------------------------------------------------------------------
// ---------------------------------------------------------------------------
...
@@ -122,19 +121,28 @@ Window {
...
@@ -122,19 +121,28 @@ Window {
Component
{
Component
{
id
:
incomingCall
id
:
incomingCall
IncomingCall
{}
IncomingCall
{
call
:
window
.
call
}
}
}
Component
{
Component
{
id
:
outgoingCall
id
:
outgoingCall
OutgoingCall
{}
OutgoingCall
{
call
:
window
.
call
}
}
}
Component
{
Component
{
id
:
incall
id
:
incall
Incall
{}
Incall
{
// `{}` is a workaround to avoid `TypeError: Cannot read property...` in `Incall` component.
call
:
window
.
call
||
({
videoEnabled
:
false
})
}
}
}
Component
{
Component
{
...
@@ -151,7 +159,12 @@ Window {
...
@@ -151,7 +159,12 @@ Window {
childA
:
Loader
{
childA
:
Loader
{
anchors.fill
:
parent
anchors.fill
:
parent
sourceComponent
:
{
sourceComponent
:
{
if
(
!
window
.
call
)
{
return
null
}
var
status
=
window
.
call
.
status
var
status
=
window
.
call
.
status
if
(
status
==
null
)
{
if
(
status
==
null
)
{
return
null
return
null
...
...
linphone-desktop/ui/views/App/Calls/Incall.qml
View file @
2402bb2f
...
@@ -17,13 +17,36 @@ Rectangle {
...
@@ -17,13 +17,36 @@ Rectangle {
// ---------------------------------------------------------------------------
// ---------------------------------------------------------------------------
property
var
call
property
var
_contactObserver
:
SipAddressesModel
.
getContactObserver
(
sipAddress
)
property
var
_contactObserver
:
SipAddressesModel
.
getContactObserver
(
sipAddress
)
property
var
_call
:
call
// ---------------------------------------------------------------------------
// ---------------------------------------------------------------------------
color
:
CallStyle
.
backgroundColor
color
:
CallStyle
.
backgroundColor
// ---------------------------------------------------------------------------
// Handle video requests.
// ---------------------------------------------------------------------------
SmartConnect
{
Component.onCompleted
:
this
.
connect
(
call
,
'
videoRequested
'
,
function
()
{
Utils
.
openConfirmDialog
(
window
,
{
descriptionText
:
qsTr
(
'
acceptVideoDescription
'
),
exitHandler
:
function
(
status
)
{
if
(
status
)
{
call
.
acceptVideoRequest
()
}
else
{
call
.
rejectVideoRequest
()
}
},
title
:
qsTr
(
'
acceptVideoTitle
'
)
})
})
}
// ---------------------------------------------------------------------------
ColumnLayout
{
ColumnLayout
{
anchors
{
anchors
{
fill
:
parent
fill
:
parent
...
@@ -85,7 +108,7 @@ Rectangle {
...
@@ -85,7 +108,7 @@ Rectangle {
id
:
cameraActions
id
:
cameraActions
anchors.right
:
parent
.
right
anchors.right
:
parent
.
right
active
:
Boolean
(
call
.
videoInputEnabled
)
&&
call
.
status
!==
CallModel
.
CallStatusEnded
active
:
call
.
videoEnabled
&&
call
.
status
!==
CallModel
.
CallStatusEnded
sourceComponent
:
ActionBar
{
sourceComponent
:
ActionBar
{
iconSize
:
CallStyle
.
header
.
iconSize
iconSize
:
CallStyle
.
header
.
iconSize
...
@@ -200,7 +223,7 @@ Rectangle {
...
@@ -200,7 +223,7 @@ Rectangle {
Camera
{
Camera
{
height
:
container
.
height
height
:
container
.
height
width
:
container
.
width
width
:
container
.
width
call
:
incall
.
_
call
call
:
incall
.
call
}
}
}
}
...
@@ -208,7 +231,7 @@ Rectangle {
...
@@ -208,7 +231,7 @@ Rectangle {
id
:
cameraLoader
id
:
cameraLoader
anchors.centerIn
:
parent
anchors.centerIn
:
parent
sourceComponent
:
call
.
video
Input
Enabled
?
camera
:
avatar
sourceComponent
:
call
.
videoEnabled
?
camera
:
avatar
}
}
}
}
...
@@ -241,15 +264,11 @@ Rectangle {
...
@@ -241,15 +264,11 @@ Rectangle {
}
}
ActionSwitch
{
ActionSwitch
{
icon
:
'
speaker
'
enabled
:
call
.
videoEnabled
iconSize
:
CallStyle
.
actionArea
.
iconSize
onClicked
:
enabled
=
!
enabled
}
ActionSwitch
{
icon
:
'
camera
'
icon
:
'
camera
'
iconSize
:
CallStyle
.
actionArea
.
iconSize
iconSize
:
CallStyle
.
actionArea
.
iconSize
onClicked
:
enabled
=
!
enabled
onClicked
:
call
.
videoEnabled
=
!
enabled
}
}
ActionButton
{
ActionButton
{
...
@@ -266,9 +285,9 @@ Rectangle {
...
@@ -266,9 +285,9 @@ Rectangle {
width
:
CallStyle
.
actionArea
.
userVideo
.
width
width
:
CallStyle
.
actionArea
.
userVideo
.
width
isPreview
:
true
isPreview
:
true
visible
:
incall
.
width
>=
CallStyle
.
actionArea
.
lowWidth
&&
call
.
videoEnabled
call
:
incall
.
_call
Component.onCompleted
:
call
=
incall
.
call
visible
:
Boolean
(
incall
.
width
>=
CallStyle
.
actionArea
.
lowWidth
&&
call
.
videoOutputEnabled
)
}
}
ActionBar
{
ActionBar
{
...
...
linphone-desktop/ui/views/App/Calls/OutgoingCall.qml
View file @
2402bb2f
...
@@ -10,7 +10,7 @@ import App.Styles 1.0
...
@@ -10,7 +10,7 @@ import App.Styles 1.0
AbstractStartingCall
{
AbstractStartingCall
{
GridLayout
{
GridLayout
{
columns
:
parent
.
width
<
CallStyle
.
actionArea
.
lowWidth
&&
call
.
video
Output
Enabled
?
1
:
2
columns
:
parent
.
width
<
CallStyle
.
actionArea
.
lowWidth
&&
call
.
videoEnabled
?
1
:
2
rowSpacing
:
ActionBarStyle
.
spacing
rowSpacing
:
ActionBarStyle
.
spacing
anchors
{
anchors
{
...
@@ -26,13 +26,6 @@ AbstractStartingCall {
...
@@ -26,13 +26,6 @@ AbstractStartingCall {
onClicked
:
call
.
microMuted
=
enabled
onClicked
:
call
.
microMuted
=
enabled
}
}
ActionSwitch
{
icon
:
'
speaker
'
iconSize
:
CallStyle
.
actionArea
.
iconSize
onClicked
:
enabled
=
!
enabled
}
}
}
Item
{
Item
{
...
@@ -40,7 +33,7 @@ AbstractStartingCall {
...
@@ -40,7 +33,7 @@ AbstractStartingCall {
height
:
CallStyle
.
actionArea
.
userVideo
.
height
height
:
CallStyle
.
actionArea
.
userVideo
.
height
width
:
CallStyle
.
actionArea
.
userVideo
.
width
width
:
CallStyle
.
actionArea
.
userVideo
.
width
visible
:
call
.
video
Output
Enabled
visible
:
call
.
videoEnabled
}
}
ActionBar
{
ActionBar
{
...
...
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