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
d68f7065
Commit
d68f7065
authored
Apr 19, 2017
by
Ronan Abhamon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(src/components/call/CallModel): coding style
parent
25b73f06
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
45 additions
and
35 deletions
+45
-35
CallModel.cpp
linphone-desktop/src/components/call/CallModel.cpp
+44
-34
CallModel.hpp
linphone-desktop/src/components/call/CallModel.hpp
+1
-1
No files found.
linphone-desktop/src/components/call/CallModel.cpp
View file @
d68f7065
...
...
@@ -415,13 +415,32 @@ QVariantList CallModel::getVideoStats () const {
return
mVideoStats
;
}
static
QVariantMap
createStat
(
const
QString
&
key
,
const
QString
&
value
)
{
inline
QVariantMap
createStat
(
const
QString
&
key
,
const
QString
&
value
)
{
QVariantMap
m
;
m
[
"key"
]
=
key
;
m
[
"value"
]
=
value
;
return
m
;
}
inline
QString
iceStateToString
(
linphone
::
IceState
state
)
const
{
switch
(
state
)
{
case
linphone
:
:
IceStateNotActivated
:
return
tr
(
"iceStateNotActivated"
);
case
linphone
:
:
IceStateFailed
:
return
tr
(
"iceStateFailed"
);
case
linphone
:
:
IceStateInProgress
:
return
tr
(
"iceStateInProgress"
);
case
linphone
:
:
IceStateReflexiveConnection
:
return
tr
(
"iceStateReflexiveConnection"
);
case
linphone
:
:
IceStateHostConnection
:
return
tr
(
"iceStateHostConnection"
);
case
linphone
:
:
IceStateRelayConnection
:
return
tr
(
"iceStateRelayConnection"
);
default:
return
tr
(
"iceStateInvalid"
);
}
}
void
CallModel
::
updateStats
(
const
linphone
::
CallStats
&
callStats
,
QVariantList
&
stats
)
{
QString
family
;
shared_ptr
<
const
linphone
::
CallParams
>
params
=
mLinphoneCall
->
getCurrentParams
();
...
...
@@ -451,50 +470,41 @@ void CallModel::updateStats (const linphone::CallStats &callStats, QVariantList
}
stats
.
clear
();
stats
<<
createStat
(
tr
(
"callStatsCodec"
),
QString
(
"%1 / %2kHz"
).
arg
(
Utils
::
linphoneStringToQString
(
payloadType
->
getMimeType
())).
arg
(
payloadType
->
getClockRate
()
/
1000
));
stats
<<
createStat
(
tr
(
"callStatsCodec"
),
QString
(
"%1 / %2kHz"
)
.
arg
(
Utils
::
linphoneStringToQString
(
payloadType
->
getMimeType
())).
arg
(
payloadType
->
getClockRate
()
/
1000
));
stats
<<
createStat
(
tr
(
"callStatsUploadBandwidth"
),
QString
(
"%1 kbits/s"
).
arg
(
int
(
callStats
.
getUploadBandwidth
())));
stats
<<
createStat
(
tr
(
"callStatsDownloadBandwidth"
),
QString
(
"%1 kbits/s"
).
arg
(
int
(
callStats
.
getDownloadBandwidth
())));
stats
<<
createStat
(
tr
(
"callStatsIceState"
),
iceStateToString
(
callStats
.
getIceState
()));
stats
<<
createStat
(
tr
(
"callStatsIpFamily"
),
family
);
stats
<<
createStat
(
tr
(
"callStatsSenderLossRate"
),
QString
(
"%1 %"
).
arg
(
callStats
.
getSenderLossRate
()));
stats
<<
createStat
(
tr
(
"callStatsReceiverLossRate"
),
QString
(
"%1 %"
).
arg
(
callStats
.
getReceiverLossRate
()));
switch
(
callStats
.
getType
())
{
case
linphone
:
:
StreamTypeAudio
:
stats
<<
createStat
(
tr
(
"callStatsJitterBuffer"
),
QString
(
"%1 ms"
).
arg
(
callStats
.
getJitterBufferSizeMs
()));
break
;
case
linphone
:
:
StreamTypeVideo
:
{
QString
sentVideoDefinitionName
=
Utils
::
linphoneStringToQString
(
params
->
getSentVideoDefinition
()
->
getName
());
QString
sentVideoDefinition
=
QString
(
"%1x%2"
).
arg
(
params
->
getSentVideoDefinition
()
->
getWidth
()).
arg
(
params
->
getSentVideoDefinition
()
->
getHeight
());
stats
<<
createStat
(
tr
(
"callStatsSentVideoDefinition"
),
(
sentVideoDefinition
==
sentVideoDefinitionName
)
?
sentVideoDefinition
:
QString
(
"%1 (%2)"
).
arg
(
sentVideoDefinition
).
arg
(
sentVideoDefinitionName
));
QString
receivedVideoDefinitionName
=
Utils
::
linphoneStringToQString
(
params
->
getReceivedVideoDefinition
()
->
getName
());
QString
receivedVideoDefinition
=
QString
(
"%1x%2"
).
arg
(
params
->
getReceivedVideoDefinition
()
->
getWidth
()).
arg
(
params
->
getReceivedVideoDefinition
()
->
getHeight
());
stats
<<
createStat
(
tr
(
"callStatsReceivedVideoDefinition"
),
(
receivedVideoDefinition
==
receivedVideoDefinitionName
)
?
receivedVideoDefinition
:
QString
(
"%1 (%2)"
).
arg
(
receivedVideoDefinition
).
arg
(
receivedVideoDefinitionName
));
}
break
;
case
linphone
:
:
StreamTypeVideo
:
{
QString
sentVideoDefinitionName
=
Utils
::
linphoneStringToQString
(
params
->
getSentVideoDefinition
()
->
getName
());
QString
sentVideoDefinition
=
QString
(
"%1x%2"
)
.
arg
(
params
->
getSentVideoDefinition
()
->
getWidth
())
.
arg
(
params
->
getSentVideoDefinition
()
->
getHeight
());
stats
<<
createStat
(
tr
(
"callStatsSentVideoDefinition"
),
sentVideoDefinition
==
sentVideoDefinitionName
?
sentVideoDefinition
:
QString
(
"%1 (%2)"
).
arg
(
sentVideoDefinition
).
arg
(
sentVideoDefinitionName
));
QString
receivedVideoDefinitionName
=
Utils
::
linphoneStringToQString
(
params
->
getReceivedVideoDefinition
()
->
getName
());
QString
receivedVideoDefinition
=
QString
(
"%1x%2"
)
.
arg
(
params
->
getReceivedVideoDefinition
()
->
getWidth
())
.
arg
(
params
->
getReceivedVideoDefinition
()
->
getHeight
());
stats
<<
createStat
(
tr
(
"callStatsReceivedVideoDefinition"
),
receivedVideoDefinition
==
receivedVideoDefinitionName
?
receivedVideoDefinition
:
QString
(
"%1 (%2)"
).
arg
(
receivedVideoDefinition
).
arg
(
receivedVideoDefinitionName
));
}
break
;
default:
break
;
}
}
QString
CallModel
::
iceStateToString
(
linphone
::
IceState
state
)
const
{
switch
(
state
)
{
case
linphone
:
:
IceStateNotActivated
:
return
tr
(
"iceStateNotActivated"
);
case
linphone
:
:
IceStateFailed
:
return
tr
(
"iceStateFailed"
);
case
linphone
:
:
IceStateInProgress
:
return
tr
(
"iceStateInProgress"
);
case
linphone
:
:
IceStateReflexiveConnection
:
return
tr
(
"iceStateReflexiveConnection"
);
case
linphone
:
:
IceStateHostConnection
:
return
tr
(
"iceStateHostConnection"
);
case
linphone
:
:
IceStateRelayConnection
:
return
tr
(
"iceStateRelayConnection"
);
default:
return
tr
(
"iceStateInvalid"
);
}
}
linphone-desktop/src/components/call/CallModel.hpp
View file @
d68f7065
...
...
@@ -127,11 +127,11 @@ private:
QVariantList
getAudioStats
()
const
;
QVariantList
getVideoStats
()
const
;
void
updateStats
(
const
linphone
::
CallStats
&
callStats
,
QVariantList
&
stats
);
QString
iceStateToString
(
linphone
::
IceState
state
)
const
;
bool
mPausedByRemote
=
false
;
bool
mPausedByUser
=
false
;
bool
mRecording
=
false
;
QVariantList
mAudioStats
;
QVariantList
mVideoStats
;
...
...
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