gstreamer/gst-libs/gst/rtp
Miguel Paris 036bdf5d2d rtpbuffer: Fix ensure_buffers() if whole packet is in one GstMemory
When gst_rtp_buffer_add_extension_onebyte_header() is used over a
GstRtpBuffer that only contains a memory for the whole packet,
ensure_buffers function crashes at the next point:

mem = gst_memory_copy (rtp->map[i].memory, offset, rtp->size[i]);

when i==2 because the payload is not mapped.

In addition the offset is calculated subtracting in the wrong direction.

https://bugzilla.gnome.org/show_bug.cgi?id=774959
2016-11-25 13:15:24 +02:00
..
gstrtcpbuffer.c rtp: rtcpbuffer: fix indentation 2016-03-30 22:41:54 +01:00
gstrtcpbuffer.h rtcpbuffer: Add API for APP packets 2016-03-24 14:24:11 +02:00
gstrtpbaseaudiopayload.c rtpbaseaudiopayload: Copy metadata in the (de)payloader, but only the relevant ones 2015-08-11 12:46:36 +02:00
gstrtpbaseaudiopayload.h base: Add g_autoptr() support to all types 2015-12-14 13:39:43 -05:00
gstrtpbasedepayload.c rtpbasedepayload: Reject non-TIME segments 2016-11-01 21:09:13 +02:00
gstrtpbasedepayload.h base: Add g_autoptr() support to all types 2015-12-14 13:39:43 -05:00
gstrtpbasepayload.c rtpbasepayload: Ensure to set the RECONFIGURE flag again if reconfiguration failed 2016-11-18 12:04:27 +02:00
gstrtpbasepayload.h base: Add g_autoptr() support to all types 2015-12-14 13:39:43 -05:00
gstrtpbuffer.c rtpbuffer: Fix ensure_buffers() if whole packet is in one GstMemory 2016-11-25 13:15:24 +02:00
gstrtpbuffer.h rtpbuffer: Add buffer flag RETRANSMISSION 2016-09-01 13:05:47 +03:00
gstrtpdefs.h rtp: Add GstRTPProfile enum 2015-05-20 15:41:06 +03:00
gstrtphdrext.c doc: Fix gsttrtphdrext section name 2015-06-18 21:03:15 -04:00
gstrtphdrext.h rtp: add helpers for header extensions 2012-11-06 09:18:54 +01:00
gstrtppayloads.c docs: remove outdated and pointless 'Last reviewed' lines from docs 2014-04-26 23:28:57 +01:00
gstrtppayloads.h Fix FSF address 2012-11-03 23:05:09 +00:00
Makefile.am g-i: pass compiler env to g-ir-scanner 2016-05-24 00:44:21 +01:00
meson.build meson: Generate girs 2016-11-09 18:06:19 -03:00
README rtp: Add support for multiple memory blocks in RTP 2012-07-17 16:41:36 +02:00
rtp.h rtp: Add GstRTPProfile enum 2015-05-20 15:41:06 +03:00
rtp_mkenum.py Add support for Meson as alternative/parallel build system 2016-08-20 11:09:51 +01:00

The RTP libraries
---------------------

  RTP Buffers
  -----------
  The real time protocol as described in RFC 3550 requires the use of special
  packets containing an additional RTP header of at least 12 bytes. GStreamer
  provides some helper functions for creating and parsing these RTP headers.
  The result is a normal #GstBuffer with an additional RTP header.
 
  RTP buffers are usually created with gst_rtp_buffer_new_allocate() or
  gst_rtp_buffer_new_allocate_len(). These functions create buffers with a
  preallocated space of memory. It will also ensure that enough memory
  is allocated for the RTP header. The first function is used when the payload
  size is known. gst_rtp_buffer_new_allocate_len() should be used when the size
  of the whole RTP buffer (RTP header + payload) is known.
 
  When receiving RTP buffers from a network, gst_rtp_buffer_new_take_data()
  should be used when the user would like to parse that RTP packet. (TODO Ask
  Wim what the real purpose of this function is as it seems to simply create a
  duplicate GstBuffer with the same data as the previous one). The
  function will create a new RTP buffer with the given data as the whole RTP
  packet. Alternatively, gst_rtp_buffer_new_copy_data() can be used if the user
  wishes to make a copy of the data before using it in the new RTP buffer.
 
  It is now possible to use all the gst_rtp_buffer_get_*() or
  gst_rtp_buffer_set_*() functions to read or write the different parts of the
  RTP header such as the payload type, the sequence number or the RTP
  timestamp. The use can also retreive a pointer to the actual RTP payload data
  using the gst_rtp_buffer_get_payload() function.

  RTP Base Payloader Class (GstBaseRTPPayload)
  --------------------------------------------

  All RTP payloader elements (audio or video) should derive from this class.

  RTP Base Audio Payloader Class (GstBaseRTPAudioPayload)
  -------------------------------------------------------

  This base class can be tested through it's children classes. Here is an
  example using the iLBC payloader (frame based).

  For 20ms mode :

  GST_DEBUG="basertpaudiopayload:5" gst-launch-0.10 fakesrc sizetype=2
  sizemax=114 datarate=1900 ! audio/x-iLBC, mode=20 !  rtpilbcpay
  max-ptime="40000000" ! fakesink

  For 30ms mode :

  GST_DEBUG="basertpaudiopayload:5" gst-launch-0.10 fakesrc sizetype=2
  sizemax=150 datarate=1662 ! audio/x-iLBC, mode=30 !  rtpilbcpay
  max-ptime="60000000" ! fakesink

  Here is an example using the uLaw payloader (sample based).

  GST_DEBUG="basertpaudiopayload:5" gst-launch-0.10 fakesrc sizetype=2
  sizemax=150 datarate=8000 ! audio/x-mulaw ! rtppcmupay max-ptime="6000000" !
  fakesink

  RTP Base Depayloader Class (GstBaseRTPDepayload)
  ------------------------------------------------

  All RTP depayloader elements (audio or video) should derive from this class.