Commit 804e7d17 authored by Wim Taymans's avatar Wim Taymans
Browse files

gst-libs/gst/rtp/gstrtpbuffer.*: Fix fixed payload names and docs.

Original commit message from CVS:
* gst-libs/gst/rtp/gstrtpbuffer.c:
(gst_rtp_buffer_default_clock_rate):
* gst-libs/gst/rtp/gstrtpbuffer.h:
Fix fixed payload names and docs.
Added method to get the default clock rates of fixed payload types.
API: GstRTPBuffer::gst_rtp_buffer_default_clock_rate()
parent 01038e30
2007-03-29 Wim Taymans <wim@fluendo.com>
* gst-libs/gst/rtp/gstrtpbuffer.c:
(gst_rtp_buffer_default_clock_rate):
* gst-libs/gst/rtp/gstrtpbuffer.h:
Fix fixed payload names and docs.
Added method to get the default clock rates of fixed payload types.
API: GstRTPBuffer::gst_rtp_buffer_default_clock_rate()
2007-03-28 Zaheer Abbas Merali <zaheerabbas at merali dot org>
* tests/check/pipelines/.cvsignore:
......@@ -849,3 +849,55 @@ gst_rtp_buffer_get_payload (GstBuffer * buffer)
return GST_BUFFER_DATA (buffer) + GST_RTP_HEADER_LEN
+ GST_RTP_HEADER_CSRC_SIZE (buffer);
}
/**
* gst_rtp_buffer_default_clock_rate:
* @payload_type: the static payload type
*
* Get the default clock-rate for the static payload type @payload_type.
*
* Returns: the default clock rate or -1 if the payload type is not static or
* the clock-rate is undefined.
*
* Since: 0.10.13
*/
guint32
gst_rtp_buffer_default_clock_rate (guint8 payload_type)
{
switch (payload_type) {
case GST_RTP_PAYLOAD_PCMU:
case GST_RTP_PAYLOAD_GSM:
case GST_RTP_PAYLOAD_G723:
case GST_RTP_PAYLOAD_DVI4_8000:
case GST_RTP_PAYLOAD_LPC:
case GST_RTP_PAYLOAD_PCMA:
case GST_RTP_PAYLOAD_G722:
case GST_RTP_PAYLOAD_G729:
case GST_RTP_PAYLOAD_QCELP:
case GST_RTP_PAYLOAD_CN:
case GST_RTP_PAYLOAD_G728:
return 8000;
case GST_RTP_PAYLOAD_DVI4_11025:
return 11025;
case GST_RTP_PAYLOAD_DVI4_16000:
return 16000;
case GST_RTP_PAYLOAD_DVI4_22050:
return 22050;
case GST_RTP_PAYLOAD_L16_STEREO:
case GST_RTP_PAYLOAD_L16_MONO:
return 44100;
case GST_RTP_PAYLOAD_MPA:
case GST_RTP_PAYLOAD_CELLB:
case GST_RTP_PAYLOAD_JPEG:
case GST_RTP_PAYLOAD_NV:
case GST_RTP_PAYLOAD_H261:
case GST_RTP_PAYLOAD_MPV:
case GST_RTP_PAYLOAD_MP2T:
case GST_RTP_PAYLOAD_H263:
return 90000;
case GST_RTP_PAYLOAD_1016:
case GST_RTP_PAYLOAD_G721:
default:
return -1;
}
}
......@@ -38,28 +38,52 @@ G_BEGIN_DECLS
/**
* GstRTPPayload:
* @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_G723_63: Not standard
* @GST_RTP_PAYLOAD_G723_53: Not standard
* @GST_RTP_PAYLOAD_TS48: Not standard
* @GST_RTP_PAYLOAD_TS41: Not standard
* @GST_RTP_PAYLOAD_G728: Not standard
* @GST_RTP_PAYLOAD_G729: Not standard
* @GST_RTP_PAYLOAD_MPV: Video MPEG 1 & 2
* @GST_RTP_PAYLOAD_H263: Video H263
* @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)
*
*
* 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
*/
typedef enum
{
/* Audio: */
GST_RTP_PAYLOAD_PCMU = 0,
GST_RTP_PAYLOAD_1016 = 1,
GST_RTP_PAYLOAD_G721 = 2,
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,
......@@ -72,18 +96,16 @@ typedef enum
GST_RTP_PAYLOAD_QCELP = 12,
GST_RTP_PAYLOAD_CN = 13,
GST_RTP_PAYLOAD_MPA = 14,
GST_RTP_PAYLOAD_G723_63 = 16,
GST_RTP_PAYLOAD_G723_53 = 17,
GST_RTP_PAYLOAD_TS48 = 18,
GST_RTP_PAYLOAD_TS41 = 19,
GST_RTP_PAYLOAD_G728 = 20,
GST_RTP_PAYLOAD_G729 = 21,
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,
/* Video: */
GST_RTP_PAYLOAD_H261 = 31,
GST_RTP_PAYLOAD_MPV = 32,
GST_RTP_PAYLOAD_MP2T = 33,
......@@ -92,6 +114,17 @@ typedef enum
/* BOTH */
} GstRTPPayload;
/* backward compatibility */
#define GST_RTP_PAYLOAD_G723_63 16
#define GST_RTP_PAYLOAD_G723_53 17
#define GST_RTP_PAYLOAD_TS48 18
#define GST_RTP_PAYLOAD_TS41 19
#define GST_RTP_PAYLOAD_G723_63_STRING "16"
#define GST_RTP_PAYLOAD_G723_53_STRING "17"
#define GST_RTP_PAYLOAD_TS48_STRING "18"
#define GST_RTP_PAYLOAD_TS41_STRING "19"
/* Defining the above as strings, to make the declaration of pad_templates
* easier. So if please keep these synchronized with the above.
*/
......@@ -110,12 +143,10 @@ typedef enum
#define GST_RTP_PAYLOAD_QCELP_STRING "12"
#define GST_RTP_PAYLOAD_CN_STRING "13"
#define GST_RTP_PAYLOAD_MPA_STRING "14"
#define GST_RTP_PAYLOAD_G723_63_STRING "16"
#define GST_RTP_PAYLOAD_G723_53_STRING "17"
#define GST_RTP_PAYLOAD_TS48_STRING "18"
#define GST_RTP_PAYLOAD_TS41_STRING "19"
#define GST_RTP_PAYLOAD_G728_STRING "20"
#define GST_RTP_PAYLOAD_G729_STRING "21"
#define GST_RTP_PAYLOAD_G728_STRING "15"
#define GST_RTP_PAYLOAD_DVI4_11025_STRING "16"
#define GST_RTP_PAYLOAD_DVI4_22050_STRING "17"
#define GST_RTP_PAYLOAD_G729_STRING "18"
#define GST_RTP_PAYLOAD_CELLB_STRING "25"
#define GST_RTP_PAYLOAD_JPEG_STRING "26"
......@@ -182,6 +213,9 @@ GstBuffer* gst_rtp_buffer_get_payload_subbuffer (GstBuffer *buffer, guint offse
guint gst_rtp_buffer_get_payload_len (GstBuffer *buffer);
gpointer gst_rtp_buffer_get_payload (GstBuffer *buffer);
/* some helpers */
guint32 gst_rtp_buffer_default_clock_rate (guint8 payload_type);
G_END_DECLS
#endif /* __GST_RTPBUFFER_H__ */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment