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
bceb3f15
Commit
bceb3f15
authored
Oct 25, 2019
by
Andreas Traczyk
Browse files
Options
Downloads
Patches
Plain Diff
video settings: only use video device names for display
Change-Id: I7ffc37e8df24d97885ac52ce45145ee0c1f659d0
parent
f3567cc4
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
rendermanager.cpp
+3
-3
3 additions, 3 deletions
rendermanager.cpp
settingswidget.cpp
+53
-29
53 additions, 29 deletions
settingswidget.cpp
videoview.cpp
+6
-4
6 additions, 4 deletions
videoview.cpp
with
62 additions
and
36 deletions
rendermanager.cpp
+
3
−
3
View file @
bceb3f15
...
...
@@ -318,7 +318,7 @@ RenderManager::removeDistantRenderer(const std::string& id)
void
RenderManager
::
slotDeviceEvent
()
{
auto
defaultDevice
Name
=
avModel_
.
getDefaultDevice
Name
();
auto
defaultDevice
=
avModel_
.
getDefaultDevice
();
auto
currentCaptureDevice
=
avModel_
.
getCurrentVideoCaptureDevice
();
// decide whether a device has plugged, unplugged, or nothing has changed
auto
deviceList
=
avModel_
.
getDevices
();
...
...
@@ -342,14 +342,14 @@ RenderManager::slotDeviceEvent()
stopPreviewing
();
}
else
if
(
deviceEvent
==
DeviceEvent
::
RemovedCurrent
&&
currentDeviceListSize
>
0
)
{
avModel_
.
setCurrentVideoCaptureDevice
(
defaultDevice
Name
);
avModel_
.
setCurrentVideoCaptureDevice
(
defaultDevice
);
startPreviewing
(
true
);
}
else
{
startPreviewing
();
}
}
else
if
(
deviceEvent
==
DeviceEvent
::
Added
&&
currentDeviceListSize
==
1
)
{
avModel_
.
setCurrentVideoCaptureDevice
(
defaultDevice
Name
);
avModel_
.
setCurrentVideoCaptureDevice
(
defaultDevice
);
}
emit
videoDeviceListChanged
();
...
...
This diff is collapsed.
Click to expand it.
settingswidget.cpp
+
53
−
29
View file @
bceb3f15
...
...
@@ -271,7 +271,7 @@ void SettingsWidget::slotAccountListChanged()
}
else
{
disconnectAccountConnections
();
}
auto
device
=
LRCInstance
::
avModel
().
getDefaultDevice
Name
();
auto
device
=
LRCInstance
::
avModel
().
getDefaultDevice
();
if
(
LRCInstance
::
avModel
().
getCurrentVideoCaptureDevice
().
empty
())
{
LRCInstance
::
avModel
().
setCurrentVideoCaptureDevice
(
device
);
}
...
...
@@ -1042,13 +1042,26 @@ void SettingsWidget::slotAudioInputIndexChanged(int index)
void
SettingsWidget
::
slotDeviceBoxCurrentIndexChanged
(
int
index
)
{
std
::
string
device
=
ui
->
deviceBox
->
itemData
(
index
,
Qt
::
DisplayRole
)
std
::
string
device
Name
=
ui
->
deviceBox
->
itemData
(
index
,
Qt
::
DisplayRole
)
.
toString
()
.
toStdString
();
LRCInstance
::
avModel
().
setCurrentVideoCaptureDevice
(
device
);
LRCInstance
::
avModel
().
setDefaultDevice
(
device
);
setFormatListForDevice
(
device
);
auto
devices
=
LRCInstance
::
avModel
().
getDevices
();
try
{
auto
iter
=
std
::
find_if
(
devices
.
begin
(),
devices
.
end
(),
[
deviceName
](
const
std
::
string
&
d
)
{
auto
settings
=
LRCInstance
::
avModel
().
getDeviceSettings
(
d
);
return
settings
.
name
==
deviceName
;
});
if
(
iter
==
devices
.
end
())
{
qWarning
()
<<
"Couldn't find device: "
<<
deviceName
.
c_str
();
return
;
}
auto
deviceId
=
*
iter
;
LRCInstance
::
avModel
().
setCurrentVideoCaptureDevice
(
deviceId
);
LRCInstance
::
avModel
().
setDefaultDevice
(
deviceId
);
setFormatListForDevice
(
deviceId
);
startPreviewing
(
true
);
}
catch
(...)
{}
}
void
SettingsWidget
::
slotFormatBoxCurrentIndexChanged
(
int
index
)
...
...
@@ -1056,8 +1069,12 @@ void SettingsWidget::slotFormatBoxCurrentIndexChanged(int index)
auto
resolution
=
formatIndexList_
.
at
(
index
).
first
;
auto
rate
=
formatIndexList_
.
at
(
index
).
second
;
auto
device
=
LRCInstance
::
avModel
().
getCurrentVideoCaptureDevice
();
lrc
::
api
::
video
::
Settings
settings
{{},
device
,
rate
,
resolution
};
try
{
auto
settings
=
LRCInstance
::
avModel
().
getDeviceSettings
(
device
);
settings
.
rate
=
rate
;
settings
.
size
=
resolution
;
LRCInstance
::
avModel
().
setDeviceSettings
(
settings
);
}
catch
(...)
{}
}
void
SettingsWidget
::
startPreviewing
(
bool
force
)
...
...
@@ -1080,6 +1097,7 @@ void SettingsWidget::setFormatListForDevice(const std::string& device)
if
(
deviceCapabilities
.
size
()
==
0
)
{
return
;
}
try
{
auto
currentSettings
=
LRCInstance
::
avModel
().
getDeviceSettings
(
device
);
auto
currentChannel
=
currentSettings
.
channel
;
currentChannel
=
currentChannel
.
empty
()
?
"default"
:
currentChannel
;
...
...
@@ -1103,6 +1121,9 @@ void SettingsWidget::setFormatListForDevice(const std::string& device)
}
ui
->
formatBox
->
blockSignals
(
false
);
}
catch
(
const
std
::
exception
&
e
)
{
qWarning
()
<<
e
.
what
();
}
}
void
SettingsWidget
::
slotSetHardwareAccel
(
bool
state
)
...
...
@@ -1178,7 +1199,10 @@ SettingsWidget::populateVideoSettings()
auto
currentCaptureDevice
=
LRCInstance
::
avModel
().
getCurrentVideoCaptureDevice
();
auto
deviceIndex
=
Utils
::
indexInVector
(
devices
,
currentCaptureDevice
);
for
(
auto
d
:
devices
)
{
ui
->
deviceBox
->
addItem
(
QString
::
fromStdString
(
d
).
toUtf8
());
try
{
auto
settings
=
LRCInstance
::
avModel
().
getDeviceSettings
(
d
);
ui
->
deviceBox
->
addItem
(
QString
::
fromStdString
(
settings
.
name
).
toUtf8
());
}
catch
(...)
{}
}
ui
->
deviceBox
->
setCurrentIndex
(
deviceIndex
);
setFormatListForDevice
(
LRCInstance
::
avModel
().
getCurrentVideoCaptureDevice
());
...
...
This diff is collapsed.
Click to expand it.
videoview.cpp
+
6
−
4
View file @
bceb3f15
...
...
@@ -435,15 +435,17 @@ VideoView::resetPreview()
}
else
{
auto
device
=
LRCInstance
::
avModel
().
getCurrentVideoCaptureDevice
();
if
(
device
.
empty
())
{
device
=
LRCInstance
::
avModel
().
getDefaultDevice
Name
();
device
=
LRCInstance
::
avModel
().
getDefaultDevice
();
}
if
(
device
.
empty
())
{
previewWidget_
->
setVisible
(
false
);
return
;
}
try
{
auto
settings
=
LRCInstance
::
avModel
().
getDeviceSettings
(
device
);
width
=
QString
::
fromStdString
(
settings
.
size
).
split
(
"x"
)[
0
].
toInt
();
height
=
QString
::
fromStdString
(
settings
.
size
).
split
(
"x"
)[
1
].
toInt
();
}
catch
(...)
{}
}
auto
newSize
=
previewWidget_
->
getScaledSize
(
width
,
height
);
previewWidget_
->
setupGeometry
(
newSize
);
...
...
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