Class AbstractQuickTimeStream

java.lang.Object
org.monte.media.quicktime.AbstractQuickTimeStream
Direct Known Subclasses:
QuickTimeOutputStream

public class AbstractQuickTimeStream extends Object
This is the base class for low-level QuickTime stream IO.

FIXME - Separation between AbstractQuickTimeStream and QuickTimeOutputStream is not clean. Move write methods in the track classes down to QuickTimeOutputStream.

Author:
Werner Randelshofer
  • Field Details

    • out

      protected ImageOutputStream out
      Underlying output stream.
    • streamOffset

      protected long streamOffset
      The offset in the underlying ImageOutputStream. Normally this is 0 unless the underlying stream already contained data when it was passed to the constructor.
    • mdatAtom

      This atom holds the media data.
    • mdatOffset

      protected long mdatOffset
      Offset for the mdat atom.
    • moovAtom

      This atom holds the moovie header.
    • creationTime

      protected Date creationTime
      Creation time of the movie.
    • modificationTime

      protected Date modificationTime
      Modification time of the movie.
    • movieTimeScale

      protected long movieTimeScale
      The timeScale of the movie. A time value that indicates the time scale for this media—that is, the number of time units that pass per second in its time coordinate system.
    • preferredRate

      protected double preferredRate
      The preferred rate at which to play this movie. A value of 1.0 indicates normal rate.
    • preferredVolume

      protected double preferredVolume
      The preferred volume of this movie’s sound. A value of 1.0 indicates full volume.
    • previewTime

      protected long previewTime
      The time value in the movie at which the preview begins.
    • previewDuration

      protected long previewDuration
      The duration of the movie preview in movie time scale units.
    • posterTime

      protected long posterTime
      The time value of the time of the movie poster.
    • selectionTime

      protected long selectionTime
      The time value for the start time of the current selection.
    • selectionDuration

      protected long selectionDuration
      The duration of the current selection in movie time scale units.
    • currentTime

      protected long currentTime
      The time value for current time position within the movie.
    • tracks

      The list of tracks in the movie.
    • movieMatrix

      protected double[] movieMatrix
      The transformation matrix for the entire movie.
    • state

      The current state of the movie output stream.
  • Constructor Details

    • AbstractQuickTimeStream

      public AbstractQuickTimeStream()
  • Method Details

    • setTrackEnabled

      public void setTrackEnabled(int track, boolean newValue)
    • isTrackEnabled

      public boolean isTrackEnabled(int track)
    • setTrackInMovie

      public void setTrackInMovie(int track, boolean newValue)
    • isTrackInMovie

      public boolean isTrackInMovie(int track)
    • setTrackInPreview

      public void setTrackInPreview(int track, boolean newValue)
    • isTrackInPreview

      public boolean isTrackInPreview(int track)
    • setTrackInPoster

      public void setTrackInPoster(int track, boolean newValue)
    • isTrackInPoster

      public boolean isTrackInPoster(int track)
    • getRelativeStreamPosition

      protected long getRelativeStreamPosition() throws IOException
      Gets the position relative to the beginning of the QuickTime stream.

      Usually this value is equal to the stream position of the underlying ImageOutputStream, but can be larger if the underlying stream already contained data.

      Returns:
      The relative stream position.
      Throws:
      IOException
    • seekRelative

      protected void seekRelative(long newPosition) throws IOException
      Seeks relative to the beginning of the QuickTime stream.

      Usually this equal to seeking in the underlying ImageOutputStream, but can be different if the underlying stream already contained data.

      Throws:
      IOException
    • typeToInt

      protected static int typeToInt(String str)
    • intToType

      protected static String intToType(int id)