Maven module :un.storage : media-mpeg4 :
Class : un.storage.media.mp4.api.Track
Extends/Implements : -
Subclasses : -

This class represents a track in a movie.

Each track contains either a decoder specific info as a byte array or a
DecoderInfo object that contains necessary information for the
decoder.

@author Alexander Simm


Variables : tkhd, decoderSpecificInfo, decoderInfo, protection
Functions : Track, findDecoderSpecificInfo, parseSampleEntry, getType, getCodec, isEnabled, isUsed, isUsedForPreview, getCreationTime, getModificationTime, getLanguage, isInFile, getLocation, getDecoderSpecificInfo, getDecoderInfo, getProtection, hasMoreFrames, readNextFrame, seek, getNextTimeStamp


protected TrackHeaderBox tkhd



protected DecoderSpecificInfo decoderSpecificInfo

protected DecoderInfo decoderInfo

protected Protection protection


void Track (Box trak, MP4InputStream in)



protected void findDecoderSpecificInfo (ESDBox esds)

protected void parseSampleEntry (Box sampleEntry, Class clazz)

public Type getType ()

public Codec getCodec ()


Returns true if the track is enabled. A disabled track is treated as if
it were not present.
return  true if the track is enabled
public boolean isEnabled ()


Returns true if the track is used in the presentation.
return  true if the track is used
public boolean isUsed ()


Returns true if the track is used in previews.
return  true if the track is used in previews
public boolean isUsedForPreview ()


Returns the time this track was created.
return  the creation time
public Date getCreationTime ()


Returns the last time this track was modified.
return  the modification time
public Date getModificationTime ()


Returns the language for this media.
return  the language
public Locale getLanguage ()


Returns true if the data for this track is present in this file (stream).
If not, getLocation() returns the URL where the data can be
found.
return  true if the data is in this file (stream), false otherwise
public boolean isInFile ()


If the data for this track is not present in this file (if
isInFile returns false), this method returns the data's
location. Else null is returned.
@return the data's location or null if the data is in this file
public URL getLocation ()


Returns the decoder specific info, if present. It contains configuration
data for the decoder. If the decoder specific info is not present, the
track contains a DecoderInfo.
see  #getDecoderInfo()
return  the decoder specific info
public byte[] getDecoderSpecificInfo ()


Returns the DecoderInfo, if present. It contains
configuration information for the decoder. If the structure is not
present, the track contains a decoder specific info.
see  #getDecoderSpecificInfo()
return  the codec specific structure
public DecoderInfo getDecoderInfo ()


Returns the ProtectionInformation object that contains
details about the DRM system used. If no protection is present this
method returns null.
return  a ProtectionInformation object or null if no
protection is used
public Protection getProtection ()


Indicates if there are more frames to be read in this track.
return  true if there is at least one more frame to read.
public boolean hasMoreFrames ()


Reads the next frame from this track. If it contains no more frames to
read, null is returned.
return  the next frame or null if there are no more frames to read
throws  IOException if reading fails
public Frame readNextFrame ()


This method tries to seek to the frame that is nearest to the given
timestamp. It returns the timestamp of the frame it seeked to or -1 if
none was found.
param  timestamp a timestamp to seek to
return  the frame's timestamp that the method seeked to
public double seek (double timestamp)


Returns the timestamp of the next frame to be read. This is needed to
read frames from a movie that contains multiple tracks.
return  the next frame's timestamp
double getNextTimeStamp ()