gstreamer/subprojects/gst-plugins-base/gst-libs/gst/rtp
Sebastian Dröge 4df3da3bab rtpbuffer: Initialize extended timestamp to the first wraparound period
This allows correct handling of wrapping around backwards during the
first wraparound period and avoids the infamous "Cannot unwrap, any
wrapping took place yet" error message.

It allows makes sure that for actual timestamp jumps a valid value is
returned instead of 0, which then allows the caller to handle it
properly. Not having this can have the caller see the same timestamp (0)
for a very long time, which for example can cause rtpjitterbuffer to
output the same timestamp for a very long time.

Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/1500

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3202>
2022-10-18 06:09:08 +00:00
..
gstrtcpbuffer.c rtcpbuffer: Allow padding on first reduced size packets 2022-05-18 14:34:44 +00:00
gstrtcpbuffer.h rtcpbuffer: Allow padding on first reduced size packets 2022-05-18 14:34:44 +00:00
gstrtpbaseaudiopayload.c Move files from gst-plugins-base into the "subprojects/gst-plugins-base/" subdir 2021-09-24 16:13:26 -03:00
gstrtpbaseaudiopayload.h Move files from gst-plugins-base into the "subprojects/gst-plugins-base/" subdir 2021-09-24 16:13:26 -03:00
gstrtpbasedepayload.c Move files from gst-plugins-base into the "subprojects/gst-plugins-base/" subdir 2021-09-24 16:13:26 -03:00
gstrtpbasedepayload.h Move files from gst-plugins-base into the "subprojects/gst-plugins-base/" subdir 2021-09-24 16:13:26 -03:00
gstrtpbasepayload.c rtpbasepayload: always store input buffer meta before negotiation 2022-04-27 08:43:30 +00:00
gstrtpbasepayload.h Move files from gst-plugins-base into the "subprojects/gst-plugins-base/" subdir 2021-09-24 16:13:26 -03:00
gstrtpbuffer.c rtpbuffer: Initialize extended timestamp to the first wraparound period 2022-10-18 06:09:08 +00:00
gstrtpbuffer.h Move files from gst-plugins-base into the "subprojects/gst-plugins-base/" subdir 2021-09-24 16:13:26 -03:00
gstrtpdefs.h Move files from gst-plugins-base into the "subprojects/gst-plugins-base/" subdir 2021-09-24 16:13:26 -03:00
gstrtphdrext.c rtphdrext: Return non-floating references from gst_rtp_header_extension_create_from_uri() 2022-01-27 14:43:41 +00:00
gstrtphdrext.h rtphdrext: increase GstRTPHeaderExtensionClass padding to LARGE 2022-01-19 05:41:40 +00:00
gstrtpmeta.c Move files from gst-plugins-base into the "subprojects/gst-plugins-base/" subdir 2021-09-24 16:13:26 -03:00
gstrtpmeta.h Move files from gst-plugins-base into the "subprojects/gst-plugins-base/" subdir 2021-09-24 16:13:26 -03:00
gstrtppayloads.c Move files from gst-plugins-base into the "subprojects/gst-plugins-base/" subdir 2021-09-24 16:13:26 -03:00
gstrtppayloads.h Move files from gst-plugins-base into the "subprojects/gst-plugins-base/" subdir 2021-09-24 16:13:26 -03:00
meson.build meson: Namespace the plugins_doc_dep/libraries variables 2022-09-01 21:17:35 +00:00
README Move files from gst-plugins-base into the "subprojects/gst-plugins-base/" subdir 2021-09-24 16:13:26 -03:00
rtp-prelude.h Move files from gst-plugins-base into the "subprojects/gst-plugins-base/" subdir 2021-09-24 16:13:26 -03:00
rtp.h Move files from gst-plugins-base into the "subprojects/gst-plugins-base/" subdir 2021-09-24 16:13:26 -03: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 retrieve 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-1.0 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-1.0 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-1.0 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.