Copyright 2012-04-26 Werner Randelshofer

org.monte.media.quicktime
Class QuickTimeInputStream

java.lang.Object
  extended by org.monte.media.quicktime.AbstractQuickTimeStream
      extended by org.monte.media.quicktime.QuickTimeInputStream
Direct Known Subclasses:
QuickTimeReader

public class QuickTimeInputStream
extends AbstractQuickTimeStream

Provides low-level support for reading encoded audio and video samples from a QuickTime file.

Version:
$Id: QuickTimeInputStream.java 187 2012-03-28 11:49:30Z werner $
Author:
Werner Randelshofer

Nested Class Summary
 
Nested classes/interfaces inherited from class org.monte.media.quicktime.AbstractQuickTimeStream
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
 
Field Summary
protected  javax.imageio.stream.ImageInputStream in
          The image input stream.
 
Fields inherited from class org.monte.media.quicktime.AbstractQuickTimeStream
creationTime, mdatAtom, mdatOffset, modificationTime, moovAtom, movieMatrix, movieTimeScale, out, state, streamOffset, tracks
 
Constructor Summary
QuickTimeInputStream(java.io.File file)
          Creates a new instance.
QuickTimeInputStream(javax.imageio.stream.ImageInputStream in)
          Creates a new instance.
 
Method Summary
 void close()
           
protected  void ensureRealized()
          Ensures that all meta-data has been read from the file.
 long getMediaDuration(int track)
          Returns the media duration of a track in the media's time scale.
 long getMediaTimeScale(int track)
          Returns the time scale of the media in a track.
 long getMovieDuration()
           
 long getMovieTimeScale()
          Returns the time scale of the movie.
 int getTrackCount()
           
 
Methods inherited from class org.monte.media.quicktime.AbstractQuickTimeStream
getRelativeStreamPosition, intToType, seekRelative, typeToInt
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

in

protected final javax.imageio.stream.ImageInputStream in
The image input stream.

Constructor Detail

QuickTimeInputStream

public QuickTimeInputStream(java.io.File file)
                     throws java.io.IOException
Creates a new instance.

Parameters:
file - the input file
Throws:
java.io.IOException

QuickTimeInputStream

public QuickTimeInputStream(javax.imageio.stream.ImageInputStream in)
                     throws java.io.IOException
Creates a new instance.

Parameters:
in - the input stream.
Throws:
java.io.IOException
Method Detail

getTrackCount

public int getTrackCount()
                  throws java.io.IOException
Throws:
java.io.IOException

getMovieDuration

public long getMovieDuration()
                      throws java.io.IOException
Throws:
java.io.IOException

getMovieTimeScale

public long getMovieTimeScale()
                       throws java.io.IOException
Returns the time scale of the movie.

The movie time scale is used for editing tracks. Such as for specifying the start time of a track.

Returns:
time scale
Throws:
java.io.IOException
See Also:
#setMovieTimeScale(long)

getMediaTimeScale

public long getMediaTimeScale(int track)
                       throws java.io.IOException
Returns the time scale of the media in a track.

The media time scale is used for specifying the duration of samples in a track.

Parameters:
track - Track index.
Returns:
time scale
Throws:
java.io.IOException

getMediaDuration

public long getMediaDuration(int track)
                      throws java.io.IOException
Returns the media duration of a track in the media's time scale.

Parameters:
track - Track index.
Returns:
media duration
Throws:
java.io.IOException

ensureRealized

protected void ensureRealized()
                       throws java.io.IOException
Ensures that all meta-data has been read from the file.

Throws:
java.io.IOException

close

public void close()
           throws java.io.IOException
Throws:
java.io.IOException

Copyright 2012-04-26 Werner Randelshofer