mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-10-02 16:52:42 +00:00
srtp: Let packets through without touching them if no crypto or auth is set
This commit is contained in:
parent
a10e800dfd
commit
d346e75606
2 changed files with 14 additions and 2 deletions
|
@ -858,6 +858,11 @@ gst_srtp_dec_chain (GstPad * pad, GstObject * parent, GstBuffer * buf,
|
||||||
goto drop_buffer;
|
goto drop_buffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!STREAM_HAS_CRYPTO (stream)) {
|
||||||
|
GST_OBJECT_UNLOCK (filter);
|
||||||
|
goto push_out;
|
||||||
|
}
|
||||||
|
|
||||||
GST_LOG_OBJECT (pad, "Received %s buffer of size %" G_GSIZE_FORMAT
|
GST_LOG_OBJECT (pad, "Received %s buffer of size %" G_GSIZE_FORMAT
|
||||||
" with SSRC = %u", is_rtcp ? "RTCP" : "RTP", gst_buffer_get_size (buf),
|
" with SSRC = %u", is_rtcp ? "RTCP" : "RTP", gst_buffer_get_size (buf),
|
||||||
ssrc);
|
ssrc);
|
||||||
|
@ -925,6 +930,7 @@ unprotect:
|
||||||
if (gst_srtp_get_soft_limit_reached ())
|
if (gst_srtp_get_soft_limit_reached ())
|
||||||
request_key_with_signal (filter, ssrc, SIGNAL_SOFT_LIMIT);
|
request_key_with_signal (filter, ssrc, SIGNAL_SOFT_LIMIT);
|
||||||
|
|
||||||
|
push_out:
|
||||||
/* Push buffer to source pad */
|
/* Push buffer to source pad */
|
||||||
otherpad = (GstPad *) gst_pad_get_element_private (pad);
|
otherpad = (GstPad *) gst_pad_get_element_private (pad);
|
||||||
ret = gst_pad_push (otherpad, buf);
|
ret = gst_pad_push (otherpad, buf);
|
||||||
|
|
|
@ -938,8 +938,6 @@ gst_srtp_enc_chain (GstPad * pad, GstObject * parent, GstBuffer * buf,
|
||||||
|
|
||||||
GST_OBJECT_LOCK (filter);
|
GST_OBJECT_LOCK (filter);
|
||||||
|
|
||||||
size_max = gst_buffer_get_size (buf) + SRTP_MAX_TRAILER_LEN + 10;
|
|
||||||
|
|
||||||
/* Update source caps if asked */
|
/* Update source caps if asked */
|
||||||
if (do_setcaps) {
|
if (do_setcaps) {
|
||||||
GstCaps *caps;
|
GstCaps *caps;
|
||||||
|
@ -956,7 +954,15 @@ gst_srtp_enc_chain (GstPad * pad, GstObject * parent, GstBuffer * buf,
|
||||||
GST_OBJECT_LOCK (filter);
|
GST_OBJECT_LOCK (filter);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!HAS_CRYPTO (filter)) {
|
||||||
|
GST_OBJECT_UNLOCK (filter);
|
||||||
|
otherpad = get_rtp_other_pad (pad);
|
||||||
|
return gst_pad_push (otherpad, buf);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Create a bigger buffer to add protection */
|
/* Create a bigger buffer to add protection */
|
||||||
|
size_max = gst_buffer_get_size (buf) + SRTP_MAX_TRAILER_LEN + 10;
|
||||||
bufout = gst_buffer_new_allocate (NULL, size_max, NULL);
|
bufout = gst_buffer_new_allocate (NULL, size_max, NULL);
|
||||||
|
|
||||||
gst_buffer_map (buf, &mapin, GST_MAP_READ);
|
gst_buffer_map (buf, &mapin, GST_MAP_READ);
|
||||||
|
|
Loading…
Reference in a new issue