Class QuickTimeReader
java.lang.Object
org.monte.media.quicktime.QuickTimeReader
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()protected voidintFinds a track with the specified format.longgetChunkCount(int track) Returns the number of media data chunks in the specified track.Returns the total duration of the movie .getDuration(int track) Returns the duration of the specified track.Returns the file format.getFormat(int track) Returns the media format of the specified track.getReadTime(int track) Returns the current time of the track.intReturns the number of tracks.intReturns the index of the next track in playback sequence.read(int track, BufferedImage img) Reads an image.voidReads the next sample chunk from the specified track.sampleToTime(int track, long sample) Returns the time for the specified sample number.voidsetMovieReadTime(Rational newValue) Sets the read time of all tracks to the closest sync sample before or at the specified time.longtimeToSample(int track, Rational seconds) Returns the sample number for the specified time.
-
Field Details
-
QUICKTIME
-
-
Constructor Details
-
QuickTimeReader
Creates a new instance.- Parameters:
file- the input file- Throws:
IOException
-
QuickTimeReader
Creates a new instance.- Parameters:
in- the input stream.- Throws:
IOException
-
-
Method Details
-
timeToSample
Description copied from interface:MovieReaderReturns the sample number for the specified time.- Specified by:
timeToSamplein interfaceMovieReader- Throws:
IOException
-
sampleToTime
Description copied from interface:MovieReaderReturns the time for the specified sample number.- Specified by:
sampleToTimein interfaceMovieReader- Throws:
IOException
-
getFileFormat
Description copied from interface:MovieReaderReturns the file format.- Specified by:
getFileFormatin interfaceMovieReader- Throws:
IOException
-
getFormat
Description copied from interface:MovieReaderReturns the media format of the specified track.- Specified by:
getFormatin interfaceMovieReader- Parameters:
track- Track number.- Returns:
- The media format of the track.
- Throws:
IOException
-
getChunkCount
Description copied from interface:MovieReaderReturns the number of media data chunks in the specified track. A chunk contains one or more samples.- Specified by:
getChunkCountin interfaceMovieReader- Throws:
IOException
-
ensureRealized
- Throws:
IOException
-
read
Reads an image.- Parameters:
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.- Returns:
- An image or null if the end of the media has been reached.
- Throws:
IOException- if an I/O error occurs
-
read
Description copied from interface:MovieReaderReads the next sample chunk from the specified track.- Specified by:
readin interfaceMovieReader- Parameters:
track- Track number.buffer- The buffer into which to store the sample data.- Throws:
IOException
-
nextTrack
Description copied from interface:MovieReaderReturns the index of the next track in playback sequence.- Specified by:
nextTrackin interfaceMovieReader- Returns:
- Index of next track or -1 if end of media reached.
- Throws:
IOException
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceMovieReader- Throws:
IOException
-
setMovieReadTime
Description copied from interface:MovieReaderSets the read time of all tracks to the closest sync sample before or at the specified time.- Specified by:
setMovieReadTimein interfaceMovieReader- Parameters:
newValue- Time in seconds.- Throws:
IOException
-
getReadTime
Description copied from interface:MovieReaderReturns the current time of the track.- Specified by:
getReadTimein interfaceMovieReader- Throws:
IOException
-
getDuration
Description copied from interface:MovieReaderReturns the total duration of the movie .- Specified by:
getDurationin interfaceMovieReader- Throws:
IOException
-
getDuration
Description copied from interface:MovieReaderReturns the duration of the specified track.- Specified by:
getDurationin interfaceMovieReader- Throws:
IOException
-
getTrackCount
Description copied from interface:MovieReaderReturns the number of tracks.- Specified by:
getTrackCountin interfaceMovieReader- Throws:
IOException
-
findTrack
Description copied from interface:MovieReaderFinds a track with the specified format.- Specified by:
findTrackin interfaceMovieReader- Parameters:
fromTrack- the start track number.format- A format specification.- Returns:
- The track number >= fromTrack or -1 if no track has been found.
- Throws:
IOException
-