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-libclient
Commits
62e10618
Commit
62e10618
authored
Nov 06, 2019
by
Andreas Traczyk
Committed by
Sébastien Blin
Nov 06, 2019
Browse files
avmodel: add helper function to get video device id from name
Change-Id: Ib74def3d68155fa8c3ea5728d148c06e7bb840f1
parent
67d0902c
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/api/avmodel.h
View file @
62e10618
...
...
@@ -110,6 +110,11 @@ public:
* @return possibilities of the device
*/
video
::
Capabilities
getDeviceCapabilities
(
const
std
::
string
&
deviceId
)
const
;
/**
* Get the deviceId corresponding to a given device friendly name
* @return deviceId
*/
std
::
string
getDeviceIdFromName
(
const
std
::
string
&
deviceName
)
const
;
/**
* Get supported audio managers
...
...
src/avmodel.cpp
View file @
62e10618
...
...
@@ -290,6 +290,22 @@ AVModel::setDeviceSettings(video::Settings& settings)
}
}
std
::
string
AVModel
::
getDeviceIdFromName
(
const
std
::
string
&
deviceName
)
const
{
auto
devices
=
getDevices
();
auto
iter
=
std
::
find_if
(
devices
.
begin
(),
devices
.
end
(),
[
this
,
deviceName
](
const
std
::
string
&
d
)
{
auto
settings
=
getDeviceSettings
(
d
);
return
settings
.
name
==
deviceName
;
});
if
(
iter
==
devices
.
end
())
{
qWarning
()
<<
"Couldn't find device: "
<<
deviceName
.
c_str
();
return
{};
}
return
*
iter
;
}
std
::
vector
<
std
::
string
>
AVModel
::
getSupportedAudioManagers
()
const
{
...
...
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