protected abstract class AbstractAVIStream.Track
extends java.lang.Object
A track is defined
by an "strh" chunk, which contains an AVISTREAMHEADER
struct.
Additional chunks can be provided depending on the media type of the
track.
See http://msdn.microsoft.com/en-us/library/ms779638(VS.85).aspx
----------------- AVI Stream Header ----------------- enum { audioStream = "auds", midiStream = "mids", textStream = "txts", videoStream = "vids" } aviStrhType; set { disabled = 0x00000001, // Indicates this stream should not be enabled by default. videoPaletteChanges = 0x00010000 // Indicates this video stream contains palette changes. This flag // warns the playback software that it will need to animate the palette. } aviStrhFlags; typedef struct { Int16 left; Int16 top; Int16 right; Int16 bottom; } aviRectangle; typedef struct { FOURCC enum aviStrhType type; // Contains a FOURCC that specifies the type of the data contained in // the stream. The following standard AVI values for video and audio are // defined. FOURCC handler; // Optionally, contains a FOURCC that identifies a specific data // handler. // The data handler is the preferred handler for the stream. For audio // and video streams, this specifies the codec for decoding the stream. DWORD set aviStrhFlags flags; // Contains any flags for the data stream. The bits in the high-order // word of these flags are specific to the type of data contained in the // stream. WORD priority; // Specifies priority of a stream type. For example, in a file with // multiple audio streams, the one with the highest priority might be // the default stream. WORD language; DWORD initialFrames; // Specifies how far audio data is skewed ahead of the video frames in // interleaved files. Typically, this is about 0.75 seconds. If you are // creating interleaved files, specify the number of frames in the file // prior to the initial frame of the AVI sequence in this member. For // more information about the contents of this member, see "Special // Information for Interleaved Files" in the Video for Windows // Programmer's Guide. DWORD scale; // Used with "rate" to specify the time scale that this stream will use. // Dividing "rate" by "scale" gives the number of samples per second. // For video streams, this is the frame rate. For audio streams, this // rate corresponds to the time needed to play blockAlign bytes of // audio, which for PCM audio is the just the sample rate. DWORD rate; // See "scale". DWORD startTime; // Specifies the starting time for this stream. The units are defined by // the "rate" and "scale" members in the main file header. Usually, this // is zero, but it can specify a delay time for a stream that does not // startTime concurrently with the file. DWORD length; // Specifies the length of this stream. The units are defined by the // "rate" and "scale" members of the stream's header. DWORD suggestedBufferSize; // Specifies how large a buffer should be used to read this stream. // Typically, this contains a value corresponding to the largest chunk // present in the stream. Using the correct buffer size makes playback // more efficient. Use zero if you do not know the correct buffer size. DWORD quality; // Specifies an indicator of the quality of the data in the stream. // Quality is represented as a number between 0 and 10,000. For // compressed data, this typically represents the value of the quality // parameter passed to the compression software. If set to �1, drivers // use the default quality value. DWORD sampleSize; // Specifies the size of a single sample of data. This is set to zero if // the samples can vary in size. If this number is nonzero, then // multiple samples of data can be grouped into a single chunk within // the file. If it is zero, each sample of data (such as a video frame) // must be in a separate chunk. For video streams, this number is // typically zero, although it can be nonzero if all video frames are // the same size. For audio streams, this number should be the same as // the blockAlign member of the WAVEFORMATEX structure describing the audio. aviRectangle frame; // Specifies the destination rectangle for a text or video stream within // the movie rectangle specified by the "frameWidth" and "frameHeight" // members of the AVI main header structure. The "frame" member is // typically used in support of multiple video streams. Set this // rectangle to the coordinates corresponding to the movie rectangle to // update the whole movie rectangle. Units for this member are pixels. // The upper-left corner of the destination rectangle is relative to the // upper-left corner of the movie rectangle. } AVISTREAMHEADER; *
Modifier and Type | Field and Description |
---|---|
protected Codec |
codec
The codec.
|
protected java.util.ArrayList<RIFFChunk> |
extraHeaders
List of additional header chunks.
|
protected int |
fccHandler
Optionally, contains a FOURCC that identifies a specific data
handler.
|
protected int |
flags
Contains any flags for the data stream.
|
protected Format |
format
The media format.
|
protected long |
initialFrames
Specifies how far audio data is skewed ahead of the video frames in
interleaved files.
|
protected Buffer |
inputBuffer
The input buffer is used when one of the convenience methods without
a Buffer parameter is used.
|
protected int |
language
Language tag.
|
protected long |
length
Specifies the length of this stream.
|
protected AbstractAVIStream.AVIMediaType |
mediaType
mediaType.fccType contains a FOURCC that specifies the type
of the data contained in the stream. |
protected java.lang.String |
name
The optional name of the track.
|
protected Buffer |
outputBuffer
The output buffer is used to store the output of the codec.
|
protected int |
priority
Specifies priority of a stream type.
|
protected int |
quality
Specifies an indicator of the quality of the data in the stream.
|
protected long |
rate
The rate of the media in scale units.
|
protected long |
readIndex
The current chunk index of the reader.
|
protected java.util.ArrayList<AbstractAVIStream.Sample> |
samples
List of samples.
|
protected long |
scale
Used with rate to specify the time scale that this stream will use.
|
protected long |
startTime
Specifies the starting time for this stream.
|
protected AbstractAVIStream.FixedSizeDataChunk |
strfChunk
This chunk holds the AVI Stream Format Header.
|
protected AbstractAVIStream.FixedSizeDataChunk |
strhChunk
This chunk holds the AVI Stream Header.
|
protected int |
syncInterval
Interval between sync samples (keyframes).
|
protected int |
twoCC
The twoCC code is used for the ids of the chunks which hold the data
samples.
|
Constructor and Description |
---|
Track(int trackIndex,
AbstractAVIStream.AVIMediaType mediaType,
int fourCC) |
Modifier and Type | Method and Description |
---|---|
void |
addSample(AbstractAVIStream.Sample s) |
abstract int |
getSampleChunkFourCC(boolean isSync) |
abstract long |
getSTRFChunkSize() |
protected Format format
protected java.util.ArrayList<AbstractAVIStream.Sample> samples
protected int syncInterval
protected int twoCC
protected final AbstractAVIStream.AVIMediaType mediaType
mediaType.fccType
contains a FOURCC that specifies the type
of the data contained in the stream. The following standard AVI
values for video and audio are defined.
FOURCC Description 'auds' Audio stream 'mids' MIDI stream 'txts' Text
stream 'vids' Video streamprotected int fccHandler
protected int flags
protected int priority
protected int language
protected long initialFrames
protected long scale
protected long rate
protected long startTime
protected long length
protected int quality
protected AbstractAVIStream.FixedSizeDataChunk strhChunk
protected AbstractAVIStream.FixedSizeDataChunk strfChunk
protected java.lang.String name
protected Codec codec
protected Buffer outputBuffer
protected Buffer inputBuffer
protected long readIndex
protected java.util.ArrayList<RIFFChunk> extraHeaders
public Track(int trackIndex, AbstractAVIStream.AVIMediaType mediaType, int fourCC)
public abstract long getSTRFChunkSize()
public abstract int getSampleChunkFourCC(boolean isSync)
public void addSample(AbstractAVIStream.Sample s)