|
Jitsi: the OpenSource Java VoIP and Instant Messaging client. | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.java.sip.communicator.impl.neomedia.protocol.CachingPushBufferStream
public class CachingPushBufferStream
Enables reading from a PushBufferStream a certain maximum number of data units (e.g. bytes, shorts, ints) even if the PushBufferStream itself pushes a larger number of data units.
An example use of this functionality is pacing a PushBufferStream which pushes more data units in a single step than a CaptureDevice. When these two undergo audio mixing, the different numbers of per-push data units will cause the PushBufferStream "play" itself faster than the CaptureDevice.
| Field Summary | |
|---|---|
static long |
DEFAULT_BUFFER_LENGTH
The default length in milliseconds of the buffering to be performed by CachePushBufferStreams. |
| Fields inherited from interface javax.media.protocol.SourceStream |
|---|
LENGTH_UNKNOWN |
| Constructor Summary | |
|---|---|
CachingPushBufferStream(javax.media.protocol.PushBufferStream stream)
Initializes a new CachingPushBufferStream instance which is to pace the number of per-push data units a specific PushBufferStream provides. |
|
| Method Summary | |
|---|---|
boolean |
endOfStream()
Implements SourceStream.endOfStream(). |
javax.media.protocol.ContentDescriptor |
getContentDescriptor()
Implements SourceStream.getContentDescriptor(). |
long |
getContentLength()
Implements SourceStream.getContentLength(). |
Object |
getControl(String controlType)
Implements Controls.getControl(String). |
Object[] |
getControls()
Implements Controls.getControls(). |
javax.media.Format |
getFormat()
Implements PushBufferStream.getFormat(). |
javax.media.protocol.PushBufferStream |
getStream()
Gets the PushBufferStream wrapped by this instance. |
void |
read(javax.media.Buffer buffer)
Implements PushBufferStream.read(Buffer). |
void |
setTransferHandler(javax.media.protocol.BufferTransferHandler transferHandler)
Implements PushBufferStream.setTransferHandler(BufferTransferHandler). |
protected void |
transferData(javax.media.protocol.BufferTransferHandler transferHandler)
Reads data from the wrapped/input PushBufferStream into the cache of this stream if the cache accepts it. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final long DEFAULT_BUFFER_LENGTH
| Constructor Detail |
|---|
public CachingPushBufferStream(javax.media.protocol.PushBufferStream stream)
stream - the PushBufferStream to be paced with respect to
the number of per-push data units it provides| Method Detail |
|---|
public boolean endOfStream()
SourceStream.endOfStream(). Delegates to the wrapped
PushBufferStream when the cache of this instance is fully read;
otherwise, returns false.
endOfStream in interface javax.media.protocol.SourceStreampublic javax.media.protocol.ContentDescriptor getContentDescriptor()
SourceStream.getContentDescriptor(). Delegates to the
wrapped PushBufferStream.
getContentDescriptor in interface javax.media.protocol.SourceStreampublic long getContentLength()
SourceStream.getContentLength(). Delegates to the
wrapped PushBufferStream.
getContentLength in interface javax.media.protocol.SourceStreampublic Object getControl(String controlType)
Controls.getControl(String). Delegates to
the wrapped PushBufferStream and gives access to the
BufferControl of this instance if such a controlType is
specified and the wrapped PushBufferStream does not have such a
control available.
getControl in interface javax.media.ControlscontrolType - a String value which names the type of the
control of the wrapped PushBufferStream to be retrieved
public Object[] getControls()
Controls.getControls(). Delegates to the
wrapped PushBufferStream and adds the BufferControl of
this instance if the wrapped PushBufferStream does not have a
control of such type available.
getControls in interface javax.media.Controlspublic javax.media.Format getFormat()
PushBufferStream.getFormat(). Delegates to the wrapped
PushBufferStream.
getFormat in interface javax.media.protocol.PushBufferStreampublic javax.media.protocol.PushBufferStream getStream()
public void read(javax.media.Buffer buffer)
throws IOException
PushBufferStream.read(Buffer). If an
IOException has been thrown by the wrapped stream when data was
last read from it, re-throws it. If there has been no such exception,
reads from the cache of this instance.
read in interface javax.media.protocol.PushBufferStreambuffer - the Buffer to receive the read media data
IOException - if the wrapped stream has thrown such an exception
when data was last read from itpublic void setTransferHandler(javax.media.protocol.BufferTransferHandler transferHandler)
PushBufferStream.setTransferHandler(BufferTransferHandler).
Delegates to the wrapped PushBufferStream but wraps the specified
BufferTransferHandler in order to intercept the calls to
BufferTransferHandler.transferData(PushBufferStream) and read
data from the wrapped PushBufferStream into the cache during the
calls in question.
setTransferHandler in interface javax.media.protocol.PushBufferStreamtransferHandler - the BufferTransferHandler to be notified
by this PushBufferStream when media data is available for
readingprotected void transferData(javax.media.protocol.BufferTransferHandler transferHandler)
transferHandler - the BufferTransferHandler which has been
notified
|
Jitsi: the OpenSource Java VoIP and Instant Messaging client. | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||