org.mobicents.media
Class Buffer

java.lang.Object
  extended by org.mobicents.media.Buffer
All Implemented Interfaces:
java.io.Serializable

public class Buffer
extends java.lang.Object
implements java.io.Serializable

Standard JMF class -- see this class in the JMF Javadoc. Coding complete. An observation on the use of Buffer in JMF: it appears that a Buffer is not considered to be immutable as it is processed (by a Codec, etc). JMF will do things like swap the data of two Buffers, or when input is not consumed, update the offset and length. The result of this is that care needs to be taken in implementation code to clone buffers if a buffer is to be used for multiple things (like in a cloned DataSource).

Author:
Ken Larson
See Also:
Serialized Form

Field Summary
static int FLAG_BUF_OVERFLOWN
           
static int FLAG_BUF_UNDERFLOWN
           
static int FLAG_DISCARD
           
static int FLAG_EOM
           
static int FLAG_FLUSH
           
static int FLAG_KEY_FRAME
           
static int FLAG_LIVE_DATA
           
static int FLAG_NO_DROP
           
static int FLAG_NO_SYNC
           
static int FLAG_NO_WAIT
           
static int FLAG_RELATIVE_TIME
           
static int FLAG_RTP_BINARY
           
static int FLAG_RTP_TIME
           
static int FLAG_SID
           
static int FLAG_SILENCE
           
static int FLAG_SYSTEM_MARKER
           
static int FLAG_SYSTEM_TIME
           
static long SEQUENCE_UNKNOWN
           
static long TIME_UNKNOWN
           
 
Constructor Summary
Buffer()
           
 
Method Summary
 void addRtpPacket(byte[] data)
           
 java.lang.Object clone()
           
 void copy(Buffer buffer)
           
 void copy(Buffer buffer, boolean swapData)
           
 void dispose()
           
 byte[] getData()
           
 long getDuration()
           
 int getFlags()
           
 Format getFormat()
           
 java.lang.Object getHeader()
           
 int getLength()
           
 int getOffset()
           
 java.util.List<byte[]> getRtpPackets()
           
 long getSequenceNumber()
           
 long getTimeStamp()
           
 boolean isDiscard()
           
 boolean isEOM()
           
 void setData(byte[] data)
           
 void setDiscard(boolean discard)
           
 void setDuration(long duration)
           
 void setEOM(boolean eom)
           
 void setFactory(BufferFactory factory)
           
 void setFlags(int flags)
           
 void setFormat(Format format)
           
 void setHeader(java.lang.Object header)
           
 void setLength(int length)
           
 void setOffset(int offset)
           
 void setSequenceNumber(long number)
           
 void setTimeStamp(long timeStamp)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

FLAG_EOM

public static final int FLAG_EOM
See Also:
Constant Field Values

FLAG_DISCARD

public static final int FLAG_DISCARD
See Also:
Constant Field Values

FLAG_SILENCE

public static final int FLAG_SILENCE
See Also:
Constant Field Values

FLAG_SID

public static final int FLAG_SID
See Also:
Constant Field Values

FLAG_KEY_FRAME

public static final int FLAG_KEY_FRAME
See Also:
Constant Field Values

FLAG_NO_DROP

public static final int FLAG_NO_DROP
See Also:
Constant Field Values

FLAG_NO_WAIT

public static final int FLAG_NO_WAIT
See Also:
Constant Field Values

FLAG_NO_SYNC

public static final int FLAG_NO_SYNC
See Also:
Constant Field Values

FLAG_SYSTEM_TIME

public static final int FLAG_SYSTEM_TIME
See Also:
Constant Field Values

FLAG_RELATIVE_TIME

public static final int FLAG_RELATIVE_TIME
See Also:
Constant Field Values

FLAG_FLUSH

public static final int FLAG_FLUSH
See Also:
Constant Field Values

FLAG_SYSTEM_MARKER

public static final int FLAG_SYSTEM_MARKER
See Also:
Constant Field Values

FLAG_RTP_BINARY

public static final int FLAG_RTP_BINARY
See Also:
Constant Field Values

FLAG_RTP_TIME

public static final int FLAG_RTP_TIME
See Also:
Constant Field Values

FLAG_BUF_OVERFLOWN

public static final int FLAG_BUF_OVERFLOWN
See Also:
Constant Field Values

FLAG_BUF_UNDERFLOWN

public static final int FLAG_BUF_UNDERFLOWN
See Also:
Constant Field Values

FLAG_LIVE_DATA

public static final int FLAG_LIVE_DATA
See Also:
Constant Field Values

TIME_UNKNOWN

public static final long TIME_UNKNOWN
See Also:
Constant Field Values

SEQUENCE_UNKNOWN

public static final long SEQUENCE_UNKNOWN
See Also:
Constant Field Values
Constructor Detail

Buffer

public Buffer()
Method Detail

getRtpPackets

public java.util.List<byte[]> getRtpPackets()

addRtpPacket

public void addRtpPacket(byte[] data)

setFactory

public void setFactory(BufferFactory factory)

getFormat

public Format getFormat()

setFormat

public void setFormat(Format format)

getFlags

public int getFlags()

setFlags

public void setFlags(int flags)

getOffset

public int getOffset()

setOffset

public void setOffset(int offset)

setData

public void setData(byte[] data)

getData

public byte[] getData()

getLength

public int getLength()

setLength

public void setLength(int length)

isEOM

public boolean isEOM()

setEOM

public void setEOM(boolean eom)

isDiscard

public boolean isDiscard()

setDiscard

public void setDiscard(boolean discard)

getHeader

public java.lang.Object getHeader()

setHeader

public void setHeader(java.lang.Object header)

getTimeStamp

public long getTimeStamp()

setTimeStamp

public void setTimeStamp(long timeStamp)

getDuration

public long getDuration()

setDuration

public void setDuration(long duration)

setSequenceNumber

public void setSequenceNumber(long number)

getSequenceNumber

public long getSequenceNumber()

copy

public void copy(Buffer buffer)

copy

public void copy(Buffer buffer,
                 boolean swapData)

clone

public java.lang.Object clone()
Overrides:
clone in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

dispose

public void dispose()


Copyright © 2010. All Rights Reserved.