Package org.red5.io.mp4
Class MP4Frame
- java.lang.Object
-
- 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 (mondain@gmail.com)
-
-
Constructor Summary
Constructors Constructor Description MP4Frame()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareTo(MP4Frame that)The frames are expected to be sorted by their timestampbooleanequals(Object obj)longgetOffset()Returns the offset of the data chunk in the media source.intgetSize()Returns the size of the data chunk.doublegetTime()Returns the timestamp.intgetTimeOffset()bytegetType()Returns the data type, being audio or video.inthashCode()booleanisKeyFrame()Returns whether or not this chunk represents a key frame.voidsetKeyFrame(boolean keyFrame)voidsetOffset(long offset)voidsetSize(int size)voidsetTime(double time)voidsetTimeOffset(int timeOffset)voidsetType(byte type)StringtoString()
-
-
-
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)
-
compareTo
public int compareTo(MP4Frame that)
The frames are expected to be sorted by their timestamp- Specified by:
compareToin interfaceComparable<MP4Frame>
-
-