Class StreamConnectorDelegate<T extends StreamConnector>

  • Type Parameters:
    T - the very type of the StreamConnector wrapped by StreamConnectorDelegate
    All Implemented Interfaces:
    StreamConnector

    public class StreamConnectorDelegate<T extends StreamConnector>
    extends Object
    implements StreamConnector
    Implements a StreamConnector which wraps a specific StreamConnector instance.
    Author:
    Lyubomir Marinov
    • Field Detail

      • streamConnector

        protected final T extends StreamConnector streamConnector
        The StreamConnector wrapped by this instance.
    • Constructor Detail

      • StreamConnectorDelegate

        public StreamConnectorDelegate​(T streamConnector)
        Initializes a new StreamConnectorDelegate which is to wrap a specific StreamConnector.
        Parameters:
        streamConnector - the StreamConnector to be wrapped by the new instance
    • Method Detail

      • close

        public void close()
        Releases the resources allocated by this instance in the course of its execution and prepares it to be garbage collected. Calls StreamConnector.close() on the StreamConnector wrapped by this instance.
        Specified by:
        close in interface StreamConnector
      • getControlSocket

        public DatagramSocket getControlSocket()
        Returns a reference to the DatagramSocket that a stream should use for control data (e.g. RTCP).
        Specified by:
        getControlSocket in interface StreamConnector
        Returns:
        a reference to the DatagramSocket that a stream should use for control data (e.g. RTCP) or null if this StreamConnector does not handle UDP sockets.
      • getControlTCPSocket

        public Socket getControlTCPSocket()
        Returns a reference to the Socket that a stream should use for control data (e.g. RTCP).
        Specified by:
        getControlTCPSocket in interface StreamConnector
        Returns:
        a reference to the Socket that a stream should use for control data (e.g. RTCP) or null if this StreamConnector does not handle TCP sockets.
      • getDataSocket

        public DatagramSocket getDataSocket()
        Returns a reference to the DatagramSocket that a stream should use for data (e.g. RTP) traffic.
        Specified by:
        getDataSocket in interface StreamConnector
        Returns:
        a reference to the DatagramSocket that a stream should use for data (e.g. RTP) traffic or null if this StreamConnector does not handle UDP sockets.
      • getDataTCPSocket

        public Socket getDataTCPSocket()
        Returns a reference to the Socket that a stream should use for data (e.g. RTP) traffic.
        Specified by:
        getDataTCPSocket in interface StreamConnector
        Returns:
        a reference to the Socket that a stream should use for data (e.g. RTP) traffic or null if this StreamConnector does not handle TCP sockets.
      • started

        public void started()
        Notifies this instance that utilization of its DatagramSockets for data and/or control traffic has started.
        Specified by:
        started in interface StreamConnector
      • stopped

        public void stopped()
        Notifies this instance that utilization of its DatagramSockets for data and/or control traffic has temporarily stopped. This instance should be prepared to be started at a later time again though.
        Specified by:
        stopped in interface StreamConnector
      • isRtcpmux

        public boolean isRtcpmux()
        Returns true if this StreamConnector uses rtcp-mux, that is, if its data and control sockets share the same local address and port.
        Specified by:
        isRtcpmux in interface StreamConnector
        Returns:
        true if this StreamConnector uses rtcp-mux, that is, if its data and control sockets share the same local address and port.