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 |
in
creationTime, currentTime, mdatAtom, mdatOffset, modificationTime, moovAtom, movieMatrix, movieTimeScale, out, posterTime, preferredRate, preferredVolume, previewDuration, previewTime, selectionDuration, selectionTime, state, streamOffset, tracks
Constructor and Description |
---|
QuickTimeReader(java.io.File file)
Creates a new instance.
|
QuickTimeReader(javax.imageio.stream.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.
|
java.awt.image.BufferedImage |
read(int track,
java.awt.image.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, getTransformationMatrix
getRelativeStreamPosition, intToType, seekRelative, typeToInt
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
close, getTrackCount
public static final Format QUICKTIME
public QuickTimeReader(java.io.File file) throws java.io.IOException
file
- the input filejava.io.IOException
public QuickTimeReader(javax.imageio.stream.ImageInputStream in) throws java.io.IOException
in
- the input stream.java.io.IOException
public long timeToSample(int track, Rational seconds)
MovieReader
timeToSample
in interface MovieReader
public Rational sampleToTime(int track, long sample)
MovieReader
sampleToTime
in interface MovieReader
public Format getFileFormat() throws java.io.IOException
MovieReader
getFileFormat
in interface MovieReader
java.io.IOException
public Format getFormat(int track) throws java.io.IOException
MovieReader
getFormat
in interface MovieReader
track
- Track number.java.io.IOException
public long getChunkCount(int track) throws java.io.IOException
MovieReader
getChunkCount
in interface MovieReader
java.io.IOException
public java.awt.image.BufferedImage read(int track, java.awt.image.BufferedImage img) throws java.io.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.java.io.IOException
public void read(int track, Buffer buffer) throws java.io.IOException
MovieReader
read
in interface MovieReader
track
- Track number.buffer
- The buffer into which to store the sample data.java.io.IOException
public int nextTrack() throws java.io.IOException
MovieReader
nextTrack
in interface MovieReader
java.io.IOException
public void setMovieReadTime(Rational newValue)
MovieReader
setMovieReadTime
in interface MovieReader
newValue
- Time in seconds.public Rational getReadTime(int track) throws java.io.IOException
MovieReader
getReadTime
in interface MovieReader
java.io.IOException
public Rational getDuration() throws java.io.IOException
MovieReader
getDuration
in interface MovieReader
java.io.IOException
public Rational getDuration(int track) throws java.io.IOException
MovieReader
getDuration
in interface MovieReader
java.io.IOException
public int findTrack(int fromTrack, Format format) throws java.io.IOException
MovieReader
findTrack
in interface MovieReader
fromTrack
- the start track number.format
- A format specification.java.io.IOException