diff options
author | Olivier CrĂȘte <olivier.crete@collabora.com> | 2013-08-12 12:27:33 -0400 |
---|---|---|
committer | Olivier CrĂȘte <olivier.crete@collabora.com> | 2013-08-12 12:27:33 -0400 |
commit | d346e7560682a824caf38add63cb3a55164de808 (patch) | |
tree | 91e3a240f0d1aa823c1816cf3f0e9122aa06b909 /ext | |
parent | a10e800dfdb2d7cc742711fbbb8b2ab6b51da5d1 (diff) |
srtp: Let packets through without touching them if no crypto or auth is set
Diffstat (limited to 'ext')
-rw-r--r-- | ext/srtp/gstsrtpdec.c | 6 | ||||
-rw-r--r-- | ext/srtp/gstsrtpenc.c | 10 |
2 files changed, 14 insertions, 2 deletions
diff --git a/ext/srtp/gstsrtpdec.c b/ext/srtp/gstsrtpdec.c index 2c4c7275b..41efb1dde 100644 --- a/ext/srtp/gstsrtpdec.c +++ b/ext/srtp/gstsrtpdec.c @@ -858,6 +858,11 @@ gst_srtp_dec_chain (GstPad * pad, GstObject * parent, GstBuffer * buf, 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 " with SSRC = %u", is_rtcp ? "RTCP" : "RTP", gst_buffer_get_size (buf), ssrc); @@ -925,6 +930,7 @@ unprotect: if (gst_srtp_get_soft_limit_reached ()) request_key_with_signal (filter, ssrc, SIGNAL_SOFT_LIMIT); +push_out: /* Push buffer to source pad */ otherpad = (GstPad *) gst_pad_get_element_private (pad); ret = gst_pad_push (otherpad, buf); diff --git a/ext/srtp/gstsrtpenc.c b/ext/srtp/gstsrtpenc.c index 8ce2a6bc4..ddd566112 100644 --- a/ext/srtp/gstsrtpenc.c +++ b/ext/srtp/gstsrtpenc.c @@ -938,8 +938,6 @@ gst_srtp_enc_chain (GstPad * pad, GstObject * parent, GstBuffer * buf, GST_OBJECT_LOCK (filter); - size_max = gst_buffer_get_size (buf) + SRTP_MAX_TRAILER_LEN + 10; - /* Update source caps if asked */ if (do_setcaps) { GstCaps *caps; @@ -956,7 +954,15 @@ gst_srtp_enc_chain (GstPad * pad, GstObject * parent, GstBuffer * buf, 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 */ + size_max = gst_buffer_get_size (buf) + SRTP_MAX_TRAILER_LEN + 10; bufout = gst_buffer_new_allocate (NULL, size_max, NULL); gst_buffer_map (buf, &mapin, GST_MAP_READ); |