Class QuickTimeInputStream

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

public class QuickTimeInputStream extends Object
Provides low-level support for reading encoded audio and video samples from a QuickTime file.
Author:
Werner Randelshofer
  • Field Details

    • in

      protected ImageInputStream in
      The image input stream.
    • meta

      protected QuickTimeMeta meta
      This variable is set to non-null, when the movie meta data has been read.
    • streamOffset

      protected long streamOffset
    • currentTime

      protected long currentTime
  • Constructor Details

    • QuickTimeInputStream

      public QuickTimeInputStream(File file) throws IOException
      Creates a new instance.
      Parameters:
      file - the input file
      Throws:
      IOException
    • QuickTimeInputStream

      public QuickTimeInputStream(ImageInputStream in) throws IOException
      Creates a new instance.
      Parameters:
      in - the input stream.
      Throws:
      IOException
  • Method Details

    • getTrackCount

      public int getTrackCount() throws IOException
      Throws:
      IOException
    • getMovieDuration

      public long getMovieDuration() throws IOException
      Throws:
      IOException
    • getCreationTime

      public Date getCreationTime() throws IOException
      Gets the creation time of the movie.
      Throws:
      IOException
    • getModificationTime

      public Date getModificationTime() throws IOException
      Gets the modification time of the movie.
      Throws:
      IOException
    • getPreferredRate

      public double getPreferredRate() throws IOException
      Gets the preferred rate at which to play this movie. A value of 1.0 indicates normal rate.
      Throws:
      IOException
    • getPreferredVolume

      public double getPreferredVolume() throws IOException
      Gets the preferred volume of this movie’s sound. A value of 1.0 indicates full volume.
      Throws:
      IOException
    • getCurrentTime

      public long getCurrentTime() throws IOException
      Gets the time value for current time position within the movie.
      Throws:
      IOException
    • getPosterTime

      public long getPosterTime() throws IOException
      Gets the time value of the time of the movie poster.
      Throws:
      IOException
    • getPreviewDuration

      public long getPreviewDuration() throws IOException
      Gets the duration of the movie preview in movie time scale units.
      Throws:
      IOException
    • getPreviewTime

      public long getPreviewTime() throws IOException
      Gets the time value in the movie at which the preview begins.
      Throws:
      IOException
    • getMovieTransformationMatrix

      public double[] getMovieTransformationMatrix() throws IOException
      Gets the transformation matrix of the entire movie.
      Returns:
      The transformation matrix.
      Throws:
      IOException
    • getMovieTimeScale

      public long getMovieTimeScale() throws 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:
      IOException
    • getMediaTimeScale

      public long getMediaTimeScale(int track) throws 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:
      IOException
    • getMediaDuration

      public long getMediaDuration(int track) throws IOException
      Returns the media duration of a track in the media's time scale.
      Parameters:
      track - Track index.
      Returns:
      media duration
      Throws:
      IOException
    • getTransformationMatrix

      public double[] getTransformationMatrix(int track) throws IOException
      Gets the transformation matrix of the specified track.
      Parameters:
      track - The track number.
      Returns:
      The transformation matrix.
      Throws:
      IOException
    • ensureRealized

      protected void ensureRealized() throws IOException
      Ensures that all meta-data has been read from the file.
      Throws:
      IOException
    • close

      public void close() throws IOException
      Throws:
      IOException