Interface MovieReader
- All Superinterfaces:
AutoCloseable
- All Known Implementing Classes:
AVIReader,QuickTimeReader
A simple API for reading movie data (audio and video) from a file.
FIXME - MovieReader should extend Demultiplexer
- Author:
- Werner Randelshofer
-
Method Summary
Modifier and TypeMethodDescriptionvoidclose()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 number of tracks.intReturns the index of the next track in playback sequence.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.
-
Method Details
-
getTrackCount
-
findTrack
Finds a track with the specified format.- 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
-
getDuration
Returns the total duration of the movie .- Throws:
IOException
-
getDuration
Returns the duration of the specified track.- Throws:
IOException
-
timeToSample
Returns the sample number for the specified time.- Throws:
IOException
-
sampleToTime
Returns the time for the specified sample number.- Throws:
IOException
-
getFileFormat
-
getFormat
Returns the media format of the specified track.- Parameters:
track- Track number.- Returns:
- The media format of the track.
- Throws:
IOException
-
getChunkCount
Returns the number of media data chunks in the specified track. A chunk contains one or more samples.- Throws:
IOException
-
read
Reads the next sample chunk from the specified track.- Parameters:
track- Track number.buffer- The buffer into which to store the sample data.- Throws:
IOException
-
nextTrack
Returns the index of the next track in playback sequence.- Returns:
- Index of next track or -1 if end of media reached.
- Throws:
IOException
-
close
- Specified by:
closein interfaceAutoCloseable- Throws:
IOException
-
setMovieReadTime
Sets the read time of all tracks to the closest sync sample before or at the specified time.- Parameters:
newValue- Time in seconds.- Throws:
IOException
-
getReadTime
Returns the current time of the track.- Throws:
IOException
-