001: /*
002: * SdpConstants.java
003: *
004: * Created on January 10, 2002, 10:34 AM
005: */
006:
007: package javax.sdp;
008:
009: /** The SdpConstants class contains the RTP/AVP related constants.
010: * Please refer to IETF RFC 2327 for a description of SDP.
011: * @author deruelle
012: * @version 1.0
013: */
014: public interface SdpConstants {
015:
016: /** Constant used to translate between NTP time used in SDP and "native" Java
017: * time. NTP time is defined as the number of
018: * seconds relative to midnight, January 1, 1900 and Java time is measured in
019: * number of milliseconds since midnight, January
020: * 1, 1970 UTC (see System#currentTimeMillis()}).
021: * The value of this constant is 2208988800L. It can be used to convert between
022: * NTP and Java time using the following
023: * formulas:
024: * ntpTime = (javaTime/1000) + SdpConstants.NTP_CONST;
025: * javaTime = (ntpTime - SdpConstants.NTP_CONST) * 1000;
026: * The Network Time Protocol (NTP) is defined in RFC 1305.
027: */
028: public static final long NTP_CONST = 2208988800L;
029:
030: /** Reserved Payload type.
031: * An int greater than or equal to 0 and less than AVP_DEFINED_STATIC_MAX,
032: * but has not been assigned a value.
033: */
034: public static final String RESERVED = "0";
035:
036: /** Unassigned Payload type.
037: * An int greater than or equal to AVP_DEFINED_STATIC_MAX and less than
038: * AVP_DYNAMIC_MIN - currently
039: * unassigned.
040: */
041: public static final String UNASSIGNED = "35";
042:
043: /** Dynamic Payload type.
044: * Any int less than 0 or greater than or equal to AVP_DYNAMIC_MIN
045: */
046: public static final String DYNAMIC = "-35";
047:
048: /** RTP/AVP Protocol
049: */
050: public static final String RTP_AVP = "RTP/AVP";
051:
052: /** RTP mapping attribute.
053: *
054: * SDP is case-sensitive; RFC2327 specifies 'rtpmap' (all smallcap)
055: */
056: public static final String RTPMAP = "rtpmap";
057:
058: /** RTP mapping attribute.
059: */
060: public static final String FMTP = "FMTP";
061:
062: /** Static RTP/AVP payload type for the PCMU audio codec.
063: */
064: public static final int PCMU = 0;
065:
066: /** Static RTP/AVP payload type for the TENSIXTEEN audio codec.
067: */
068: public static final int TENSIXTEEN = 1;
069:
070: /** Static RTP/AVP payload type for the G726_32 audio codec.
071: */
072: public static final int G726_32 = 2;
073:
074: /** Static RTP/AVP payload type for the GSM audio codec.
075: */
076: public static final int GSM = 3;
077:
078: /** Static RTP/AVP payload type for the G723 audio codec.
079: */
080: public static final int G723 = 4;
081:
082: /** Static RTP/AVP payload type for the DVI4_8000 audio codec
083: */
084: public static final int DVI4_8000 = 5;
085:
086: /** Static RTP/AVP payload type for the DVI4_16000 audio codec.
087: */
088: public static final int DVI4_16000 = 6;
089:
090: /** Static RTP/AVP payload type for the LPC audio codec
091: */
092: public static final int LPC = 7;
093:
094: /** Static RTP/AVP payload type for the PCMA audio codec.
095: */
096: public static final int PCMA = 8;
097:
098: /** Static RTP/AVP payload type for the G722 audio codec.
099: */
100: public static final int G722 = 9;
101:
102: /** Static RTP/AVP payload type for the L16_2CH audio codec.
103: */
104: public static final int L16_2CH = 10;
105:
106: /** Static RTP/AVP payload type for the L16_1CH audio codec.
107: */
108: public static final int L16_1CH = 11;
109:
110: /** Static RTP/AVP payload type for QCELP audio codec
111: */
112: public static final int QCELP = 12;
113:
114: /** Static RTP/AVP payload type for the CN audio codec.
115: */
116: public static final int CN = 13;
117:
118: /** Static RTP/AVP payload type for the MPA audio codec.
119: */
120: public static final int MPA = 14;
121:
122: /** Static RTP/AVP payload type for the G728 audio codec.
123: */
124: public static final int G728 = 15;
125:
126: /** Static RTP/AVP payload type for the DVI4_11025 audio codec
127: */
128: public static final int DVI4_11025 = 16;
129:
130: /** Static RTP/AVP payload type for the DVI4_22050 audio codec.
131: */
132: public static final int DVI4_22050 = 17;
133:
134: /** Static RTP/AVP payload type for the G729 audio codec.
135: */
136: public static final int G729 = 18;
137:
138: /** Static RTP/AVP payload type for the CN audio codec.
139: */
140: public static final int CN_DEPRECATED = 19;
141:
142: /** Static RTP/AVP payload type for the CELB video codec.
143: */
144: public static final int CELB = 25;
145:
146: /** Static RTP/AVP payload type for the JPEG video codec.
147: */
148: public static final int JPEG = 26;
149:
150: /** Static RTP/AVP payload type for the NV video codec
151: */
152: public static final int NV = 28;
153:
154: /** Static RTP/AVP payload type for the H261 video codec.
155: */
156: public static final int H261 = 31;
157:
158: /** Static RTP/AVP payload type for the MPV video codec.
159: */
160: public static final int MPV = 32;
161:
162: /** Static RTP/AVP payload type for the MP2T video codec.
163: */
164: public static final int MP2T = 33;
165:
166: /** Static RTP/AVP payload type for the H263 video codec.
167: */
168: public static final int H263 = 34;
169:
170: /** Highest defined static payload type. This is (currently) 35.
171: */
172: public static final int AVP_DEFINED_STATIC_MAX = 35;
173:
174: /** The minimum defined dynamic format value
175: */
176: public static final int AVP_DYNAMIC_MIN = -35;
177:
178: /** Names of AVP (Audio-Video Profile) payload types indexed on their static
179: * payload types.
180: */
181: public static final String[] avpTypeNames = { "PCMU", "1016",
182: "G721", "GSM", "G723", "DVI4_8000", "DVI4_16000", "LPC",
183: "PCMA", "G722", "L16_2CH", "L16_1CH", "QCELP", "CN", "MPA",
184: "G728", "DVI4_11025", "DVI4_22050",
185: "G729",
186: "CN_DEPRECATED",
187: //"H263",
188: "UNASSIGNED", "UNASSIGNED", "UNASSIGNED", "UNASSIGNED",
189: "UNASSIGNED", "CelB", "JPEG", "UNASSIGNED", "nv",
190: "UNASSIGNED", "UNASSIGNED", "H261", "MPV", "MP2T", "H263", };
191:
192: /** Clock rates for various AVP payload types indexed by their static payload
193: * types.
194: */
195: public static final int[] avpClockRates = { 8000, 8000, 8000, 8000,
196: 8000, 8000, 16000, 8000, 8000, 8000, 44100, 44100, -1, -1,
197: 90000, 8000, -1, -1, -1, -1, -1, -1, -1, -1, -1, 90000,
198: 90000, -1, 90000, -1, -1, 90000, 90000, 90000, -1 };
199:
200: /** Channels per static type.
201: */
202: public static final int[] avpChannels = { 1, 1, 1, 1, 1, 1, 1, 1,
203: 1, 1, 2, 1, -1, -1, 1, 1, -1, -1, -1, -1, -1, -1, -1, -1,
204: -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, };
205: }
|