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
e0410462
Commit
e0410462
authored
5 years ago
by
Andreas Traczyk
Committed by
Kateryna Kostiuk
5 years ago
Browse files
Options
Downloads
Patches
Plain Diff
avmodel: sort resolutions by descending resolution width
Change-Id: I348db733613346f3c9f4e5243a354367bda4cddd
parent
18ad1c36
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/api/newvideo.h
+2
-2
2 additions, 2 deletions
src/api/newvideo.h
src/avmodel.cpp
+10
-2
10 additions, 2 deletions
src/avmodel.cpp
with
12 additions
and
4 deletions
src/api/newvideo.h
+
2
−
2
View file @
e0410462
...
...
@@ -44,14 +44,14 @@ namespace api
namespace
video
{
constexpr
static
const
char
PREVIEW_RENDERER_ID
[]
=
"local"
;
using
Channel
=
std
::
string
;
using
Resolution
=
std
::
string
;
using
Framerate
=
float
;
using
FrameratesList
=
std
::
vector
<
Framerate
>
;
using
Capabilities
=
std
::
map
<
Channel
,
std
::
map
<
Resolution
,
FrameratesList
>>
;
using
ResRateList
=
std
::
vector
<
std
::
pair
<
Resolution
,
FrameratesList
>>
;
using
Capabilities
=
std
::
map
<
Channel
,
ResRateList
>
;
/**
* This class is used by Renderer class to expose video data frame
...
...
This diff is collapsed.
Click to expand it.
src/avmodel.cpp
+
10
−
2
View file @
e0410462
...
...
@@ -237,16 +237,24 @@ AVModel::getDeviceCapabilities(const std::string& name) const
VideoManager
::
instance
().
getCapabilities
(
name
.
c_str
());
video
::
Capabilities
result
;
for
(
auto
&
channel
:
capabilites
.
toStdMap
())
{
std
::
map
<
video
::
Res
olution
,
video
::
Framer
ate
s
List
>
channelCapabilities
;
video
::
Res
R
ateList
channelCapabilities
;
for
(
auto
&
resToRates
:
channel
.
second
.
toStdMap
())
{
video
::
FrameratesList
rates
;
QVectorIterator
<
QString
>
itRates
(
resToRates
.
second
);
while
(
itRates
.
hasNext
())
{
rates
.
emplace_back
(
itRates
.
next
().
toFloat
());
}
channelCapabilities
.
insert
(
channelCapabilities
.
emplace_back
(
std
::
make_pair
(
resToRates
.
first
.
toStdString
(),
rates
));
}
// sort by resolution widths
std
::
sort
(
channelCapabilities
.
begin
(),
channelCapabilities
.
end
(),
[](
const
std
::
pair
<
video
::
Resolution
,
video
::
FrameratesList
>&
lhs
,
const
std
::
pair
<
video
::
Resolution
,
video
::
FrameratesList
>&
rhs
)
{
auto
lhsWidth
=
stoull
(
lhs
.
first
.
substr
(
0
,
lhs
.
first
.
find
(
"x"
)));
auto
rhsWidth
=
stoull
(
rhs
.
first
.
substr
(
0
,
rhs
.
first
.
find
(
"x"
)));
return
lhsWidth
>
rhsWidth
;
});
result
.
insert
(
std
::
make_pair
(
channel
.
first
.
toStdString
(),
channelCapabilities
));
}
...
...
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