|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.red5.io.mp4.MP4Atom
public class MP4Atom
The MP4Atom
object represents the smallest information block
of the MP4 file. It could contain other atoms as children.
01/29/2008 - Added support for avc1 atom (video sample)
02/05/2008 - Added stss - sync sample atom and stts - time to sample atom
10/2008 - Added pasp - pixel aspect ratio atom
Nested Class Summary | |
---|---|
static class |
MP4Atom.Record
|
static class |
MP4Atom.TimeSampleRecord
|
Field Summary | |
---|---|
protected int |
avcLevel
|
protected int |
avcProfile
|
protected int |
balance
|
protected List<MP4Atom> |
children
The children of this atom. |
protected Vector<Long> |
chunks
The decoding time to sample table. |
protected Date |
creationTime
|
protected long |
duration
|
protected int |
entryCount
|
protected MP4Descriptor |
esd_descriptor
|
protected int |
fieldSize
|
protected int |
flags
|
protected int |
graphicsMode
|
protected int |
handlerType
|
protected int |
height
|
protected Date |
modificationTime
|
static int |
MP4AudioSampleEntryAtomType
Constant, the type of the MP4 Atom. |
static int |
MP4AVCAtomType
|
static int |
MP4ChunkLargeOffsetAtomType
Constant, the type of the MP4 Atom. |
static int |
MP4ChunkOffsetAtomType
Constant, the type of the MP4 Atom. |
static int |
MP4CompactSampleSizeAtomType
Constant, the type of the MP4 Atom. |
static int |
MP4DataInformationAtomType
Constant, the type of the MP4 Atom. |
static int |
MP4ESDAtomType
Constant, the type of the MP4 Atom. |
static int |
MP4ExtendedAtomType
Constant, the type of the MP4 Atom. |
static int |
MP4HandlerAtomType
Constant, the type of the MP4 Atom. |
static int |
MP4MediaAtomType
Constant, the type of the MP4 Atom. |
static int |
MP4MediaHeaderAtomType
Constant, the type of the MP4 Atom. |
static int |
MP4MediaInformationAtomType
Constant, the type of the MP4 Atom. |
static int |
MP4MovieAtomType
Constant, the type of the MP4 Atom. |
static int |
MP4MovieDataType
|
static int |
MP4MovieHeaderAtomType
Constant, the type of the MP4 Atom. |
static int |
MP4PixelAspectAtomType
|
static int |
MP4SampleDescriptionAtomType
Constant, the type of the MP4 Atom. |
static int |
MP4SampleSizeAtomType
Constant, the type of the MP4 Atom. |
static int |
MP4SampleTableAtomType
Constant, the type of the MP4 Atom. |
static int |
MP4SampleToChunkAtomType
Constant, the type of the MP4 Atom. |
static int |
MP4SoundMediaHeaderAtomType
Constant, the type of the MP4 Atom. |
static int |
MP4SyncSampleAtomType
|
static int |
MP4TimeToSampleAtomType
|
static int |
MP4TrackAtomType
Constant, the type of the MP4 Atom. |
static int |
MP4TrackHeaderAtomType
Constant, the type of the MP4 Atom. |
static int |
MP4VideoMediaHeaderAtomType
Constant, the type of the MP4 Atom. |
static int |
MP4VideoSampleEntryAtomType
|
static int |
MP4VisualSampleEntryAtomType
Constant, the type of the MP4 Atom. |
protected int |
opColorBlue
|
protected int |
opColorGreen
|
protected int |
opColorRed
|
protected int |
qt_trackHeight
|
protected int |
qt_trackWidth
|
protected long |
readed
The amount of bytes that readed from the mpeg stream. |
protected Vector<MP4Atom.Record> |
records
The decoding time to sample table. |
protected int |
sampleCount
|
protected Vector<Integer> |
samples
The decoding time to sample table. |
protected int |
sampleSize
|
protected long |
size
The size of the atom. |
protected Vector<Integer> |
syncSamples
|
protected int |
timeScale
|
protected Vector<MP4Atom.TimeSampleRecord> |
timeToSamplesRecords
|
protected long |
trackId
|
protected int |
type
The type of the atom. |
protected String |
uuid
The user's extended type of the atom. |
protected int |
version
|
protected int |
width
|
Constructor Summary | |
---|---|
MP4Atom(long size,
int type,
String uuid,
long readed)
|
Method Summary | |
---|---|
long |
create_audio_sample_entry_atom(MP4DataStream bitstream)
Loads AudioSampleEntry atom from the input bitstream. |
long |
create_avc_config_atom(MP4DataStream bitstream)
Loads AVCC atom from the input bitstream. |
long |
create_chunk_large_offset_atom(MP4DataStream bitstream)
Loads ChunkLargeOffset atom from the input bitstream. |
long |
create_chunk_offset_atom(MP4DataStream bitstream)
Loads ChunkOffset atom from the input bitstream. |
long |
create_compact_sample_size_atom(MP4DataStream stream)
Loads CompactSampleSize atom from the input stream. |
long |
create_composite_atom(MP4DataStream bitstream)
Loads the composite atom from the input bitstream. |
long |
create_esd_atom(MP4DataStream bitstream)
Loads M4ESDAtom atom from the input bitstream. |
long |
create_full_atom(MP4DataStream bitstream)
Loads the version of the full atom from the input bitstream. |
long |
create_handler_atom(MP4DataStream bitstream)
Loads Handler atom from the input bitstream. |
long |
create_media_header_atom(MP4DataStream bitstream)
Loads MediaHeader atom from the input bitstream. |
long |
create_movie_header_atom(MP4DataStream bitstream)
Loads MovieHeader atom from the input bitstream. |
long |
create_pasp_atom(MP4DataStream bitstream)
Creates the PASP atom or Pixel Aspect Ratio. |
long |
create_sample_description_atom(MP4DataStream bitstream)
Loads SampleDescription atom from the input bitstream. |
long |
create_sample_size_atom(MP4DataStream bitstream)
Loads MP4SampleSizeAtom atom from the input bitstream. |
long |
create_sample_to_chunk_atom(MP4DataStream bitstream)
Loads MP4SampleToChunkAtom atom from the input bitstream. |
long |
create_sound_media_header_atom(MP4DataStream bitstream)
Loads MP4SoundMediaHeaderAtom atom from the input bitstream. |
long |
create_sync_sample_atom(MP4DataStream bitstream)
Loads MP4SyncSampleAtom atom from the input bitstream. |
long |
create_time_to_sample_atom(MP4DataStream bitstream)
Loads MP4TimeToSampleAtom atom from the input bitstream. |
long |
create_track_header_atom(MP4DataStream bitstream)
Loads MP4TrackHeaderAtom atom from the input bitstream. |
long |
create_video_media_header_atom(MP4DataStream bitstream)
Loads MP4VideoMediaHeaderAtom atom from the input bitstream. |
long |
create_video_sample_entry_atom(MP4DataStream bitstream)
Loads MP4VideoSampleEntryAtom atom from the input bitstream. |
long |
create_visual_sample_entry_atom(MP4DataStream bitstream)
Loads MP4VisualSampleEntryAtom atom from the input bitstream. |
static MP4Atom |
createAtom(MP4DataStream bitstream)
Constructs an Atom object from the data in the bitstream. |
static Date |
createDate(long movieTime)
Converts the time in seconds since midnight 1 Jan 1904 to the Date . |
int |
getAvcLevel()
|
int |
getAvcProfile()
|
int |
getChannelCount()
|
List<MP4Atom> |
getChildren()
Gets children from this atom. |
Vector<Long> |
getChunks()
|
long |
getDuration()
|
MP4Descriptor |
getEsd_descriptor()
Returns the ESD descriptor. |
int |
getHandlerType()
Gets the handler type. |
int |
getHeight()
|
Vector<MP4Atom.Record> |
getRecords()
|
Vector<Integer> |
getSamples()
|
int |
getSampleSize()
|
long |
getSize()
Gets the size of this atom. |
Vector<Integer> |
getSyncSamples()
|
int |
getTimeScale()
|
Vector<MP4Atom.TimeSampleRecord> |
getTimeToSamplesRecords()
|
int |
getType()
Returns the type of this atom. |
byte[] |
getVideoConfigBytes()
|
int |
getWidth()
|
static String |
intToType(int type)
|
MP4Atom |
lookup(long type,
int number)
Lookups for a child atom with the specified type , skips the number
children with the same type before finding a result. |
String |
toString()
Returns the name of this atom. |
static int |
typeToInt(String type)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int MP4AudioSampleEntryAtomType
public static final int MP4ChunkLargeOffsetAtomType
public static final int MP4ChunkOffsetAtomType
public static final int MP4DataInformationAtomType
public static final int MP4ESDAtomType
public static final int MP4ExtendedAtomType
public static final int MP4HandlerAtomType
public static final int MP4MediaAtomType
public static final int MP4MediaHeaderAtomType
public static final int MP4MediaInformationAtomType
public static final int MP4MovieAtomType
public static final int MP4MovieHeaderAtomType
public static final int MP4SampleDescriptionAtomType
public static final int MP4SampleSizeAtomType
public static final int MP4CompactSampleSizeAtomType
public static final int MP4SampleTableAtomType
public static final int MP4SampleToChunkAtomType
public static final int MP4SoundMediaHeaderAtomType
public static final int MP4TrackAtomType
public static final int MP4TrackHeaderAtomType
public static final int MP4VideoMediaHeaderAtomType
public static final int MP4VisualSampleEntryAtomType
public static final int MP4VideoSampleEntryAtomType
public static final int MP4SyncSampleAtomType
public static final int MP4TimeToSampleAtomType
public static final int MP4AVCAtomType
public static final int MP4MovieDataType
public static final int MP4PixelAspectAtomType
protected long size
protected int type
protected String uuid
protected long readed
protected List<MP4Atom> children
protected int version
protected int flags
protected int entryCount
protected Vector<Long> chunks
protected int handlerType
protected Date creationTime
protected Date modificationTime
protected int timeScale
protected long duration
protected int sampleSize
protected int sampleCount
protected Vector<Integer> samples
protected int fieldSize
protected Vector<MP4Atom.Record> records
protected Vector<Integer> syncSamples
protected Vector<MP4Atom.TimeSampleRecord> timeToSamplesRecords
protected int balance
protected long trackId
protected int qt_trackWidth
protected int qt_trackHeight
protected int graphicsMode
protected int opColorRed
protected int opColorGreen
protected int opColorBlue
protected int width
protected int height
protected int avcLevel
protected int avcProfile
protected MP4Descriptor esd_descriptor
Constructor Detail |
---|
public MP4Atom(long size, int type, String uuid, long readed)
Method Detail |
---|
public static MP4Atom createAtom(MP4DataStream bitstream) throws IOException
Atom
object from the data in the bitstream.
bitstream
- the input bitstream
IOException
public long create_full_atom(MP4DataStream bitstream) throws IOException
bitstream
- the input bitstream
IOException
public long create_composite_atom(MP4DataStream bitstream) throws IOException
bitstream
- the input bitstream
IOException
public MP4Atom lookup(long type, int number)
type
, skips the number
children with the same type before finding a result.
type
- the type of the atom.number
- the number of atoms to skip
public int getChannelCount()
public long create_audio_sample_entry_atom(MP4DataStream bitstream) throws IOException
bitstream
- the input bitstream
IOException
public long create_chunk_large_offset_atom(MP4DataStream bitstream) throws IOException
bitstream
- the input bitstream
IOException
public Vector<Long> getChunks()
public long create_chunk_offset_atom(MP4DataStream bitstream) throws IOException
bitstream
- the input bitstream
IOException
public long create_handler_atom(MP4DataStream bitstream) throws IOException
bitstream
- the input bitstream
IOException
public int getHandlerType()
public long create_media_header_atom(MP4DataStream bitstream) throws IOException
bitstream
- the input bitstream
IOException
public long getDuration()
public int getTimeScale()
public long create_movie_header_atom(MP4DataStream bitstream) throws IOException
bitstream
- the input bitstream
IOException
public long create_sample_description_atom(MP4DataStream bitstream) throws IOException
bitstream
- the input bitstream
IOException
public long create_sample_size_atom(MP4DataStream bitstream) throws IOException
bitstream
- the input bitstream
IOException
public Vector<Integer> getSamples()
public int getSampleSize()
public long create_compact_sample_size_atom(MP4DataStream stream) throws IOException
stream
- the input stream
IOException
public Vector<MP4Atom.Record> getRecords()
public long create_sample_to_chunk_atom(MP4DataStream bitstream) throws IOException
bitstream
- the input bitstream
IOException
public Vector<Integer> getSyncSamples()
public long create_sync_sample_atom(MP4DataStream bitstream) throws IOException
bitstream
- the input bitstream
IOException
public Vector<MP4Atom.TimeSampleRecord> getTimeToSamplesRecords()
public long create_time_to_sample_atom(MP4DataStream bitstream) throws IOException
bitstream
- the input bitstream
IOException
public long create_sound_media_header_atom(MP4DataStream bitstream) throws IOException
bitstream
- the input bitstream
IOException
public long create_track_header_atom(MP4DataStream bitstream) throws IOException
bitstream
- the input bitstream
IOException
public long create_video_media_header_atom(MP4DataStream bitstream) throws IOException
bitstream
- the input bitstream
IOException
public long create_visual_sample_entry_atom(MP4DataStream bitstream) throws IOException
bitstream
- the input bitstream
IOException
public long create_video_sample_entry_atom(MP4DataStream bitstream) throws IOException
bitstream
- the input bitstream
IOException
public int getHeight()
public int getWidth()
public int getAvcLevel()
public int getAvcProfile()
public byte[] getVideoConfigBytes()
public long create_avc_config_atom(MP4DataStream bitstream) throws IOException
8+ bytes ISO/IEC 14496-10 or 3GPP AVC decode config box = long unsigned offset + long ASCII text string 'avcC' -> 1 byte version = 8-bit hex version (current = 1) -> 1 byte H.264 profile = 8-bit unsigned stream profile -> 1 byte H.264 compatible profiles = 8-bit hex flags -> 1 byte H.264 level = 8-bit unsigned stream level -> 1 1/2 nibble reserved = 6-bit unsigned value set to 63 -> 1/2 nibble NAL length = 2-bit length byte size type - 1 byte = 0 ; 2 bytes = 1 ; 4 bytes = 3 -> 1 byte number of SPS = 8-bit unsigned total -> 2+ bytes SPS length = short unsigned length -> + SPS NAL unit = hexdump -> 1 byte number of PPS = 8-bit unsigned total -> 2+ bytes PPS length = short unsigned length -> + PPS NAL unit = hexdump
bitstream
- the input bitstream
IOException
public long create_pasp_atom(MP4DataStream bitstream) throws IOException
bitstream
- the input bitstream
IOException
public long create_esd_atom(MP4DataStream bitstream) throws IOException
bitstream
- the input bitstream
IOException
public MP4Descriptor getEsd_descriptor()
public static final Date createDate(long movieTime)
Date
.
movieTime
- the time in milliseconds since midnight 1 Jan 1904.
Date
object.public static int typeToInt(String type)
public static String intToType(int type)
public List<MP4Atom> getChildren()
public long getSize()
public int getType()
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |