Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
savoirfairelinux
jami-daemon
Commits
e25fc963
Commit
e25fc963
authored
Aug 13, 2013
by
Tristan Matthews
Browse files
* #28351: libav_utils: use range-based for loops
parent
7ed09b90
Changes
1
Hide whitespace changes
Inline
Side-by-side
daemon/src/video/libav_utils.cpp
View file @
e25fc963
...
...
@@ -58,11 +58,11 @@ void findInstalledVideoCodecs()
if
(
p
->
type
==
AVMEDIA_TYPE_VIDEO
)
libav_codecs
.
push_back
(
p
->
name
);
for
(
map
<
string
,
string
>::
const_iterator
it
=
encoders_
.
begin
();
it
!=
encoders_
.
end
();
++
it
)
{
if
(
std
::
find
(
libav_codecs
.
begin
(),
libav_codecs
.
end
(),
it
->
second
)
!=
libav_codecs
.
end
())
installed_video_codecs_
.
push_back
(
it
->
first
);
for
(
const
auto
&
it
:
encoders_
)
{
if
(
std
::
find
(
libav_codecs
.
begin
(),
libav_codecs
.
end
(),
it
.
second
)
!=
libav_codecs
.
end
())
installed_video_codecs_
.
push_back
(
it
.
first
);
else
ERROR
(
"Didn't find
\"
%s
\"
encoder"
,
it
->
second
.
c_str
());
ERROR
(
"Didn't find
\"
%s
\"
encoder"
,
it
.
second
.
c_str
());
}
}
...
...
@@ -160,15 +160,14 @@ getDefaultCodecs()
const
char
*
const
DEFAULT_BITRATE
=
"400"
;
sfl_avcodec_init
();
std
::
vector
<
std
::
map
<
std
::
string
,
std
::
string
>
>
result
;
for
(
std
::
vector
<
std
::
string
>::
const_iterator
iter
=
installed_video_codecs_
.
begin
();
iter
!=
installed_video_codecs_
.
end
();
++
iter
)
{
for
(
const
auto
&
iter
:
installed_video_codecs_
)
{
std
::
map
<
std
::
string
,
std
::
string
>
codec
;
// FIXME: get these keys from proper place
codec
[
"name"
]
=
*
iter
;
codec
[
"name"
]
=
iter
;
codec
[
"bitrate"
]
=
DEFAULT_BITRATE
;
codec
[
"enabled"
]
=
"true"
;
// FIXME: make a nicer version of this
if
(
*
iter
==
"H264"
)
if
(
iter
==
"H264"
)
codec
[
"parameters"
]
=
DEFAULT_H264_PROFILE_LEVEL_ID
;
result
.
push_back
(
codec
);
}
...
...
Write
Preview
Supports
Markdown
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