Jitsi: the OpenSource Java VoIP and Instant Messaging client.

net.java.sip.communicator.impl.neomedia
Class RTCPConnectorInputStream

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.RTCPConnectorInputStream
All Implemented Interfaces:
Runnable, javax.media.Controls, javax.media.protocol.PushSourceStream, javax.media.protocol.SourceStream

public class RTCPConnectorInputStream
extends RTPConnectorUDPInputStream

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
RTCPConnectorInputStream(DatagramSocket socket)
          Initializes a new RTCPConnectorInputStream which is to receive packet data from a specific UDP socket.
 
Method Summary
 void addRTCPFeedbackListener(RTCPFeedbackListener listener)
          Add 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)
          Remove an RTCPFeedbackListener.
 
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
createRawPacket, 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

RTCPConnectorInputStream

public RTCPConnectorInputStream(DatagramSocket socket)
Initializes a new RTCPConnectorInputStream 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)
Add an RTCPFeedbackListener.

Parameters:
listener - object that will listen to incoming RTCP feedback messages.

removeRTCPFeedbackListener

public void removeRTCPFeedbackListener(RTCPFeedbackListener listener)
Remove an RTCPFeedbackListener.

Parameters:
listener - object to remove from listening RTCP feedback messages.

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.