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
c00c0bcd
Commit
c00c0bcd
authored
Apr 19, 2017
by
Ronan Abhamon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(ui/views/App/Settings/SettingsVideo): supports video size
parent
a7534951
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
71 additions
and
22 deletions
+71
-22
SettingsModel.cpp
linphone-desktop/src/components/settings/SettingsModel.cpp
+32
-0
SettingsModel.hpp
linphone-desktop/src/components/settings/SettingsModel.hpp
+13
-0
SettingsVideo.qml
linphone-desktop/ui/views/App/Settings/SettingsVideo.qml
+26
-22
No files found.
linphone-desktop/src/components/settings/SettingsModel.cpp
View file @
c00c0bcd
...
...
@@ -177,6 +177,38 @@ void SettingsModel::setVideoFramerate (int framerate) {
emit
videoFramerateChanged
(
framerate
);
}
// -----------------------------------------------------------------------------
inline
QVariantMap
createMapFromVideoDefinition
(
const
shared_ptr
<
const
linphone
::
VideoDefinition
>
&
definition
)
{
QVariantMap
map
;
map
[
"name"
]
=
::
Utils
::
linphoneStringToQString
(
definition
->
getName
());
map
[
"width"
]
=
definition
->
getWidth
();
map
[
"height"
]
=
definition
->
getHeight
();
map
[
"__definition"
]
=
QVariant
::
fromValue
(
definition
);
return
map
;
}
QVariantList
SettingsModel
::
getSupportedVideoDefinitions
()
const
{
QVariantList
list
;
for
(
const
auto
&
definition
:
linphone
::
Factory
::
get
()
->
getSupportedVideoDefinitions
())
list
<<
createMapFromVideoDefinition
(
definition
);
return
list
;
}
QVariantMap
SettingsModel
::
getVideoDefinition
()
const
{
return
createMapFromVideoDefinition
(
CoreManager
::
getInstance
()
->
getCore
()
->
getPreferredVideoDefinition
());
}
void
SettingsModel
::
setVideoDefinition
(
const
QVariantMap
&
definition
)
{
CoreManager
::
getInstance
()
->
getCore
()
->
setPreferredVideoDefinition
(
definition
.
value
(
"__definition"
).
value
<
shared_ptr
<
const
linphone
::
VideoDefinition
>
>
()
->
clone
()
);
emit
videoDefinitionChanged
(
definition
);
}
// =============================================================================
// Chat & calls.
// =============================================================================
...
...
linphone-desktop/src/components/settings/SettingsModel.hpp
View file @
c00c0bcd
...
...
@@ -56,6 +56,10 @@ class SettingsModel : public QObject {
Q_PROPERTY
(
QString
videoPreset
READ
getVideoPreset
WRITE
setVideoPreset
NOTIFY
videoPresetChanged
);
Q_PROPERTY
(
int
videoFramerate
READ
getVideoFramerate
WRITE
setVideoFramerate
NOTIFY
videoFramerateChanged
);
Q_PROPERTY
(
QVariantList
supportedVideoDefinitions
READ
getSupportedVideoDefinitions
CONSTANT
);
Q_PROPERTY
(
QVariantMap
videoDefinition
READ
getVideoDefinition
WRITE
setVideoDefinition
NOTIFY
videoDefinitionChanged
);
// Chat & calls. -------------------------------------------------------------
Q_PROPERTY
(
bool
autoAnswerStatus
READ
getAutoAnswerStatus
WRITE
setAutoAnswerStatus
NOTIFY
autoAnswerStatusChanged
);
...
...
@@ -164,6 +168,11 @@ public:
int
getVideoFramerate
()
const
;
void
setVideoFramerate
(
int
framerate
);
QVariantList
getSupportedVideoDefinitions
()
const
;
QVariantMap
getVideoDefinition
()
const
;
void
setVideoDefinition
(
const
QVariantMap
&
definition
);
// Chat & calls. -------------------------------------------------------------
bool
getAutoAnswerStatus
()
const
;
...
...
@@ -271,6 +280,8 @@ signals:
void
videoPresetChanged
(
const
QString
&
preset
);
void
videoFramerateChanged
(
int
framerate
);
void
videoDefinitionChanged
(
const
QVariantMap
&
definition
);
// Chat & calls. -------------------------------------------------------------
void
autoAnswerStatusChanged
(
bool
status
);
...
...
@@ -318,4 +329,6 @@ private:
std
::
shared_ptr
<
linphone
::
Config
>
mConfig
;
};
Q_DECLARE_METATYPE
(
std
::
shared_ptr
<
const
linphone
::
VideoDefinition
>
);
#endif // SETTINGS_MODEL_H_
linphone-desktop/ui/views/App/Settings/SettingsVideo.qml
View file @
c00c0bcd
...
...
@@ -44,33 +44,25 @@ TabContainer {
currentIndex
:
{
var
preset
=
SettingsModel
.
videoPreset
return
Number
(
Utils
.
findIndex
(
[
'
default
'
,
'
high-fps
'
,
'
custom
'
]
,
function
(
value
)
{
return
preset
===
value
return
Number
(
Utils
.
findIndex
(
model
,
function
(
value
)
{
return
preset
===
value
.
value
}))
}
model
:
ListModel
{
id
:
presets
ListElement
{
key
:
qsTr
(
'
presetDefault
'
)
value
:
'
default
'
}
ListElement
{
key
:
qsTr
(
'
presetHighFps
'
)
value
:
'
high-fps
'
}
ListElement
{
key
:
qsTr
(
'
presetCustom
'
)
value
:
'
custom
'
}
}
model
:
[{
key
:
qsTr
(
'
presetDefault
'
),
value
:
'
default
'
},
{
key
:
qsTr
(
'
presetHighFps
'
),
value
:
'
high-fps
'
},
{
key
:
qsTr
(
'
presetCustom
'
),
value
:
'
custom
'
}]
textRole
:
'
key
'
onActivated
:
SettingsModel
.
videoPreset
=
presets
.
get
(
index
)
.
value
onActivated
:
SettingsModel
.
videoPreset
=
model
[
index
]
.
value
}
}
}
...
...
@@ -80,7 +72,19 @@ TabContainer {
label
:
qsTr
(
'
videoSizeLabel
'
)
ComboBox
{
// TODO
currentIndex
:
Utils
.
findIndex
(
model
,
function
(
definition
)
{
return
definition
.
value
.
name
===
SettingsModel
.
videoDefinition
.
name
})
model
:
SettingsModel
.
supportedVideoDefinitions
.
map
(
function
(
definition
)
{
return
{
key
:
definition
.
name
+
'
(
'
+
definition
.
width
+
'
x
'
+
definition
.
height
+
'
)
'
,
value
:
definition
}
})
textRole
:
'
key
'
onActivated
:
SettingsModel
.
videoDefinition
=
model
[
index
].
value
}
}
...
...
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