Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
J
jami-libclient
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
savoirfairelinux
jami-libclient
Commits
ee1f6b09
Commit
ee1f6b09
authored
6 years ago
by
Andreas Traczyk
Committed by
Kateryna Kostiuk
6 years ago
Browse files
Options
Downloads
Patches
Plain Diff
video models: add a way to set resolution and rate simultaneously
Change-Id: I5c6e4e4733a452ff770c1ac4dbe997cb568c2b41
parent
1a5f54e9
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/video/channel.cpp
+19
-1
19 additions, 1 deletion
src/video/channel.cpp
src/video/channel.h
+3
-0
3 additions, 0 deletions
src/video/channel.h
src/video/resolution.cpp
+1
-1
1 addition, 1 deletion
src/video/resolution.cpp
with
23 additions
and
2 deletions
src/video/channel.cpp
+
19
−
1
View file @
ee1f6b09
...
...
@@ -19,6 +19,7 @@
//Ring
#include
"resolution.h"
#include
"rate.h"
#include
"device.h"
#include
"../dbus/videomanager.h"
#include
"../private/videochannel_p.h"
...
...
@@ -81,7 +82,7 @@ bool Video::Channel::setActiveResolution(int idx)
bool
Video
::
Channel
::
setActiveResolution
(
Video
::
Resolution
*
res
)
{
if
((
!
res
)
||
d_ptr
->
m_lValidResolutions
.
indexOf
(
res
)
==
-
1
||
res
->
name
().
isEmpty
())
{
qWarning
()
<<
"Invalid active resolution"
<<
(
res
?
res
->
name
()
:
"NULL"
);
qWarning
()
<<
"Invalid active resolution
:
"
<<
(
res
?
res
->
name
()
:
"NULL"
);
return
false
;
}
...
...
@@ -93,6 +94,23 @@ bool Video::Channel::setActiveResolution(Video::Resolution* res) {
return
true
;
}
bool
Video
::
Channel
::
setActiveMode
(
int
resIndex
,
int
rateIndex
)
{
if
(
resIndex
<
0
||
resIndex
>=
d_ptr
->
m_lValidResolutions
.
size
())
return
false
;
auto
res
=
d_ptr
->
m_lValidResolutions
[
resIndex
];
if
(
rateIndex
<
0
||
rateIndex
>=
res
->
validRates
().
size
())
return
false
;
auto
rate
=
res
->
validRates
()[
rateIndex
];
if
(
d_ptr
->
m_pCurrentResolution
==
res
&&
res
->
activeRate
()
==
rate
)
{
qWarning
()
<<
"Mode already set: "
<<
(
res
?
res
->
name
()
:
"NULL"
)
<<
(
rate
?
rate
->
name
()
:
"NULL"
);
return
false
;
}
d_ptr
->
m_pCurrentResolution
=
res
;
d_ptr
->
m_pCurrentResolution
->
setActiveRate
(
rate
);
return
true
;
}
Video
::
Resolution
*
Video
::
Channel
::
activeResolution
()
{
//If it is the current device, then there is "current" resolution
...
...
This diff is collapsed.
Click to expand it.
src/video/channel.h
+
3
−
0
View file @
ee1f6b09
...
...
@@ -25,6 +25,7 @@
//Ring
namespace
Video
{
class
Resolution
;
class
Rate
;
class
Device
;
}
class
VideoChannelPrivate
;
...
...
@@ -46,6 +47,8 @@ public:
bool
setActiveResolution
(
Video
::
Resolution
*
res
);
bool
setActiveResolution
(
int
idx
);
bool
setActiveMode
(
int
resIndex
,
int
rateIndex
);
//Model
virtual
QVariant
data
(
const
QModelIndex
&
index
,
int
role
=
Qt
::
DisplayRole
)
const
override
;
virtual
int
rowCount
(
const
QModelIndex
&
parent
=
QModelIndex
()
)
const
override
;
...
...
This diff is collapsed.
Click to expand it.
src/video/resolution.cpp
+
1
−
1
View file @
ee1f6b09
...
...
@@ -89,7 +89,7 @@ const QList<Video::Rate*> Video::Resolution::validRates() const {
bool
Video
::
Resolution
::
setActiveRate
(
Video
::
Rate
*
rate
)
{
if
(
!
rate
||
(
d_ptr
->
m_lValidRates
.
indexOf
(
rate
)
==
-
1
))
{
qWarning
()
<<
"Trying to set an invalid rate"
<<
rate
;
qWarning
()
<<
"Trying to set an invalid rate
:
"
<<
rate
->
name
()
;
return
false
;
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment