|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcgl.narada.matching.rtp.RtpEvent
public class RtpEvent
This RtpEvent class serializes and deserializes RtpEvent objects Here is the format of serialization: Byte 0 = either Protocol.NARADA_RTP_EVENT or Protocol.NARADA_RTP_CLIENT_EVENT byte 1 = media type Bytes 2-5 = an int, which is the source id Bytes 6-13 = an int, which is the topic number Bytes 14-end = data
| Field Summary | |
|---|---|
static byte |
AUDIO_EVENT
|
static byte |
NO_TYPE_EVENT
|
static byte |
RTCP_EVENT
|
static byte |
VIDEO_EVENT
|
| Constructor Summary | |
|---|---|
RtpEvent(byte[] rtpEventBytes)
This method constructs a new RtpEvent object from a byte array. |
|
RtpEvent(int source,
long topicNumber,
byte[] data)
construct an event with the given data given byte array only has the data. |
|
RtpEvent(int source,
long topicNumber,
byte[] buffer,
int offset,
int length)
construct an event with the given parameters the type of this event is NO_TYPE_EVENT |
|
RtpEvent(int source,
long topicNumber,
byte[] buffer,
int offset,
int length,
byte type)
construct an event with the given parameters. |
|
| Method Summary | |
|---|---|
byte[] |
getBuffer()
return the buffer array which might have both data and some other info, so it should be used with offset and length to access the real data. |
byte[] |
getBytes()
return serialized event. |
byte[] |
getBytes(byte flag)
return serialized event with the given flag. |
byte[] |
getBytesWithClientFlag()
Serializes the RtpEvent object with the Protocol.NARADA_RTP_CLIENT_EVENT as first byte |
byte[] |
getData()
returns a byte array which only has the data |
int |
getDataLength()
|
int |
getOffset()
|
int |
getSource()
|
long |
getTopic()
|
byte |
getType()
|
boolean |
isAudio()
|
static boolean |
isAudioEvent(byte[] data)
check whether the given data array has a serialized audio rtp event |
static void |
main(String[] args)
|
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final byte AUDIO_EVENT
public static final byte VIDEO_EVENT
public static final byte RTCP_EVENT
public static final byte NO_TYPE_EVENT
| Constructor Detail |
|---|
public RtpEvent(int source,
long topicNumber,
byte[] data)
public RtpEvent(int source,
long topicNumber,
byte[] buffer,
int offset,
int length)
public RtpEvent(int source,
long topicNumber,
byte[] buffer,
int offset,
int length,
byte type)
source - source idtopicNumber - topic numberbuffer - byte array.offset - the start point of the data in the buffer arraylength - the length of the data in the buffertype - the type of this eventpublic RtpEvent(byte[] rtpEventBytes)
| Method Detail |
|---|
public String toString()
toString in class Objectpublic byte getType()
public boolean isAudio()
public long getTopic()
public byte[] getBuffer()
public byte[] getData()
public int getSource()
public int getOffset()
public int getDataLength()
public byte[] getBytes()
public byte[] getBytesWithClientFlag()
public byte[] getBytes(byte flag)
public static boolean isAudioEvent(byte[] data)
public static void main(String[] args)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||