Blame gst-libs/gst/rtp/README

Packit 971217
The RTP libraries
Packit 971217
---------------------
Packit 971217
Packit 971217
  RTP Buffers
Packit 971217
  -----------
Packit 971217
  The real time protocol as described in RFC 3550 requires the use of special
Packit 971217
  packets containing an additional RTP header of at least 12 bytes. GStreamer
Packit 971217
  provides some helper functions for creating and parsing these RTP headers.
Packit 971217
  The result is a normal #GstBuffer with an additional RTP header.
Packit 971217
 
Packit 971217
  RTP buffers are usually created with gst_rtp_buffer_new_allocate() or
Packit 971217
  gst_rtp_buffer_new_allocate_len(). These functions create buffers with a
Packit 971217
  preallocated space of memory. It will also ensure that enough memory
Packit 971217
  is allocated for the RTP header. The first function is used when the payload
Packit 971217
  size is known. gst_rtp_buffer_new_allocate_len() should be used when the size
Packit 971217
  of the whole RTP buffer (RTP header + payload) is known.
Packit 971217
 
Packit 971217
  When receiving RTP buffers from a network, gst_rtp_buffer_new_take_data()
Packit 971217
  should be used when the user would like to parse that RTP packet. (TODO Ask
Packit 971217
  Wim what the real purpose of this function is as it seems to simply create a
Packit 971217
  duplicate GstBuffer with the same data as the previous one). The
Packit 971217
  function will create a new RTP buffer with the given data as the whole RTP
Packit 971217
  packet. Alternatively, gst_rtp_buffer_new_copy_data() can be used if the user
Packit 971217
  wishes to make a copy of the data before using it in the new RTP buffer.
Packit 971217
 
Packit 971217
  It is now possible to use all the gst_rtp_buffer_get_*() or
Packit 971217
  gst_rtp_buffer_set_*() functions to read or write the different parts of the
Packit 971217
  RTP header such as the payload type, the sequence number or the RTP
Packit 971217
  timestamp. The use can also retreive a pointer to the actual RTP payload data
Packit 971217
  using the gst_rtp_buffer_get_payload() function.
Packit 971217
Packit 971217
  RTP Base Payloader Class (GstBaseRTPPayload)
Packit 971217
  --------------------------------------------
Packit 971217
Packit 971217
  All RTP payloader elements (audio or video) should derive from this class.
Packit 971217
Packit 971217
  RTP Base Audio Payloader Class (GstBaseRTPAudioPayload)
Packit 971217
  -------------------------------------------------------
Packit 971217
Packit 971217
  This base class can be tested through it's children classes. Here is an
Packit 971217
  example using the iLBC payloader (frame based).
Packit 971217
Packit 971217
  For 20ms mode :
Packit 971217
Packit 971217
  GST_DEBUG="basertpaudiopayload:5" gst-launch-0.10 fakesrc sizetype=2
Packit 971217
  sizemax=114 datarate=1900 ! audio/x-iLBC, mode=20 !  rtpilbcpay
Packit 971217
  max-ptime="40000000" ! fakesink
Packit 971217
Packit 971217
  For 30ms mode :
Packit 971217
Packit 971217
  GST_DEBUG="basertpaudiopayload:5" gst-launch-0.10 fakesrc sizetype=2
Packit 971217
  sizemax=150 datarate=1662 ! audio/x-iLBC, mode=30 !  rtpilbcpay
Packit 971217
  max-ptime="60000000" ! fakesink
Packit 971217
Packit 971217
  Here is an example using the uLaw payloader (sample based).
Packit 971217
Packit 971217
  GST_DEBUG="basertpaudiopayload:5" gst-launch-0.10 fakesrc sizetype=2
Packit 971217
  sizemax=150 datarate=8000 ! audio/x-mulaw ! rtppcmupay max-ptime="6000000" !
Packit 971217
  fakesink
Packit 971217
Packit 971217
  RTP Base Depayloader Class (GstBaseRTPDepayload)
Packit 971217
  ------------------------------------------------
Packit 971217
Packit 971217
  All RTP depayloader elements (audio or video) should derive from this class.