Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
qgroundcontrol
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
6b1f65a6
Commit
6b1f65a6
authored
Apr 03, 2020
by
Andrew Voznytsa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Better video receiver customization support
parent
98510ab0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
50 additions
and
8 deletions
+50
-8
GstVideoReceiver.cc
src/VideoReceiver/GstVideoReceiver.cc
+50
-7
GstVideoReceiver.h
src/VideoReceiver/GstVideoReceiver.h
+0
-1
No files found.
src/VideoReceiver/GstVideoReceiver.cc
View file @
6b1f65a6
...
...
@@ -161,12 +161,35 @@ GstVideoReceiver::start(const QString& uri, unsigned timeout)
break
;
}
g_signal_connect
(
_source
,
"pad-added"
,
G_CALLBACK
(
_onNewPad
),
this
);
gst_bin_add_many
(
GST_BIN
(
_pipeline
),
_source
,
_tee
,
decoderQueue
,
_decoderValve
,
recorderQueue
,
_recorderValve
,
nullptr
);
pipelineUp
=
true
;
GstPad
*
srcPad
=
nullptr
;
GstIterator
*
it
;
if
((
it
=
gst_element_iterate_src_pads
(
_source
))
!=
nullptr
)
{
GValue
vpad
=
G_VALUE_INIT
;
if
(
gst_iterator_next
(
it
,
&
vpad
)
==
GST_ITERATOR_OK
)
{
srcPad
=
GST_PAD
(
g_value_get_object
(
&
vpad
));
gst_object_ref
(
srcPad
);
g_value_reset
(
&
vpad
);
}
gst_iterator_free
(
it
);
it
=
nullptr
;
}
if
(
srcPad
!=
nullptr
)
{
_onNewSourcePad
(
srcPad
);
gst_object_unref
(
srcPad
);
srcPad
=
nullptr
;
}
else
{
g_signal_connect
(
_source
,
"pad-added"
,
G_CALLBACK
(
_onNewPad
),
this
);
}
if
(
!
gst_element_link_many
(
_tee
,
decoderQueue
,
_decoderValve
,
nullptr
))
{
qCCritical
(
VideoReceiverLog
)
<<
"Unable to link decoder queue"
;
break
;
...
...
@@ -1003,11 +1026,6 @@ GstVideoReceiver::_addDecoder(GstElement* src)
gst_caps_unref
(
caps
);
caps
=
nullptr
;
// FIXME: AV: check if srcpad exists - if it does then no need to wait for new pad
// int probeRes = 0;
// gst_element_foreach_src_pad(source, _padProbe, &probeRes);
g_signal_connect
(
_decoder
,
"pad-added"
,
G_CALLBACK
(
_onNewPad
),
this
);
gst_bin_add
(
GST_BIN
(
_pipeline
),
_decoder
);
gst_element_sync_state_with_parent
(
_decoder
);
...
...
@@ -1019,6 +1037,31 @@ GstVideoReceiver::_addDecoder(GstElement* src)
return
false
;
}
GstPad
*
srcPad
=
nullptr
;
GstIterator
*
it
;
if
((
it
=
gst_element_iterate_src_pads
(
_decoder
))
!=
nullptr
)
{
GValue
vpad
=
G_VALUE_INIT
;
if
(
gst_iterator_next
(
it
,
&
vpad
)
==
GST_ITERATOR_OK
)
{
srcPad
=
GST_PAD
(
g_value_get_object
(
&
vpad
));
gst_object_ref
(
srcPad
);
g_value_reset
(
&
vpad
);
}
gst_iterator_free
(
it
);
it
=
nullptr
;
}
if
(
srcPad
!=
nullptr
)
{
_onNewDecoderPad
(
srcPad
);
gst_object_unref
(
srcPad
);
srcPad
=
nullptr
;
}
else
{
g_signal_connect
(
_decoder
,
"pad-added"
,
G_CALLBACK
(
_onNewPad
),
this
);
}
return
true
;
}
...
...
src/VideoReceiver/GstVideoReceiver.h
View file @
6b1f65a6
...
...
@@ -120,7 +120,6 @@ protected:
bool
_needDispatch
(
void
);
void
_dispatchSignal
(
std
::
function
<
void
()
>
emitter
);
private:
static
gboolean
_onBusMessage
(
GstBus
*
bus
,
GstMessage
*
message
,
gpointer
user_data
);
static
void
_onNewPad
(
GstElement
*
element
,
GstPad
*
pad
,
gpointer
data
);
static
void
_wrapWithGhostPad
(
GstElement
*
element
,
GstPad
*
pad
,
gpointer
data
);
...
...
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