Copyright 2012-04-26 Werner Randelshofer

org.monte.media.quicktime
Class AbstractQuickTimeStream

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

public class AbstractQuickTimeStream
extends java.lang.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.

Version:
1.0 2011-03-15 Created.
Author:
Werner Randelshofer

Nested Class Summary
protected  class AbstractQuickTimeStream.Atom
          Atom base class.
protected  class AbstractQuickTimeStream.AudioTrack
           
protected static class AbstractQuickTimeStream.Chunk
          Groups consecutive samples with the same sample description Id and with adjacent offsets in the movie file.
protected  class AbstractQuickTimeStream.CompositeAtom
          A CompositeAtom contains an ordered list of Atoms.
protected  class AbstractQuickTimeStream.DataAtom
          Data Atom.
static class AbstractQuickTimeStream.Edit
          An Edit define the portions of the media that are to be used to build up a track for a movie.
protected static class AbstractQuickTimeStream.Group
          Groups consecutive samples with same characteristics.
protected static class AbstractQuickTimeStream.Sample
          QuickTime stores media data in samples.
protected static class AbstractQuickTimeStream.SampleSizeGroup
          Groups consecutive samples of the same size.
protected static class AbstractQuickTimeStream.States
          The states of the movie output stream.
protected static class AbstractQuickTimeStream.TimeToSampleGroup
          Groups consecutive smples of the same duration.
protected  class AbstractQuickTimeStream.Track
          Represents a track.
protected  class AbstractQuickTimeStream.VideoTrack
           
protected  class AbstractQuickTimeStream.WideDataAtom
          WideDataAtom can grow larger then 4 gigabytes.
 
Field Summary
protected  java.util.Date creationTime
          Creation time of the movie.
protected  AbstractQuickTimeStream.WideDataAtom mdatAtom
          This atom holds the media data.
protected  long mdatOffset
          Offset for the mdat atom.
protected  java.util.Date modificationTime
          Modification time of the movie.
protected  AbstractQuickTimeStream.CompositeAtom moovAtom
          This atom holds the moovie header.
protected  double[] movieMatrix
          The transformation matrix for the entire movie.
protected  long movieTimeScale
          The timeScale of the movie.
protected  javax.imageio.stream.ImageOutputStream out
          Underlying output stream.
protected  AbstractQuickTimeStream.States state
          The current state of the movie output stream.
protected  long streamOffset
          The offset in the underlying ImageOutputStream.
protected  java.util.ArrayList<AbstractQuickTimeStream.Track> tracks
          The list of tracks in the movie.
 
Constructor Summary
AbstractQuickTimeStream()
           
 
Method Summary
protected  long getRelativeStreamPosition()
          Gets the position relative to the beginning of the QuickTime stream.
protected static java.lang.String intToType(int id)
           
protected  void seekRelative(long newPosition)
          Seeks relative to the beginning of the QuickTime stream.
protected static int typeToInt(java.lang.String str)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

out

protected javax.imageio.stream.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

protected AbstractQuickTimeStream.WideDataAtom mdatAtom
This atom holds the media data.


mdatOffset

protected long mdatOffset
Offset for the mdat atom.


moovAtom

protected AbstractQuickTimeStream.CompositeAtom moovAtom
This atom holds the moovie header.


creationTime

protected java.util.Date creationTime
Creation time of the movie.


modificationTime

protected java.util.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.


tracks

protected java.util.ArrayList<AbstractQuickTimeStream.Track> tracks
The list of tracks in the movie.


movieMatrix

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


state

protected AbstractQuickTimeStream.States state
The current state of the movie output stream.

Constructor Detail

AbstractQuickTimeStream

public AbstractQuickTimeStream()
Method Detail

getRelativeStreamPosition

protected long getRelativeStreamPosition()
                                  throws java.io.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:
java.io.IOException

seekRelative

protected void seekRelative(long newPosition)
                     throws java.io.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:
java.io.IOException

typeToInt

protected static int typeToInt(java.lang.String str)

intToType

protected static java.lang.String intToType(int id)

Copyright 2012-04-26 Werner Randelshofer