Class ControlTransformInputStream

  • All Implemented Interfaces:
    Closeable, AutoCloseable, javax.media.Controls, javax.media.protocol.Controls, javax.media.protocol.PushSourceStream, javax.media.protocol.SourceStream

    public class ControlTransformInputStream
    extends RTPConnectorUDPInputStream
    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
    • 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

      • addRTCPFeedbackMessageListener

        public void addRTCPFeedbackMessageListener​(RTCPFeedbackMessageListener listener)
        Adds an RTCPFeedbackMessageListener.
        Parameters:
        listener - the RTCPFeedbackMessageListener to add
      • removeRTCPFeedbackMessageListener

        public void removeRTCPFeedbackMessageListener​(RTCPFeedbackMessageListener listener)
        Removes an RTCPFeedbackMessageListener.
        Parameters:
        listener - the RTCPFeedbackMessageListener to remove
      • read

        protected int read​(javax.media.Buffer buffer,
                           byte[] data,
                           int offset,
                           int length)
                    throws IOException
        Copies the content of the most recently received packet into data.
        Overrides:
        read in class RTPConnectorInputStream<DatagramSocket>
        Parameters:
        buffer - an optional Buffer instance associated with the specified data, offset and length and provided to the method in case the implementation would like to provide additional Buffer properties such as flags
        data - 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 data.
        length - the number of bytes available for writing in data.
        Returns:
        the number of bytes read
        Throws:
        IOException - if length is less than the size of the packet.