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
9d973d0f
Commit
9d973d0f
authored
Mar 31, 2020
by
Andrew Voznytsa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Force parsebin to output frame aligned stream
parent
1ece58f8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
55 additions
and
0 deletions
+55
-0
GstVideoReceiver.cc
src/VideoReceiver/GstVideoReceiver.cc
+54
-0
GstVideoReceiver.h
src/VideoReceiver/GstVideoReceiver.h
+1
-0
No files found.
src/VideoReceiver/GstVideoReceiver.cc
View file @
9d973d0f
...
...
@@ -729,6 +729,8 @@ GstVideoReceiver::_makeSource(const QString& uri)
break
;
}
g_signal_connect
(
parser
,
"autoplug-query"
,
G_CALLBACK
(
_filterParserCaps
),
nullptr
);
gst_bin_add_many
(
GST_BIN
(
bin
),
source
,
parser
,
nullptr
);
// FIXME: AV: Android does not determine MPEG2-TS via parsebin - have to explicitly state which demux to use
...
...
@@ -1434,6 +1436,58 @@ GstVideoReceiver::_padProbe(GstElement* element, GstPad* pad, gpointer user_data
return
TRUE
;
}
gboolean
GstVideoReceiver
::
_filterParserCaps
(
GstElement
*
bin
,
GstPad
*
pad
,
GstElement
*
element
,
GstQuery
*
query
,
gpointer
data
)
{
Q_UNUSED
(
bin
)
Q_UNUSED
(
pad
)
Q_UNUSED
(
element
)
Q_UNUSED
(
data
)
if
(
GST_QUERY_TYPE
(
query
)
!=
GST_QUERY_CAPS
)
{
return
FALSE
;
}
GstCaps
*
srcCaps
;
gst_query_parse_caps
(
query
,
&
srcCaps
);
if
(
srcCaps
==
nullptr
||
gst_caps_is_any
(
srcCaps
))
{
return
FALSE
;
}
GstCaps
*
sinkCaps
=
nullptr
;
GstCaps
*
filter
;
if
(
sinkCaps
==
nullptr
&&
(
filter
=
gst_caps_from_string
(
"video/x-h264"
))
!=
nullptr
)
{
if
(
gst_caps_can_intersect
(
srcCaps
,
filter
))
{
sinkCaps
=
gst_caps_from_string
(
"video/x-h264,stream-format=avc"
);
}
gst_caps_unref
(
filter
);
filter
=
nullptr
;
}
else
if
(
sinkCaps
==
nullptr
&&
(
filter
=
gst_caps_from_string
(
"video/x-h265"
))
!=
nullptr
)
{
if
(
gst_caps_can_intersect
(
srcCaps
,
filter
))
{
sinkCaps
=
gst_caps_from_string
(
"video/x-h265,stream-format=hvc1"
);
}
gst_caps_unref
(
filter
);
filter
=
nullptr
;
}
if
(
sinkCaps
==
nullptr
)
{
return
FALSE
;
}
gst_query_set_caps_result
(
query
,
sinkCaps
);
gst_caps_unref
(
sinkCaps
);
sinkCaps
=
nullptr
;
return
TRUE
;
}
gboolean
GstVideoReceiver
::
_autoplugQueryCaps
(
GstElement
*
bin
,
GstPad
*
pad
,
GstElement
*
element
,
GstQuery
*
query
,
gpointer
data
)
{
...
...
src/VideoReceiver/GstVideoReceiver.h
View file @
9d973d0f
...
...
@@ -131,6 +131,7 @@ private:
static
void
_wrapWithGhostPad
(
GstElement
*
element
,
GstPad
*
pad
,
gpointer
data
);
static
void
_linkPadWithOptionalBuffer
(
GstElement
*
element
,
GstPad
*
pad
,
gpointer
data
);
static
gboolean
_padProbe
(
GstElement
*
element
,
GstPad
*
pad
,
gpointer
user_data
);
static
gboolean
_filterParserCaps
(
GstElement
*
bin
,
GstPad
*
pad
,
GstElement
*
element
,
GstQuery
*
query
,
gpointer
data
);
static
gboolean
_autoplugQueryCaps
(
GstElement
*
bin
,
GstPad
*
pad
,
GstElement
*
element
,
GstQuery
*
query
,
gpointer
data
);
static
gboolean
_autoplugQueryContext
(
GstElement
*
bin
,
GstPad
*
pad
,
GstElement
*
element
,
GstQuery
*
query
,
gpointer
data
);
static
gboolean
_autoplugQuery
(
GstElement
*
bin
,
GstPad
*
pad
,
GstElement
*
element
,
GstQuery
*
query
,
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