gstrtppayloads

gstrtppayloads — Helper methods for dealing with RTP payloads

Synopsis


#include <gst/rtp/gstrtppayload.h>

enum                GstRTPPayload;
#define             GST_RTP_PAYLOAD_IS_DYNAMIC          (pt)
                    GstRTPPayloadInfo;
const GstRTPPayloadInfo* gst_rtp_payload_info_for_name  (const gchar *media,
                                                         const gchar *encoding_name);
const GstRTPPayloadInfo* gst_rtp_payload_info_for_pt    (guint8 payload_type);

Description

The GstRTPPayloads helper functions makes it easy to deal with static and dynamic payloads. Its main purpose is to retrieve properties such as the default clock-rate and get session bandwidth information.

Last reviewed on 2007-10-01 (0.10.15)

Details

enum GstRTPPayload

typedef enum
{
  /* Audio: */
  GST_RTP_PAYLOAD_PCMU = 0,
  GST_RTP_PAYLOAD_1016 = 1, /* RFC 3551 says reserved */
  GST_RTP_PAYLOAD_G721 = 2, /* RFC 3551 says reserved */
  GST_RTP_PAYLOAD_GSM = 3,
  GST_RTP_PAYLOAD_G723 = 4,
  GST_RTP_PAYLOAD_DVI4_8000 = 5,
  GST_RTP_PAYLOAD_DVI4_16000 = 6,
  GST_RTP_PAYLOAD_LPC = 7,
  GST_RTP_PAYLOAD_PCMA = 8,
  GST_RTP_PAYLOAD_G722 = 9,
  GST_RTP_PAYLOAD_L16_STEREO = 10,
  GST_RTP_PAYLOAD_L16_MONO = 11,
  GST_RTP_PAYLOAD_QCELP = 12,
  GST_RTP_PAYLOAD_CN = 13,
  GST_RTP_PAYLOAD_MPA = 14,
  GST_RTP_PAYLOAD_G728 = 15,
  GST_RTP_PAYLOAD_DVI4_11025 = 16,
  GST_RTP_PAYLOAD_DVI4_22050 = 17,
  GST_RTP_PAYLOAD_G729 = 18,   

  /* Video: */

  GST_RTP_PAYLOAD_CELLB = 25,
  GST_RTP_PAYLOAD_JPEG = 26,
  GST_RTP_PAYLOAD_NV = 28,
  GST_RTP_PAYLOAD_H261 = 31,
  GST_RTP_PAYLOAD_MPV = 32,
  GST_RTP_PAYLOAD_MP2T = 33,
  GST_RTP_PAYLOAD_H263 = 34,

  /* BOTH */
} GstRTPPayload;

Standard predefined fixed payload types.

The official list is at: http://www.iana.org/assignments/rtp-parameters

Audio: reserved: 19 unassigned: 20-23,

Video: unassigned: 24, 27, 29, 30, 35-71, 77-95 Reserved for RTCP conflict avoidance: 72-76

GST_RTP_PAYLOAD_PCMU ITU-T G.711. mu-law audio (RFC 3551)
GST_RTP_PAYLOAD_1016 RFC 3551 says reserved
GST_RTP_PAYLOAD_G721 RFC 3551 says reserved
GST_RTP_PAYLOAD_GSM GSM audio
GST_RTP_PAYLOAD_G723 ITU G.723.1 audio
GST_RTP_PAYLOAD_DVI4_8000 IMA ADPCM wave type (RFC 3551)
GST_RTP_PAYLOAD_DVI4_16000 IMA ADPCM wave type (RFC 3551)
GST_RTP_PAYLOAD_LPC experimental linear predictive encoding
GST_RTP_PAYLOAD_PCMA ITU-T G.711 A-law audio (RFC 3551)
GST_RTP_PAYLOAD_G722 ITU-T G.722 (RFC 3551)
GST_RTP_PAYLOAD_L16_STEREO stereo PCM
GST_RTP_PAYLOAD_L16_MONO mono PCM
GST_RTP_PAYLOAD_QCELP EIA & TIA standard IS-733
GST_RTP_PAYLOAD_CN Comfort Noise (RFC 3389)
GST_RTP_PAYLOAD_MPA Audio MPEG 1-3.
GST_RTP_PAYLOAD_G728 ITU-T G.728 Speech coder (RFC 3551)
GST_RTP_PAYLOAD_DVI4_11025 IMA ADPCM wave type (RFC 3551)
GST_RTP_PAYLOAD_DVI4_22050 IMA ADPCM wave type (RFC 3551)
GST_RTP_PAYLOAD_G729 ITU-T G.729 Speech coder (RFC 3551)
GST_RTP_PAYLOAD_CELLB See RFC 2029
GST_RTP_PAYLOAD_JPEG ISO Standards 10918-1 and 10918-2 (RFC 2435)
GST_RTP_PAYLOAD_NV nv encoding by Ron Frederick
GST_RTP_PAYLOAD_H261 ITU-T Recommendation H.261 (RFC 2032)
GST_RTP_PAYLOAD_MPV Video MPEG 1 & 2 (RFC 2250)
GST_RTP_PAYLOAD_MP2T MPEG-2 transport stream (RFC 2250)
GST_RTP_PAYLOAD_H263 Video H263 (RFC 2190)

GST_RTP_PAYLOAD_IS_DYNAMIC()

#define GST_RTP_PAYLOAD_IS_DYNAMIC(pt) ((pt) >= 96 && (pt) <= 127)

Check if pt is a dynamic payload type.

pt : a payload type

GstRTPPayloadInfo

typedef struct {
  guint8       payload_type;
  const gchar *media;
  const gchar *encoding_name;
  guint        clock_rate;
  const gchar *encoding_parameters;
  guint        bitrate;
} GstRTPPayloadInfo;

Structure holding default payload type information.

guint8 payload_type; payload type, -1 means dynamic
const gchar *media; the media type(s), usually "audio", "video", "application", "text", "message".
const gchar *encoding_name; the encoding name of pt
guint clock_rate; default clock rate, 0 = unknown/variable
const gchar *encoding_parameters; encoding parameters. For audio this is the number of channels. NULL = not applicable.
guint bitrate; the bitrate of the media. 0 = unknown/variable.

gst_rtp_payload_info_for_name ()

const GstRTPPayloadInfo* gst_rtp_payload_info_for_name  (const gchar *media,
                                                         const gchar *encoding_name);

Get the GstRTPPayloadInfo for media and encoding_name. This function is mostly used to get the default clock-rate and bandwidth for dynamic payload types specified with media and encoding name.

The search for encoding_name will be performed in a case insensitve way.

media : the media to find
encoding_name : the encoding name to find
Returns : a GstRTPPayloadInfo or NULL when no info could be found.

gst_rtp_payload_info_for_pt ()

const GstRTPPayloadInfo* gst_rtp_payload_info_for_pt    (guint8 payload_type);

Get the GstRTPPayloadInfo for payload_type. This function is mostly used to get the default clock-rate and bandwidth for static payload types specified with payload_type.

payload_type : the payload_type to find
Returns : a GstRTPPayloadInfo or NULL when no info could be found.

See Also

gstrtpbuffer