Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
2a1f755e
Commit
2a1f755e
authored
Apr 10, 2020
by
Andrew Voznytsa
Browse files
Don't add rtp jitter buffer for RTSP streams
parent
caa0e2cb
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/VideoReceiver/GstVideoReceiver.cc
View file @
2a1f755e
...
...
@@ -810,7 +810,7 @@ GstVideoReceiver::_makeSource(const QString& uri)
}
}
}
else
{
g_signal_connect
(
source
,
"pad-added"
,
G_CALLBACK
(
_linkPad
WithOptionalBuffer
),
parser
);
g_signal_connect
(
source
,
"pad-added"
,
G_CALLBACK
(
_linkPad
),
parser
);
}
g_signal_connect
(
parser
,
"pad-added"
,
G_CALLBACK
(
_wrapWithGhostPad
),
nullptr
);
...
...
@@ -1401,57 +1401,8 @@ GstVideoReceiver::_wrapWithGhostPad(GstElement* element, GstPad* pad, gpointer d
}
void
GstVideoReceiver
::
_linkPad
WithOptionalBuffer
(
GstElement
*
element
,
GstPad
*
pad
,
gpointer
data
)
GstVideoReceiver
::
_linkPad
(
GstElement
*
element
,
GstPad
*
pad
,
gpointer
data
)
{
bool
isRtpPad
=
false
;
GstCaps
*
filter
;
if
((
filter
=
gst_caps_from_string
(
"application/x-rtp"
))
!=
nullptr
)
{
GstCaps
*
caps
=
gst_pad_query_caps
(
pad
,
nullptr
);
if
(
caps
!=
nullptr
)
{
if
(
!
gst_caps_is_any
(
caps
)
&&
gst_caps_can_intersect
(
caps
,
filter
))
{
isRtpPad
=
true
;
}
gst_caps_unref
(
caps
);
caps
=
nullptr
;
}
gst_caps_unref
(
filter
);
filter
=
nullptr
;
}
if
(
isRtpPad
)
{
GstElement
*
buffer
;
if
((
buffer
=
gst_element_factory_make
(
"rtpjitterbuffer"
,
nullptr
))
!=
nullptr
)
{
gst_bin_add
(
GST_BIN
(
GST_ELEMENT_PARENT
(
element
)),
buffer
);
gst_element_sync_state_with_parent
(
buffer
);
GstPad
*
sinkpad
=
gst_element_get_static_pad
(
buffer
,
"sink"
);
if
(
sinkpad
!=
nullptr
)
{
const
GstPadLinkReturn
ret
=
gst_pad_link
(
pad
,
sinkpad
);
gst_object_unref
(
sinkpad
);
sinkpad
=
nullptr
;
if
(
ret
==
GST_PAD_LINK_OK
)
{
pad
=
gst_element_get_static_pad
(
buffer
,
"src"
);
element
=
buffer
;
}
else
{
qCDebug
(
VideoReceiverLog
)
<<
"Partially failed - gst_pad_link()"
;
}
}
else
{
qCDebug
(
VideoReceiverLog
)
<<
"Partially failed - gst_element_get_static_pad()"
;
}
}
else
{
qCDebug
(
VideoReceiverLog
)
<<
"Partially failed - gst_element_factory_make('rtpjitterbuffer')"
;
}
}
gchar
*
name
;
if
((
name
=
gst_pad_get_name
(
pad
))
!=
nullptr
)
{
...
...
src/VideoReceiver/GstVideoReceiver.h
View file @
2a1f755e
...
...
@@ -123,7 +123,7 @@ protected:
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
);
static
void
_linkPad
WithOptionalBuffer
(
GstElement
*
element
,
GstPad
*
pad
,
gpointer
data
);
static
void
_linkPad
(
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
);
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment