mediaframe.mpeg1
Class VideoFrame

java.lang.Object
  |
  +--mediaframe.mpeg1.DataFrame
        |
        +--mediaframe.mpeg1.VideoFrame

public class VideoFrame
extends DataFrame

The VideoFrame class represents one I/P/B-frame, an Sequence-header or an GOP-start. It extends the DataFrame class and contains methods for reading of the video packet.


Field Summary
private  java.io.InputStream _is
          The input stream with movie's data.
private  long _long
          The last 4 bytes in the input stream.
private  DataBuffer audioBuffer
          The buffer for audio data.
private  DataBuffer videoBuffer
          The buffer for video data.
 
Fields inherited from class mediaframe.mpeg1.DataFrame
_eof, _time_stamp, _type, B_FRAME, file_position, GOP_START, I_FRAME, MASK, P_FRAME, SEQ_START, size, TYPE_AUDIO
 
Constructor Summary
VideoFrame(long time, DataBuffer videoBuffer, DataBuffer audioBuffer)
          Constructs a VideoFrame object using the specified time stamp value and buffers for audio and video data.
 
Method Summary
 long fill(java.io.InputStream is, long next32)
          This routine reads video data into the buffer from the input stream to byte which equals 1 or until the end of the file will be reached.
private  void read_to_1()
          This routine reads the data from the input stream to byte which equals 1.
private  void read()
          This routine reads one byte of the data from the input stream.
 void skip_1b2()
          This routine skips the data from the input stream to byte which equals 0x1b2.
 void skip_1b9()
          This routine skips the data from the input stream to byte which equals 0x1b9.
 void skip_1ba()
          This routine skips the data from the input stream to byte which equals 0x1ba.
 void skip_1bb()
          This routine skips the data from the input stream to byte which equals 0x1bb.
 void skip_1be()
          This routine skips the data from the input stream to byte which equals 0x1be.
 void skip_1c0()
          This routine skips the data from the input stream to byte which equals 0x1c0.
 void skip_1e0()
          This routine skips the data from the input stream to byte which equals 0x1e0.
private  void skip_to_1()
          This routine skips the data from the input stream to byte which equals 1.
private  void skip()
          Skips one byte from the input stream.
 
Methods inherited from class mediaframe.mpeg1.DataFrame
getFilePosition, getFirstDataBlock, getTimeStamp, getType, setType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_long

private long _long
The last 4 bytes in the input stream.


_is

private java.io.InputStream _is
The input stream with movie's data.


audioBuffer

private DataBuffer audioBuffer
The buffer for audio data.


videoBuffer

private DataBuffer videoBuffer
The buffer for video data.

Constructor Detail

VideoFrame

public VideoFrame(long time,
                  DataBuffer videoBuffer,
                  DataBuffer audioBuffer)
Constructs a VideoFrame object using the specified time stamp value and buffers for audio and video data.

Parameters:
time - the time stamp value of the frame.
videoBuffer - the buffer for video data.
audioBuffer - the buffer for audio data.
Method Detail

fill

public long fill(java.io.InputStream is,
                 long next32)
          throws java.lang.Exception
This routine reads video data into the buffer from the input stream to byte which equals 1 or until the end of the file will be reached. Calls the routines that read or skip the blocks of movie's data.

Parameters:
is - the input stream with movie's data.
next32 - the last 4 bytes from the input stream.
Returns:
the last 4 bytes in the stream.
Throws:
java.lang.Exception - if an error occurs.

skip_1e0

public void skip_1e0()
              throws java.lang.Exception
This routine skips the data from the input stream to byte which equals 0x1e0.

Throws:
java.lang.Exception - if an error occurs.

skip_1c0

public void skip_1c0()
              throws java.lang.Exception
This routine skips the data from the input stream to byte which equals 0x1c0. After that it creates audio frame and starts filling this frame with the data.

Throws:
java.lang.Exception - if an error occurs.

skip_1ba

public void skip_1ba()
              throws java.lang.Exception
This routine skips the data from the input stream to byte which equals 0x1ba.

Throws:
java.lang.Exception - if an error occurs.

skip_1bb

public void skip_1bb()
              throws java.lang.Exception
This routine skips the data from the input stream to byte which equals 0x1bb.

Throws:
java.lang.Exception - if an error occurs.

skip_1be

public void skip_1be()
              throws java.lang.Exception
This routine skips the data from the input stream to byte which equals 0x1be.

Throws:
java.lang.Exception - if an error occurs.

skip_1b9

public void skip_1b9()
              throws java.lang.Exception
This routine skips the data from the input stream to byte which equals 0x1b9.

Throws:
java.lang.Exception - if an error occurs.

skip_1b2

public void skip_1b2()
              throws java.lang.Exception
This routine skips the data from the input stream to byte which equals 0x1b2.

Throws:
java.lang.Exception - if an error occurs.

read

private void read()
           throws java.lang.Exception
This routine reads one byte of the data from the input stream.

Throws:
java.lang.Exception - if an error occurs.

skip

private void skip()
           throws java.lang.Exception
Skips one byte from the input stream.

Throws:
java.lang.Exception - if an error occurs.

read_to_1

private void read_to_1()
                throws java.lang.Exception
This routine reads the data from the input stream to byte which equals 1.

Throws:
java.lang.Exception - if an error occurs.

skip_to_1

private void skip_to_1()
                throws java.lang.Exception
This routine skips the data from the input stream to byte which equals 1.

Throws:
java.lang.Exception - if an error occurs.