org.red5.io.mp4
Class MP4Frame

java.lang.Object
  extended by org.red5.io.mp4.MP4Frame
All Implemented Interfaces:
Comparable<MP4Frame>

public class MP4Frame
extends Object
implements Comparable<MP4Frame>

Represents an MP4 frame / chunk sample

Author:
Paul Gregoire ([email protected])

Constructor Summary
MP4Frame()
           
 
Method Summary
 int compareTo(MP4Frame that)
          The frames are expected to be sorted by their timestamp
 boolean equals(Object obj)
           
 long getOffset()
          Returns the offset of the data chunk in the media source.
 int getSize()
          Returns the size of the data chunk.
 double getTime()
          Returns the timestamp.
 int getTimeOffset()
           
 byte getType()
          Returns the data type, being audio or video.
 int hashCode()
           
 boolean isKeyFrame()
          Returns whether or not this chunk represents a key frame.
 void setKeyFrame(boolean keyFrame)
           
 void setOffset(long offset)
           
 void setSize(int size)
           
 void setTime(double time)
           
 void setTimeOffset(int timeOffset)
           
 void setType(byte type)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MP4Frame

public MP4Frame()
Method Detail

getType

public byte getType()
Returns the data type, being audio or video.

Returns:
the data type

setType

public void setType(byte type)

getOffset

public long getOffset()
Returns the offset of the data chunk in the media source.

Returns:
the offset in bytes

setOffset

public void setOffset(long offset)

getSize

public int getSize()
Returns the size of the data chunk.

Returns:
the size in bytes

setSize

public void setSize(int size)

getTime

public double getTime()
Returns the timestamp.

Returns:
the timestamp

setTime

public void setTime(double time)

getTimeOffset

public int getTimeOffset()
Returns:
the timeOffset

setTimeOffset

public void setTimeOffset(int timeOffset)
Parameters:
timeOffset - the timeOffset to set

isKeyFrame

public boolean isKeyFrame()
Returns whether or not this chunk represents a key frame.

Returns:
true if a key frame

setKeyFrame

public void setKeyFrame(boolean keyFrame)

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

toString

public String toString()
Overrides:
toString in class Object

compareTo

public int compareTo(MP4Frame that)
The frames are expected to be sorted by their timestamp

Specified by:
compareTo in interface Comparable<MP4Frame>


Copyright © 2006-2012 The Red5 Project