Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
savoirfairelinux
jami-daemon
Commits
7ed09b90
Commit
7ed09b90
authored
Aug 13, 2013
by
Tristan Matthews
Browse files
* #28351: videov4l2: use range-based for loops
parent
4461bd9e
Changes
1
Show whitespace changes
Inline
Side-by-side
daemon/src/video/video_v4l2.cpp
View file @
7ed09b90
...
...
@@ -121,10 +121,9 @@ static const unsigned pixelformats_supported[] = {
namespace
{
unsigned
int
pixelformat_score
(
unsigned
pixelformat
)
{
size_t
n
=
sizeof
pixelformats_supported
/
sizeof
*
pixelformats_supported
;
for
(
unsigned
int
i
=
0
;
i
<
n
;
++
i
)
if
(
pixelformats_supported
[
i
]
==
pixelformat
)
return
i
;
for
(
const
auto
&
iter
:
pixelformats_supported
)
if
(
iter
==
pixelformat
)
return
iter
;
return
UINT_MAX
-
1
;
}
...
...
@@ -137,9 +136,9 @@ vector<string> VideoV4l2Size::getRateList()
{
vector
<
string
>
v
;
for
(
vector
<
float
>::
const_iterator
i
=
rates_
.
begin
()
;
i
!=
rates_
.
end
();
++
i
)
{
for
(
const
auto
&
iter
:
rates_
)
{
std
::
stringstream
ss
;
ss
<<
*
i
;
ss
<<
i
ter
;
v
.
push_back
(
ss
.
str
());
}
...
...
@@ -201,9 +200,9 @@ vector<string> VideoV4l2Channel::getSizeList() const
{
vector
<
string
>
v
;
for
(
vector
<
VideoV4l2Size
>::
const_iterator
itr
=
sizes_
.
begin
();
itr
!=
sizes_
.
end
();
++
itr
)
{
for
(
const
auto
&
iter
:
sizes_
)
{
std
::
stringstream
ss
;
ss
<<
it
r
->
width
<<
"x"
<<
it
r
->
height
;
ss
<<
it
er
.
width
<<
"x"
<<
it
er
.
height
;
v
.
push_back
(
ss
.
str
());
}
...
...
@@ -309,11 +308,11 @@ void VideoV4l2Channel::getFormat(int fd)
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
;
ss
<<
i
->
width
<<
"x"
<<
i
->
height
;
ss
<<
i
ter
.
width
<<
"x"
<<
i
ter
.
height
;
if
(
ss
.
str
()
==
name
)
return
*
i
;
return
i
ter
;
}
// fallback to last size
...
...
@@ -354,8 +353,8 @@ vector<string> VideoV4l2Device::getChannelList() const
{
vector
<
string
>
v
;
for
(
vector
<
VideoV4l2Channel
>::
const_iterator
itr
=
channels_
.
begin
();
itr
!=
channels_
.
end
();
++
itr
)
v
.
push_back
(
itr
->
name
);
for
(
const
auto
&
itr
:
channels_
)
v
.
push_back
(
itr
.
name
);
return
v
;
}
...
...
@@ -363,9 +362,9 @@ vector<string> VideoV4l2Device::getChannelList() const
const
VideoV4l2Channel
&
VideoV4l2Device
::
getChannel
(
const
string
&
name
)
const
{
for
(
vector
<
VideoV4l2Channel
>::
const_iterator
itr
=
channels_
.
begin
();
itr
!=
channels_
.
end
();
++
itr
)
if
(
it
r
->
name
==
name
)
return
*
itr
;
for
(
const
auto
&
iter
:
channels_
)
if
(
it
er
.
name
==
name
)
return
it
e
r
;
return
channels_
.
back
();
}
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment