|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectde.humatic.dsj.src.rtp.RTPHandler
public class RTPHandler
Base class for mediatype specific RTP depacketizers and packetizers. RTPHandlers are setup by an RTPChannel and do both take care of
initially configuring mediatypes as well as stripping any unnecessary rtp related headers from the bitstream during
playback when in input mode or splitting up media samples into rtp packets when in output mode.
Applications can provide their own RTPHandlers to either replace dsj internal implementations or to support more formats
by extending this class and linking their implementation with a specific media type, see setHandlerForType(...).
All methods in this base class are public for that purpose and should otherwise not be called by application code.
RTPHandler implementations were public in dsj 0_8_5 despite the classes not really having methods to be used by application
code. In an attempt to clean up the api dsj 0_8_6 makes the internal implementations package-private, which does not change anything about
the functionality. Here is a listing of the available handlers and the underlying RFCs:
AAC / MPEG4-generic: Payload (de)packetizer according to RFC 3640.
Supports interleaved AccessUnits.
ADPCM: RTPHandler / decoder for some 4 and 8 bit ulaw/alaw/adpcm audio encodings. This supports audio payload types
0 (PCMU, ulaw), 8 (PCMA, alaw) and 5, 6, 16 and 17 (DVI4), supports packetizing for ulaw and alaw.
AMR: Basic implementation of a payload (de)packetizer according to RFC 3267.
This currently only supports octet-aligned, non-interleaved payloads.
GSM: handler for input data according to RFC 3551.
This is not really a depacketizer, but rather transforms RTP packaged GSM frames into the format expected by Windows' GSM 6.10 codec. New in dsj 0_8_6.
G726: Depacketizer for input data according to RFC 3551. (Note that the most prominent ACM G726 decoder - Sharp G726 audio codec - prefers G726-32 (4bit))
H263: Depacketizer for payload types as specified in RFC4629.
H264: (De)packetizer for payload types as specified in RFC3984.
JPEG: Depacketizer for payload types as specified in RFC2035.
MP4V: Elementary stream RTP (de)packetizer for payload types as specified in RFC 3016.
MP4A: Elementary stream (de)packetizer for audio payload types as specified in RFC2250.
MPEG1: Depacketizer for video payload types as specified in RFC2250.
MPA: (De)packetizer for audio payload types as specified in RFC2250.
MP2T: Depacketizer for transport streams via rtp as described in RFC2250.
Quicktime: Depacketizer for generic payload types as specified in 'Letters from the icefloe', dispatch026.
(Only those implementations marked as "(de)packetizer" are available for streaming out!)
| Constructor Summary | |
|---|---|
RTPHandler(DSMediaType mt,
RTPChannel owner)
When extending RTPHandler you must override this constructor. |
|
| Method Summary | |
|---|---|
int |
checkForHeader(byte[] stack,
int readPos)
In input mode called from RTPChannel during normal read operation. |
static RTPHandler |
forMediaType(DSMediaType mt,
RTPChannel owner)
Returns the mediatype specific handler implementation. |
java.lang.String |
getMIMEType()
|
boolean |
handlePacket(byte[] data,
int dataOffset,
int dataLength,
int seqNumber,
int rtpTimeStamp,
int flags)
Main packet handling method (input mode) called from the RTPChannel after a sample has been completely received. |
byte[][] |
handleSample(SampleBuffer sb,
int headerLength)
Sample packetizing method (output mode), called from RTSPSink with full video or audio samples. |
void |
newPacket(int readPos)
In input mode called from RTPChannel on the start of a new sample fragment. |
void |
notifyStreamEvent(int event,
int param)
Called by RTPChannel, currently only used with seeking. |
boolean |
prescan(byte[] data,
int dataLength)
In input mode called during setup, returns true when enough information has been collected to validate the media type passed in on constructiuon. |
static void |
setHandlerForType(DSMediaType mediaType,
java.lang.String fullyQualifiedClassName)
Allows to set a preferred RTPHandler for the given media type. |
void |
setSDPCodecInfo(java.lang.String info)
Passes the (eventually base64 encoded) extra info, that some payload types require to the handler. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public RTPHandler(DSMediaType mt,
RTPChannel owner)
| Method Detail |
|---|
public static RTPHandler forMediaType(DSMediaType mt,
RTPChannel owner)
throws DSJException
DSJException
public static void setHandlerForType(DSMediaType mediaType,
java.lang.String fullyQualifiedClassName)
public java.lang.String getMIMEType()
public void setSDPCodecInfo(java.lang.String info)
public void notifyStreamEvent(int event,
int param)
public void newPacket(int readPos)
public int checkForHeader(byte[] stack,
int readPos)
public boolean prescan(byte[] data,
int dataLength)
public boolean handlePacket(byte[] data,
int dataOffset,
int dataLength,
int seqNumber,
int rtpTimeStamp,
int flags)
public byte[][] handleSample(SampleBuffer sb,
int headerLength)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||