|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--mediaframe.mpeg1.DataBuffer
A DataBuffer object represents a data stream (container of the information data blocks).
It contains methods for storing and reading the information from the stream.
| Field Summary | |
private long |
_start_time
The start time of the reading side. |
private long |
_time_stamp
The time stamp of the current frame to read. |
private int |
currentFrameIndex
The frame index of the current frame in the vector of the frames to read the data. |
private DataBlock |
currentReadBlock
The current data block to read the data. |
private DataFrame |
currentReadFrame
The current frame to read the data. |
private DataBlock |
currentWriteBlock
The current data block to write the data. |
private DataFrame |
currentWriteFrame
The current frame to write the data. |
private boolean |
EOF
True, if the end of the file has been reached. |
private java.util.Vector |
Frames
The vector of the frames. |
private int |
lastSize
The size the last information word (0-4). |
private long |
lastWord
The last 0-4 information bytes (the last information word). |
private MPEG_Reader |
reader
The MPEG_reader object (reader of the mpeg stream). |
private int |
type
The type of the stream (video or audio). |
| Constructor Summary | |
DataBuffer(int type,
MPEG_Reader reader)
Constructs a DataBuffer with the specified type and MPEG_reader. |
|
| Method Summary | |
void |
addToStartTime(long wait)
Adds the specified value to the start playing time. |
int |
getBufferPosition()
Gets current position of the buffer. |
DataFrame |
getCurrentReadFrame()
Gets the current frame to read. |
long |
getCurrentTime()
Returns time in milliseconds callibrated from the start of the movie. |
void |
initReaderSide()
Resets the reader's side to zero state. |
boolean |
isEOF()
Returns end of file flag. |
void |
printPercent(int currentPercent)
Prints the current "buffering" percent. |
DataBlock |
readNextBlock()
Reads the next DataBlock from the movie's buffer.
|
void |
registerNewFrame(DataFrame newFrame)
Registers the new frame to read movie's data. |
void |
saveCurrentFrame()
Saves the current frame into the buffer. |
void |
saveLastFrame()
Saves the current frame into the buffer as a last frame in the movie file. |
private void |
setNewBlock()
Adds the length of the block to the total amount of the readed bytes. |
void |
setStartTime(long time)
Sets the start playing time to the specified value. |
void |
write(int Byte)
Puts the next information byte into the buffer of movie's data. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
private int type
io_tool.TYPE_AUDIO,
io_tool.TYPE_VIDEOprivate java.util.Vector Frames
private int currentFrameIndex
private DataBlock currentWriteBlock
private DataBlock currentReadBlock
private DataFrame currentWriteFrame
private DataFrame currentReadFrame
private boolean EOF
private MPEG_Reader reader
MPEG_reader object (reader of the mpeg stream).
private long _time_stamp
private long _start_time
private long lastWord
private int lastSize
| Constructor Detail |
public DataBuffer(int type,
MPEG_Reader reader)
DataBuffer with the specified type and MPEG_reader.
type - the type of the DataBuffer (video or audio).reader - the MPEG_reader object (reader of the mpeg stream).| Method Detail |
public void initReaderSide()
public final DataBlock readNextBlock()
throws java.io.EOFException,
java.lang.InterruptedException
DataBlock from the movie's buffer.
If necessary waits for the writer process for the next block of data
and calls the method that starts the "rebuffering" process of the applet
after the free buffer size is less then the min buffer size.
Sets EOF flag to true value if the end of the file has been reached.
java.io.EOFException - if end of the file has been reached.
java.lang.InterruptedException - if another process interrupts the current process.private void setNewBlock()
public DataFrame getCurrentReadFrame()
public void write(int Byte)
Byte - the next information byte to put.public void printPercent(int currentPercent)
currentPercent - the current percent.public void saveCurrentFrame()
public void saveLastFrame()
public boolean isEOF()
public void registerNewFrame(DataFrame newFrame)
newFrame - the frame to register.public void addToStartTime(long wait)
wait - the value to add.public void setStartTime(long time)
time - the start playing time value to set.public long getCurrentTime()
public int getBufferPosition()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||