public class QuickTimeReader extends QuickTimeInputStream implements MovieReader
QuickTimeReader.AbstractQuickTimeStream.Atom, AbstractQuickTimeStream.AudioTrack, AbstractQuickTimeStream.Chunk, AbstractQuickTimeStream.CompositeAtom, AbstractQuickTimeStream.DataAtom, AbstractQuickTimeStream.Edit, AbstractQuickTimeStream.Group, AbstractQuickTimeStream.Sample, AbstractQuickTimeStream.SampleSizeGroup, AbstractQuickTimeStream.States, AbstractQuickTimeStream.TimeToSampleGroup, AbstractQuickTimeStream.Track, AbstractQuickTimeStream.VideoTrack, AbstractQuickTimeStream.WideDataAtom| Modifier and Type | Field and Description |
|---|---|
static Format |
QUICKTIME |
increationTime, currentTime, mdatAtom, mdatOffset, modificationTime, moovAtom, movieMatrix, movieTimeScale, out, posterTime, preferredRate, preferredVolume, previewDuration, previewTime, selectionDuration, selectionTime, state, streamOffset, tracks| Constructor and Description |
|---|
QuickTimeReader(File file)
Creates a new instance.
|
QuickTimeReader(ImageInputStream in)
Creates a new instance.
|
| Modifier and Type | Method and Description |
|---|---|
int |
findTrack(int fromTrack,
Format format)
Finds a track with the specified format.
|
long |
getChunkCount(int track)
Returns the number of media data chunks in the specified track.
|
Rational |
getDuration()
Returns the total duration of the movie .
|
Rational |
getDuration(int track)
Returns the duration of the specified track.
|
Format |
getFileFormat()
Returns the file format.
|
Format |
getFormat(int track)
Returns the media format of the specified track.
|
Rational |
getReadTime(int track)
Returns the current time of the track.
|
int |
nextTrack()
Returns the index of the next track in playback sequence.
|
void |
read(int track,
Buffer buffer)
Reads the next sample chunk from the specified track.
|
BufferedImage |
read(int track,
BufferedImage img)
Reads an image.
|
Rational |
sampleToTime(int track,
long sample)
Returns the time for the specified sample number.
|
void |
setMovieReadTime(Rational newValue)
Sets the read time of all tracks to the closest sync sample before or
at the specified time.
|
long |
timeToSample(int track,
Rational seconds)
Returns the sample number for the specified time.
|
close, ensureRealized, getCreationTime, getCurrentTime, getMediaDuration, getMediaTimeScale, getModificationTime, getMovieDuration, getMovieTimeScale, getMovieTransformationMatrix, getPosterTime, getPreferredRate, getPreferredVolume, getPreviewDuration, getPreviewTime, getTrackCount, getTransformationMatrixgetRelativeStreamPosition, intToType, seekRelative, typeToIntclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitclose, getTrackCountpublic static final Format QUICKTIME
public QuickTimeReader(File file) throws IOException
file - the input fileIOExceptionpublic QuickTimeReader(ImageInputStream in) throws IOException
in - the input stream.IOExceptionpublic long timeToSample(int track,
Rational seconds)
MovieReadertimeToSample in interface MovieReaderpublic Rational sampleToTime(int track, long sample)
MovieReadersampleToTime in interface MovieReaderpublic Format getFileFormat() throws IOException
MovieReadergetFileFormat in interface MovieReaderIOExceptionpublic Format getFormat(int track) throws IOException
MovieReadergetFormat in interface MovieReadertrack - Track number.IOExceptionpublic long getChunkCount(int track)
throws IOException
MovieReadergetChunkCount in interface MovieReaderIOExceptionpublic BufferedImage read(int track, BufferedImage img) throws IOException
track - The track numberimg - An image that can be reused if it fits the media format of the
track. Pass null to create a new image on each read.IOExceptionpublic void read(int track,
Buffer buffer)
throws IOException
MovieReaderread in interface MovieReadertrack - Track number.buffer - The buffer into which to store the sample data.IOExceptionpublic int nextTrack()
throws IOException
MovieReadernextTrack in interface MovieReaderIOExceptionpublic void setMovieReadTime(Rational newValue)
MovieReadersetMovieReadTime in interface MovieReadernewValue - Time in seconds.public Rational getReadTime(int track) throws IOException
MovieReadergetReadTime in interface MovieReaderIOExceptionpublic Rational getDuration() throws IOException
MovieReadergetDuration in interface MovieReaderIOExceptionpublic Rational getDuration(int track) throws IOException
MovieReadergetDuration in interface MovieReaderIOExceptionpublic int findTrack(int fromTrack,
Format format)
throws IOException
MovieReaderfindTrack in interface MovieReaderfromTrack - the start track number.format - A format specification.IOExceptionCopyright © 2014. All Rights Reserved.