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
aaf6a2ab
Commit
aaf6a2ab
authored
11 years ago
by
Tristan Matthews
Browse files
Options
Downloads
Patches
Plain Diff
video: don't assume that v4l lists are populated
Refs #45484
parent
327ed566
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
daemon/src/video/video_v4l2.cpp
+2
-0
2 additions, 0 deletions
daemon/src/video/video_v4l2.cpp
daemon/src/video/video_v4l2_list.cpp
+22
-2
22 additions, 2 deletions
daemon/src/video/video_v4l2_list.cpp
with
24 additions
and
2 deletions
daemon/src/video/video_v4l2.cpp
+
2
−
0
View file @
aaf6a2ab
...
@@ -29,6 +29,7 @@
...
@@ -29,6 +29,7 @@
*/
*/
#include
<string>
#include
<string>
#include
<cassert>
#include
<algorithm>
#include
<algorithm>
#include
<vector>
#include
<vector>
#include
<climits>
#include
<climits>
...
@@ -366,6 +367,7 @@ VideoV4l2Device::getChannel(const string &name) const
...
@@ -366,6 +367,7 @@ VideoV4l2Device::getChannel(const string &name) const
if
(
item
.
name
==
name
)
if
(
item
.
name
==
name
)
return
item
;
return
item
;
assert
(
not
channels_
.
empty
());
return
channels_
.
back
();
return
channels_
.
back
();
}
}
...
...
This diff is collapsed.
Click to expand it.
daemon/src/video/video_v4l2_list.cpp
+
22
−
2
View file @
aaf6a2ab
...
@@ -213,14 +213,34 @@ VideoV4l2ListThread::~VideoV4l2ListThread()
...
@@ -213,14 +213,34 @@ VideoV4l2ListThread::~VideoV4l2ListThread()
void
VideoV4l2ListThread
::
updateDefault
()
void
VideoV4l2ListThread
::
updateDefault
()
{
{
if
(
devices_
.
empty
())
{
ERROR
(
"No devices"
);
return
;
}
const
std
::
string
&
name
=
devices_
.
back
().
name
;
const
std
::
string
&
name
=
devices_
.
back
().
name
;
auto
controls
=
Manager
::
instance
().
getVideoControls
();
auto
controls
=
Manager
::
instance
().
getVideoControls
();
controls
->
setActiveDevice
(
name
);
controls
->
setActiveDevice
(
name
);
const
auto
channel
=
devices_
.
back
().
getChannelList
()[
0
];
const
auto
channelList
=
devices_
.
back
().
getChannelList
();
if
(
channelList
.
empty
())
{
ERROR
(
"No channel list present"
);
return
;
}
const
auto
channel
=
channelList
[
0
];
controls
->
setActiveDeviceChannel
(
channel
);
controls
->
setActiveDeviceChannel
(
channel
);
const
auto
size
=
devices_
.
back
().
getChannel
(
name
).
getSizeList
()[
0
];
const
auto
sizeList
=
devices_
.
back
().
getChannel
(
name
).
getSizeList
();
if
(
sizeList
.
empty
())
{
ERROR
(
"No size list present"
);
return
;
}
const
auto
size
=
sizeList
[
0
];
controls
->
setActiveDeviceSize
(
size
);
controls
->
setActiveDeviceSize
(
size
);
const
auto
rateList
(
controls
->
getDeviceRateList
(
name
,
channel
,
size
));
const
auto
rateList
(
controls
->
getDeviceRateList
(
name
,
channel
,
size
));
// compare by integer value
// compare by integer value
const
auto
highest
=
std
::
max_element
(
rateList
.
begin
(),
rateList
.
end
(),
[]
const
auto
highest
=
std
::
max_element
(
rateList
.
begin
(),
rateList
.
end
(),
[]
(
const
std
::
string
&
l
,
const
std
::
string
&
r
)
{
(
const
std
::
string
&
l
,
const
std
::
string
&
r
)
{
...
...
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