Class RTCPConnectorInputStream

  • All Implemented Interfaces:
    Closeable, AutoCloseable, javax.media.Controls, javax.media.protocol.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
    • 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

      • addRTCPFeedbackMessageListener

        public void addRTCPFeedbackMessageListener​(RTCPFeedbackMessageListener listener)
        Add an RTCPFeedbackMessageListener.
        Parameters:
        listener - object that will listen to incoming RTCP feedback messages.
      • fireRTCPFeedbackMessageReceived

        public static void fireRTCPFeedbackMessageReceived​(Object source,
                                                           byte[] buffer,
                                                           int offset,
                                                           int length,
                                                           List<RTCPFeedbackMessageListener> listeners)
        Notifies a specific list of RTCPFeedbackMessageListeners about a specific RTCP feedback message if such a message can be parsed out of a specific byte buffer.
        Parameters:
        source - the object to be reported as the source of the RTCPFeedbackMessageEvent to be fired
        buffer - the byte buffer which may specific an RTCP feedback message
        offset - the offset in buffer at which the reading of bytes is to begin
        length - the number of bytes in buffer to be read for the purposes of parsing an RTCP feedback message and firing an RTPCFeedbackEvent
        listeners - the list of RTCPFeedbackMessageListeners to be notified about the specified RTCP feedback message if such a message can be parsed out of the specified buffer
      • removeRTCPFeedbackMessageListener

        public void removeRTCPFeedbackMessageListener​(RTCPFeedbackMessageListener listener)
        Remove an RTCPFeedbackMessageListener.
        Parameters:
        listener - object to remove from listening RTCP feedback messages.
      • 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.