Jitsi: the OpenSource Java VoIP and Instant Messaging client.

net.java.sip.communicator.impl.neomedia.transform
Class ControlTransformInputStream

java.lang.Object
  extended by net.java.sip.communicator.impl.neomedia.RTPConnectorInputStream
      extended by net.java.sip.communicator.impl.neomedia.RTPConnectorUDPInputStream
          extended by net.java.sip.communicator.impl.neomedia.transform.TransformUDPInputStream
              extended by net.java.sip.communicator.impl.neomedia.transform.ControlTransformInputStream
All Implemented Interfaces:
Runnable, javax.media.Controls, javax.media.protocol.PushSourceStream, javax.media.protocol.SourceStream

public class ControlTransformInputStream
extends TransformUDPInputStream

Implement control channel (RTCP) for TransformInputStream which notify listeners when RTCP feedback messages are received.

Author:
Bing SU (nova.su@gmail.com), Lyubomir Marinov, Sebastien Vincent

Field Summary
 
Fields inherited from class net.java.sip.communicator.impl.neomedia.RTPConnectorInputStream
closed, ioError, pkt, receiverThread
 
Fields inherited from interface javax.media.protocol.SourceStream
LENGTH_UNKNOWN
 
Constructor Summary
ControlTransformInputStream(DatagramSocket socket)
          Initializes a new ControlTransformInputStream which is to receive packet data from a specific UDP socket.
 
Method Summary
 void addRTCPFeedbackListener(RTCPFeedbackListener listener)
          Adds an RTCPFeedbackListener.
 int read(byte[] inBuffer, int offset, int length)
          Copies the content of the most recently received packet into inBuffer.
 void removeRTCPFeedbackListener(RTCPFeedbackListener listener)
          Removes an RTCPFeedbackListener.
 
Methods inherited from class net.java.sip.communicator.impl.neomedia.transform.TransformUDPInputStream
createRawPacket, getTransformer, setTransformer
 
Methods inherited from class net.java.sip.communicator.impl.neomedia.RTPConnectorUDPInputStream
close, doLogPacket, receivePacket
 
Methods inherited from class net.java.sip.communicator.impl.neomedia.RTPConnectorInputStream
endOfStream, getContentDescriptor, getContentLength, getControl, getControls, getMinimumTransferSize, run, setPriority, setTransferHandler
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ControlTransformInputStream

public ControlTransformInputStream(DatagramSocket socket)
Initializes a new ControlTransformInputStream which is to receive packet data from a specific UDP socket.

Parameters:
socket - the UDP socket the new instance is to receive data from
Method Detail

addRTCPFeedbackListener

public void addRTCPFeedbackListener(RTCPFeedbackListener listener)
Adds an RTCPFeedbackListener.

Parameters:
listener - the RTCPFeedbackListener to add

removeRTCPFeedbackListener

public void removeRTCPFeedbackListener(RTCPFeedbackListener listener)
Removes an RTCPFeedbackListener.

Parameters:
listener - the RTCPFeedbackListener to remove

read

public int read(byte[] inBuffer,
                int offset,
                int length)
         throws IOException
Copies the content of the most recently received packet into inBuffer.

Specified by:
read in interface javax.media.protocol.PushSourceStream
Overrides:
read in class RTPConnectorInputStream
Parameters:
inBuffer - the byte[] that we'd like to copy the content of the packet to.
offset - the position where we are supposed to start writing in inBuffer.
length - the number of bytes available for writing in inBuffer.
Returns:
the number of bytes read
Throws:
IOException - if length is less than the size of the packet.

Jitsi: the OpenSource Java VoIP and Instant Messaging client.

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