|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--mediaframe.mpeg1.io_tool
The io_tool class implements the functionality
for accessing to the input movie's data stream as a bit stream.
It contains methods for reading, skiping, matching with the pattern,
giving "back" next/previous "n" bits from/to the data stream.
| Field Summary | |
private int |
_type
The type of the stream to read (audio/video). |
(package private) int |
bit_pos
The bit-"pointer", contains the number of the current bit in the bit shift register. |
private int |
BlockPos
The byte-"pointer", contains the number of the current byte in the data block. |
private int |
BlockSize
The size of the current data block in bytes. |
private DataBuffer |
buffer
The current DataBuffer with the movie's data to read. |
private long[] |
Data
The movie's data of the current data block. |
private boolean |
eof
True if the end of the file has been reached. |
private long |
longword
The bit shift register. |
static int |
TYPE_AUDIO
The Audio type of the input stream. |
static int |
TYPE_VIDEO
The Video type of the input stream. |
| Constructor Summary | |
io_tool(int type,
DataBuffer buffer)
Constructs an io_tool object with the specified values. |
|
| Method Summary | |
int |
get_bits(int n)
The method "get_bits" gets the next "n" bits from shift register interprets them as integer and returns this integer value. |
private void |
get_long()
The method "get_long" grabs "bytes" from data input stream into the shift register "longword". |
DataBuffer |
getBuffer()
Gets the current DataBuffer with the movie's data for reading. |
boolean |
is_eof()
Returns the end of the file flag value. |
boolean |
next_bits(int pattern,
int n)
The method "next_bits" checks whether the next "n" bits match the "pattern". |
void |
next_start_code()
The method "next_start_code" aligns the bit "pointer" to the next byte and tries to find the next MPEG start code. |
private void |
nextBlock()
Gets next block of movie's data from the buffer and stores it't data into the local variables. |
int |
peek_bits(int n)
The method "peek_bits" is like get_bits except it leaves the bits in the shift register. |
void |
skip_bits(int n)
The method "skip_bits" skips the next "n" bits from shift register. |
void |
skip(long n)
The method "skip(long n)" skips over n bytes but takes into account that
some of them are already in shift register. |
void |
unget_bits(int n)
The method "unget_bits" gives "n" bits back to the IO system. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
private int _type
public static final int TYPE_AUDIO
public static final int TYPE_VIDEO
int bit_pos
private long longword
private boolean eof
private DataBuffer buffer
DataBuffer with the movie's data to read.
private long[] Data
private int BlockSize
private int BlockPos
| Constructor Detail |
public io_tool(int type,
DataBuffer buffer)
io_tool object with the specified values.
type - the type of the input stream.buffer - the buffer with the movie's data.| Method Detail |
public final DataBuffer getBuffer()
DataBuffer with the movie's data for reading.
DataBuffer object.public final boolean is_eof()
public final void skip(long n)
throws java.lang.InterruptedException,
java.io.EOFException
n bytes but takes into account that
some of them are already in shift register.
n - the number of bytes to skip.
java.lang.InterruptedException - raises if another process interrupts the current process.
java.io.EOFException - raises if the end of the file has been reached.
private final void get_long()
throws java.lang.InterruptedException,
java.io.EOFException
java.lang.InterruptedException - raises if another process interrupts the current process.
java.io.EOFException - raises if the end of the file has been reached.
public final int get_bits(int n)
throws java.lang.InterruptedException,
java.io.EOFException
n - the amount of bits to get.
java.lang.InterruptedException - raises if another process interrupts the current process.
java.io.EOFException - raises if the end of the file has been reached.
public final void skip_bits(int n)
throws java.lang.InterruptedException,
java.io.EOFException
n - the amount of bits to skip.
java.lang.InterruptedException - raises if another process interrupts the current process.
java.io.EOFException - raises if the end of the file has been reached.
public final boolean next_bits(int pattern,
int n)
throws java.lang.InterruptedException,
java.io.EOFException
pattern - the pattern to match.n - the number of bits in the pattern.
java.lang.InterruptedException - raises if another process interrupts the current process.
java.io.EOFException - raises if the end of the file has been reached.
public final int peek_bits(int n)
throws java.lang.InterruptedException,
java.io.EOFException
n - the number of bits to get.
java.lang.InterruptedException - raises if another process interrupts the current process.
java.io.EOFException - raises if the end of the file has been reached.public final void unget_bits(int n)
n - the number of bits to unget.
public final void next_start_code()
throws java.lang.InterruptedException,
java.io.EOFException
java.lang.InterruptedException - raises if another process interrupts the current process.
java.io.EOFException - raises if the end of the file has been reached.
private final void nextBlock()
throws java.io.EOFException,
java.lang.InterruptedException
java.lang.InterruptedException - raises if another process interrupts the current process.
java.io.EOFException - raises if the end of the file has been reached.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||