001: /*
002: * Portions Copyright 2000-2007 Sun Microsystems, Inc. All Rights
003: * Reserved. Use is subject to license terms.
004: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER
005: *
006: * This program is free software; you can redistribute it and/or
007: * modify it under the terms of the GNU General Public License version
008: * 2 only, as published by the Free Software Foundation.
009: *
010: * This program is distributed in the hope that it will be useful, but
011: * WITHOUT ANY WARRANTY; without even the implied warranty of
012: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
013: * General Public License version 2 for more details (a copy is
014: * included at /legal/license.txt).
015: *
016: * You should have received a copy of the GNU General Public License
017: * version 2 along with this work; if not, write to the Free Software
018: * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
019: * 02110-1301 USA
020: *
021: * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
022: * Clara, CA 95054 or visit www.sun.com if you need additional
023: * information or have any questions.
024: */
025: /*
026: * SdpConstants.java
027: *
028: * Created on January 10, 2002, 10:34 AM
029: */
030:
031: package gov.nist.javax.sdp;
032:
033: /**
034: * The SdpConstants class contains the RTP/AVP related constants.
035: * Please refer to IETF RFC 2327 for a description of SDP.
036: * @version 1.0
037: */
038: public interface SdpConstants {
039:
040: /**
041: * Constant used to translate between NTP time used in SDP and
042: * "native" Java time. NTP time is defined as the number of
043: * seconds relative to midnight, January 1, 1900 and Java time is
044: * measured in number of milliseconds since midnight, January
045: * 1, 1970 UTC (see System#currentTimeMillis()}).
046: * The value of this constant is 2208988800L. It can be used to
047: * convert between NTP and Java time using the following
048: * formulas:
049: * ntpTime = (javaTime/1000) + SdpConstants.NTP_CONST;
050: * javaTime = (ntpTime - SdpConstants.NTP_CONST) * 1000;
051: * The Network Time Protocol (NTP) is defined in RFC 1305.
052: */
053: public static final long NTP_CONST = 2208988800L;
054:
055: /**
056: * Reserved Payload type.
057: * An int greater than or equal to 0 and less than AVP_DEFINED_STATIC_MAX,
058: * but has not been assigned a value.
059: */
060: public static final String RESERVED = "0";
061:
062: /**
063: * Unassigned Payload type.
064: * An int greater than or equal to AVP_DEFINED_STATIC_MAX and less than
065: * AVP_DYNAMIC_MIN - currently
066: * unassigned.
067: */
068: public static final String UNASSIGNED = "35";
069:
070: /**
071: * Dynamic Payload type.
072: * Any int less than 0 or greater than or equal to AVP_DYNAMIC_MIN
073: */
074: public static final String DYNAMIC = "-35";
075:
076: /**
077: * RTP/AVP Protocol
078: */
079: public static final String RTP_AVP = "RTP/AVP";
080:
081: /**
082: * RTP mapping attribute.
083: */
084: public static final String RTPMAP = "RTPMAP";
085:
086: /**
087: * RTP mapping attribute.
088: */
089: public static final String FMTP = "FMTP";
090:
091: /**
092: * Static RTP/AVP payload type for the PCMU audio codec.
093: */
094: public static final int PCMU = 0;
095:
096: /**
097: * Static RTP/AVP payload type for the TENSIXTEEN audio codec.
098: */
099: public static final int TENSIXTEEN = 1;
100:
101: /**
102: * Static RTP/AVP payload type for the G726_32 audio codec.
103: */
104: public static final int G726_32 = 2;
105:
106: /**
107: * Static RTP/AVP payload type for the GSM audio codec.
108: */
109: public static final int GSM = 3;
110:
111: /**
112: * Static RTP/AVP payload type for the G723 audio codec.
113: */
114: public static final int G723 = 4;
115:
116: /**
117: * Static RTP/AVP payload type for the DVI4_8000 audio codec
118: */
119: public static final int DVI4_8000 = 5;
120:
121: /**
122: * Static RTP/AVP payload type for the DVI4_16000 audio codec.
123: */
124: public static final int DVI4_16000 = 6;
125:
126: /**
127: * Static RTP/AVP payload type for the LPC audio codec
128: */
129: public static final int LPC = 7;
130:
131: /**
132: * Static RTP/AVP payload type for the PCMA audio codec.
133: */
134: public static final int PCMA = 8;
135:
136: /**
137: * Static RTP/AVP payload type for the G722 audio codec.
138: */
139: public static final int G722 = 9;
140:
141: /**
142: * Static RTP/AVP payload type for the L16_2CH audio codec.
143: */
144: public static final int L16_2CH = 10;
145:
146: /**
147: * Static RTP/AVP payload type for the L16_1CH audio codec.
148: */
149: public static final int L16_1CH = 11;
150:
151: /**
152: * Static RTP/AVP payload type for QCELP audio codec
153: */
154: public static final int QCELP = 12;
155:
156: /**
157: * Static RTP/AVP payload type for the CN audio codec.
158: */
159: public static final int CN = 13;
160:
161: /**
162: * Static RTP/AVP payload type for the MPA audio codec.
163: */
164: public static final int MPA = 14;
165:
166: /**
167: * Static RTP/AVP payload type for the G728 audio codec.
168: */
169: public static final int G728 = 15;
170:
171: /**
172: * Static RTP/AVP payload type for the DVI4_11025 audio codec
173: */
174: public static final int DVI4_11025 = 16;
175:
176: /**
177: * Static RTP/AVP payload type for the DVI4_22050 audio codec.
178: */
179: public static final int DVI4_22050 = 17;
180:
181: /**
182: * Static RTP/AVP payload type for the G729 audio codec.
183: */
184: public static final int G729 = 18;
185:
186: /**
187: * Static RTP/AVP payload type for the CN audio codec.
188: */
189: public static final int CN_DEPRECATED = 19;
190:
191: /**
192: * Static RTP/AVP payload type for the CELB video codec.
193: */
194: public static final int CELB = 25;
195:
196: /**
197: * Static RTP/AVP payload type for the JPEG video codec.
198: */
199: public static final int JPEG = 26;
200:
201: /**
202: * Static RTP/AVP payload type for the NV video codec
203: */
204: public static final int NV = 28;
205:
206: /**
207: * Static RTP/AVP payload type for the H261 video codec.
208: */
209: public static final int H261 = 31;
210:
211: /**
212: * Static RTP/AVP payload type for the MPV video codec.
213: */
214: public static final int MPV = 32;
215:
216: /**
217: * Static RTP/AVP payload type for the MP2T video codec.
218: */
219: public static final int MP2T = 33;
220:
221: /**
222: * Static RTP/AVP payload type for the H263 video codec.
223: */
224: public static final int H263 = 20;
225:
226: /**
227: * Highest defined static payload type. This is (currently) 35.
228: */
229: public static final int AVP_DEFINED_STATIC_MAX = 35;
230:
231: /**
232: * The minimum defined dynamic format value
233: */
234: public static final int AVP_DYNAMIC_MIN = -35;
235:
236: /**
237: * Names of AVP (Audio-Video Profile) payload types indexed on their static
238: * payload types.
239: */
240: public static final String[] avpTypeNames = { "PCMU", "1016",
241: "G721", "GSM", "G723", "DVI4_8000", "DVI4_16000", "LPC",
242: "PCMA", "G722", "L16_2CH", "L16_1CH", "QCELP", "CN", "MPA",
243: "G728", "DVI4_11025", "DVI4_22050", "G729",
244: "CN_DEPRECATED", "H263", "UNASSIGNED", "UNASSIGNED",
245: "UNASSIGNED", "UNASSIGNED", "CelB", "JPEG", "UNASSIGNED",
246: "nv", "UNASSIGNED", "UNASSIGNED", "H261", "MPV", "MP2T", };
247:
248: /**
249: * Clock rates for various AVP payload types indexed by their static payload
250: * types.
251: */
252: public static final int[] avpClockRates = { 8000, 8000, 8000, 8000,
253: 8000, 8000, 16000, 8000, 8000, 8000, 44100, 44100, -1, -1,
254: 90000, 8000, -1, -1, -1, -1, -1, -1, -1, -1, -1, 90000,
255: 90000, -1, 90000, -1, -1, 90000, 90000, 90000, };
256:
257: /**
258: * Channels per static type.
259: */
260: public static final int[] avpChannels = { 1, 1, 1, 1, 1, 1, 1, 1,
261: 1, 1, 2, 1, -1, -1, 1, 1, -1, -1, -1, -1, -1, -1, -1, -1,
262: -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, };
263: }
|