Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
jami-daemon
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
Show more breadcrumbs
savoirfairelinux
jami-daemon
Commits
7ed09b90
Commit
7ed09b90
authored
11 years ago
by
Tristan Matthews
Browse files
Options
Downloads
Patches
Plain Diff
* #28351: videov4l2: use range-based for loops
parent
4461bd9e
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
daemon/src/video/video_v4l2.cpp
+15
-16
15 additions, 16 deletions
daemon/src/video/video_v4l2.cpp
with
15 additions
and
16 deletions
daemon/src/video/video_v4l2.cpp
+
15
−
16
View file @
7ed09b90
...
@@ -121,10 +121,9 @@ static const unsigned pixelformats_supported[] = {
...
@@ -121,10 +121,9 @@ static const unsigned pixelformats_supported[] = {
namespace
{
namespace
{
unsigned
int
pixelformat_score
(
unsigned
pixelformat
)
unsigned
int
pixelformat_score
(
unsigned
pixelformat
)
{
{
size_t
n
=
sizeof
pixelformats_supported
/
sizeof
*
pixelformats_supported
;
for
(
const
auto
&
iter
:
pixelformats_supported
)
for
(
unsigned
int
i
=
0
;
i
<
n
;
++
i
)
if
(
iter
==
pixelformat
)
if
(
pixelformats_supported
[
i
]
==
pixelformat
)
return
iter
;
return
i
;
return
UINT_MAX
-
1
;
return
UINT_MAX
-
1
;
}
}
...
@@ -137,9 +136,9 @@ vector<string> VideoV4l2Size::getRateList()
...
@@ -137,9 +136,9 @@ vector<string> VideoV4l2Size::getRateList()
{
{
vector
<
string
>
v
;
vector
<
string
>
v
;
for
(
vector
<
float
>::
const_iterator
i
=
rates_
.
begin
()
;
i
!=
rates_
.
end
();
++
i
)
{
for
(
const
auto
&
iter
:
rates_
)
{
std
::
stringstream
ss
;
std
::
stringstream
ss
;
ss
<<
*
i
;
ss
<<
i
ter
;
v
.
push_back
(
ss
.
str
());
v
.
push_back
(
ss
.
str
());
}
}
...
@@ -201,9 +200,9 @@ vector<string> VideoV4l2Channel::getSizeList() const
...
@@ -201,9 +200,9 @@ vector<string> VideoV4l2Channel::getSizeList() const
{
{
vector
<
string
>
v
;
vector
<
string
>
v
;
for
(
vector
<
VideoV4l2Size
>::
const_iterator
itr
=
sizes_
.
begin
();
itr
!=
sizes_
.
end
();
++
itr
)
{
for
(
const
auto
&
iter
:
sizes_
)
{
std
::
stringstream
ss
;
std
::
stringstream
ss
;
ss
<<
it
r
->
width
<<
"x"
<<
it
r
->
height
;
ss
<<
it
er
.
width
<<
"x"
<<
it
er
.
height
;
v
.
push_back
(
ss
.
str
());
v
.
push_back
(
ss
.
str
());
}
}
...
@@ -309,11 +308,11 @@ void VideoV4l2Channel::getFormat(int fd)
...
@@ -309,11 +308,11 @@ void VideoV4l2Channel::getFormat(int fd)
VideoV4l2Size
VideoV4l2Channel
::
getSize
(
const
string
&
name
)
const
VideoV4l2Size
VideoV4l2Channel
::
getSize
(
const
string
&
name
)
const
{
{
for
(
vector
<
VideoV4l2Size
>::
const_iterator
i
=
sizes_
.
begin
();
i
!=
sizes_
.
end
();
++
i
)
{
for
(
const
auto
&
iter
:
sizes_
)
{
std
::
stringstream
ss
;
std
::
stringstream
ss
;
ss
<<
i
->
width
<<
"x"
<<
i
->
height
;
ss
<<
i
ter
.
width
<<
"x"
<<
i
ter
.
height
;
if
(
ss
.
str
()
==
name
)
if
(
ss
.
str
()
==
name
)
return
*
i
;
return
i
ter
;
}
}
// fallback to last size
// fallback to last size
...
@@ -354,8 +353,8 @@ vector<string> VideoV4l2Device::getChannelList() const
...
@@ -354,8 +353,8 @@ vector<string> VideoV4l2Device::getChannelList() const
{
{
vector
<
string
>
v
;
vector
<
string
>
v
;
for
(
vector
<
VideoV4l2Channel
>::
const_iterator
itr
=
channels_
.
begin
();
itr
!=
channels_
.
end
();
++
itr
)
for
(
const
auto
&
itr
:
channels_
)
v
.
push_back
(
itr
->
name
);
v
.
push_back
(
itr
.
name
);
return
v
;
return
v
;
}
}
...
@@ -363,9 +362,9 @@ vector<string> VideoV4l2Device::getChannelList() const
...
@@ -363,9 +362,9 @@ vector<string> VideoV4l2Device::getChannelList() const
const
VideoV4l2Channel
&
const
VideoV4l2Channel
&
VideoV4l2Device
::
getChannel
(
const
string
&
name
)
const
VideoV4l2Device
::
getChannel
(
const
string
&
name
)
const
{
{
for
(
vector
<
VideoV4l2Channel
>::
const_iterator
itr
=
channels_
.
begin
();
itr
!=
channels_
.
end
();
++
itr
)
for
(
const
auto
&
iter
:
channels_
)
if
(
it
r
->
name
==
name
)
if
(
it
er
.
name
==
name
)
return
*
itr
;
return
it
e
r
;
return
channels_
.
back
();
return
channels_
.
back
();
}
}
...
...
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