Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Kamoso
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Multimedia
Kamoso
Commits
6ceec6cd
Commit
6ceec6cd
authored
Apr 29, 2020
by
Aleix Pol Gonzalez
🐧
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Let GStreamer create the device source
This makes it a bit more future-proof and less explicitly tied to v4l2.
parent
677be503
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
5 deletions
+6
-5
src/video/webcamcontrol.cpp
src/video/webcamcontrol.cpp
+6
-5
No files found.
src/video/webcamcontrol.cpp
View file @
6ceec6cd
...
...
@@ -272,7 +272,7 @@ bool WebcamControl::playDevice(Device *device)
gst_element_set_state
(
GST_ELEMENT
(
m_pipeline
.
data
()),
GST_STATE_NULL
);
if
(
!
m_cameraSource
)
{
m_cameraSource
.
reset
(
gst_element_factory_make
(
"wrappercamerabinsrc"
,
"
video_balance
"
));
m_cameraSource
.
reset
(
gst_element_factory_make
(
"wrappercamerabinsrc"
,
""
));
// Another option here is to return true, therefore continuing with launching, but
// in that case the application is mostly useless.
if
(
m_cameraSource
.
isNull
())
{
...
...
@@ -285,10 +285,11 @@ bool WebcamControl::playDevice(Device *device)
g_object_set
(
m_cameraSource
.
data
(),
"video-source"
,
source
,
nullptr
);
}
if
(
m_currentDevice
!=
device
->
udi
())
{
GstElement
*
source
;
g_object_get
(
m_cameraSource
.
data
(),
"video-source"
,
&
source
,
nullptr
);
g_object_set
(
source
,
"device"
,
device
->
path
().
toUtf8
().
constData
(),
nullptr
);
GstElement
*
source
;
g_object_get
(
m_cameraSource
.
data
(),
"video-source"
,
&
source
,
nullptr
);
if
(
m_currentDevice
!=
device
->
udi
()
||
!
source
)
{
source
=
device
->
createElement
();
g_object_set
(
m_cameraSource
.
data
(),
"video-source"
,
source
,
nullptr
);
}
if
(
!
m_pipeline
)
{
...
...
Write
Preview
Markdown
is supported
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