Jitsi: the OpenSource Java VoIP and Instant Messaging client.

net.java.sip.communicator.impl.neomedia.protocol
Class StreamSubstituteBufferTransferHandler

java.lang.Object
  extended by net.java.sip.communicator.impl.neomedia.protocol.StreamSubstituteBufferTransferHandler
All Implemented Interfaces:
javax.media.protocol.BufferTransferHandler

public class StreamSubstituteBufferTransferHandler
extends Object
implements javax.media.protocol.BufferTransferHandler

Implements a BufferTransferHandler wrapper which doesn't expose a PushBufferStream but rather a specific substitute in order to give full control to the PushBufferStream.read(javax.media.Buffer) method of the substitute.

The purpose is achieved in #transferData(PushBufferStream) where the method argument stream is ignored and the substitute is used instead.

Author:
Lubomir Marinov

Constructor Summary
StreamSubstituteBufferTransferHandler(javax.media.protocol.BufferTransferHandler transferHandler, javax.media.protocol.PushBufferStream stream, javax.media.protocol.PushBufferStream substitute)
          Initializes a new StreamSubstituteBufferTransferHandler instance which is to overwrite the source PushBufferStream of a specific BufferTransferHandler.
 
Method Summary
 void transferData(javax.media.protocol.PushBufferStream stream)
          Implements BufferTransferHandler#transferData(PushBufferStream).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StreamSubstituteBufferTransferHandler

public StreamSubstituteBufferTransferHandler(javax.media.protocol.BufferTransferHandler transferHandler,
                                             javax.media.protocol.PushBufferStream stream,
                                             javax.media.protocol.PushBufferStream substitute)
Initializes a new StreamSubstituteBufferTransferHandler instance which is to overwrite the source PushBufferStream of a specific BufferTransferHandler.

Parameters:
transferHandler - the BufferTransferHandler the new instance is to overwrite the source PushBufferStream of
stream - the PushBufferStream to be overridden for the specified transferHandler with the specified substitute
substitute - the PushBufferStream to override the specified stream for the specified transferHandler
Method Detail

transferData

public void transferData(javax.media.protocol.PushBufferStream stream)
Implements BufferTransferHandler#transferData(PushBufferStream). Puts in place the essence of the StreamSubstituteBufferTransferHandler class which is to report to the transferHandler from the same PushBufferStream to which it was set so that the substitute can gain full control.

Specified by:
transferData in interface javax.media.protocol.BufferTransferHandler
Parameters:
stream - the PushBufferStream to transfer

Jitsi: the OpenSource Java VoIP and Instant Messaging client.

Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under LGPL license.