Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
J
jami-client-windows
Manage
Activity
Members
Plan
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Analyze
Contributor analytics
Repository analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
savoirfairelinux
jami-client-windows
Commits
da6dcc39
Commit
da6dcc39
authored
Nov 6, 2019
by
Andreas Traczyk
Browse files
Options
Downloads
Patches
Plain Diff
videoview: use device friendly name in context menu
Change-Id: Ic1b6d05bf8fe729359bb76769770a5b4922b7e62
parent
3bfd7fd9
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
settingswidget.cpp
+2
-7
2 additions, 7 deletions
settingswidget.cpp
videoview.cpp
+24
-17
24 additions, 17 deletions
videoview.cpp
with
26 additions
and
24 deletions
settingswidget.cpp
+
2
−
7
View file @
da6dcc39
...
@@ -1047,16 +1047,11 @@ void SettingsWidget::slotDeviceBoxCurrentIndexChanged(int index)
...
@@ -1047,16 +1047,11 @@ void SettingsWidget::slotDeviceBoxCurrentIndexChanged(int index)
.
toStdString
();
.
toStdString
();
auto
devices
=
LRCInstance
::
avModel
().
getDevices
();
auto
devices
=
LRCInstance
::
avModel
().
getDevices
();
try
{
try
{
auto
iter
=
std
::
find_if
(
devices
.
begin
(),
devices
.
end
(),
auto
deviceId
=
LRCInstance
::
avModel
().
getDeviceIdFromName
(
deviceName
);
[
deviceName
](
const
std
::
string
&
d
)
{
if
(
deviceId
.
empty
())
{
auto
settings
=
LRCInstance
::
avModel
().
getDeviceSettings
(
d
);
return
settings
.
name
==
deviceName
;
});
if
(
iter
==
devices
.
end
())
{
qWarning
()
<<
"Couldn't find device: "
<<
deviceName
.
c_str
();
qWarning
()
<<
"Couldn't find device: "
<<
deviceName
.
c_str
();
return
;
return
;
}
}
auto
deviceId
=
*
iter
;
LRCInstance
::
avModel
().
setCurrentVideoCaptureDevice
(
deviceId
);
LRCInstance
::
avModel
().
setCurrentVideoCaptureDevice
(
deviceId
);
LRCInstance
::
avModel
().
setDefaultDevice
(
deviceId
);
LRCInstance
::
avModel
().
setDefaultDevice
(
deviceId
);
setFormatListForDevice
(
deviceId
);
setFormatListForDevice
(
deviceId
);
...
...
This diff is collapsed.
Click to expand it.
videoview.cpp
+
24
−
17
View file @
da6dcc39
...
@@ -191,7 +191,9 @@ VideoView::showContextMenu(const QPoint& position)
...
@@ -191,7 +191,9 @@ VideoView::showContextMenu(const QPoint& position)
auto
devices
=
LRCInstance
::
avModel
().
getDevices
();
auto
devices
=
LRCInstance
::
avModel
().
getDevices
();
auto
device
=
LRCInstance
::
avModel
().
getCurrentVideoCaptureDevice
();
auto
device
=
LRCInstance
::
avModel
().
getCurrentVideoCaptureDevice
();
for
(
auto
d
:
devices
)
{
for
(
auto
d
:
devices
)
{
auto
deviceName
=
QString
::
fromStdString
(
d
).
toUtf8
();
try
{
auto
settings
=
LRCInstance
::
avModel
().
getDeviceSettings
(
d
);
QString
deviceName
=
QString
::
fromStdString
(
settings
.
name
).
toUtf8
();
auto
deviceAction
=
new
QAction
(
deviceName
,
this
);
auto
deviceAction
=
new
QAction
(
deviceName
,
this
);
menu
.
addAction
(
deviceAction
);
menu
.
addAction
(
deviceAction
);
deviceAction
->
setCheckable
(
true
);
deviceAction
->
setCheckable
(
true
);
...
@@ -200,14 +202,19 @@ VideoView::showContextMenu(const QPoint& position)
...
@@ -200,14 +202,19 @@ VideoView::showContextMenu(const QPoint& position)
}
}
connect
(
deviceAction
,
&
QAction
::
triggered
,
connect
(
deviceAction
,
&
QAction
::
triggered
,
[
this
,
deviceName
]()
{
[
this
,
deviceName
]()
{
auto
device
=
deviceName
.
toStdString
();
auto
deviceId
=
LRCInstance
::
avModel
().
getDeviceIdFromName
(
deviceName
.
toStdString
());
if
(
LRCInstance
::
avModel
().
getCurrentVideoCaptureDevice
()
==
device
)
{
if
(
deviceId
.
empty
())
{
qWarning
()
<<
"Couldn't find device: "
<<
deviceName
;
return
;
}
if
(
LRCInstance
::
avModel
().
getCurrentVideoCaptureDevice
()
==
deviceId
)
{
return
;
return
;
}
}
LRCInstance
::
avModel
().
switchInputTo
(
device
);
LRCInstance
::
avModel
().
switchInputTo
(
device
Id
);
resetPreview
();
resetPreview
();
LRCInstance
::
avModel
().
setCurrentVideoCaptureDevice
(
device
);
LRCInstance
::
avModel
().
setCurrentVideoCaptureDevice
(
device
Id
);
});
});
}
catch
(...)
{}
}
}
menu
.
addSeparator
();
menu
.
addSeparator
();
...
...
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