|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
This interface is implemented by a SourceStream
that caches
downloaded data for fast delivery to the handler. It provides control
over enabling/disabling the buffering and provides a way to query if
a certain number of bytes are available to be read from the stream.
Buffering here refers to jitter-buffering. Buffering is normally enabled. It enables smooth playback even if the incoming data rate fluctuates. The amount of buffering is implementation dependant.
When parsing the header of a media file, the parser may want to read a few bytes to check for say a valid magic header; if the magic header is illegal, the parser can throw a BadHeaderException. The parser may build several tables and extract media track information.
The parser typically doen't need to wait for the buffers to be filled. So it is desirable to turn off buffering when parsing the header and turn it on after the header is read. This won't have any effect on playback smoothness since playback cannot start until the header is parsed.
PullSourceStream
,
PushSourceStream
Method Summary | |
void |
abortRead()
Aborts a read if it is in progress. |
boolean |
getEnabledBuffering()
Tells if buffering is currently enabled or not. |
void |
setEnabledBuffering(boolean b)
This method is used by the parser to turn off buffering while the header is being read. |
boolean |
willReadBytesBlock(int numBytes)
Will read numBytes block? Will return true unless numBytes bytes can be read in one read call. |
boolean |
willReadBytesBlock(long offset,
int numBytes)
Will seek to offset and read numBytes block? Will return true unless numBytes bytes can be read in one read call. |
Method Detail |
public void setEnabledBuffering(boolean b)
public boolean getEnabledBuffering()
public boolean willReadBytesBlock(long offset, int numBytes)
read
call.public boolean willReadBytesBlock(int numBytes)
read
call.public void abortRead()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |