java.lang.Object
org.monte.media.quicktime.QuickTimeInputStream
org.monte.media.quicktime.QuickTimeReader
- All Implemented Interfaces:
AutoCloseable,MovieReader
QuickTimeReader.- Author:
- Werner Randelshofer
-
Field Summary
FieldsFields inherited from class org.monte.media.quicktime.QuickTimeInputStream
currentTime, in, meta, streamOffset -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidEnsures that all meta-data has been read from the file.intFinds 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 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.Methods inherited from class org.monte.media.quicktime.QuickTimeInputStream
close, getCreationTime, getCurrentTime, getMediaDuration, getMediaTimeScale, getModificationTime, getMovieDuration, getMovieTimeScale, getMovieTransformationMatrix, getPosterTime, getPreferredRate, getPreferredVolume, getPreviewDuration, getPreviewTime, getTrackCount, getTransformationMatrixMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.monte.media.av.MovieReader
close, getTrackCount
-
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
Description copied from class:QuickTimeInputStreamEnsures that all meta-data has been read from the file.- Overrides:
ensureRealizedin classQuickTimeInputStream- 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
-
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
-
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
-
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
-