Interface StreamConnector

  • All Known Implementing Classes:
    DefaultStreamConnector, DefaultTCPStreamConnector, StreamConnectorDelegate

    public interface StreamConnector
    The StreamConnector interface represents a pair of datagram sockets that a media stream could use for RTP and RTCP traffic.

    The reason why this media service makes sockets visible through this StreamConnector is so that they could be shared among media and other libraries that may need to use them like an ICE implementation for example.

    Author:
    Emil Ivov
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Interface Description
      static class  StreamConnector.Protocol
      Enumerates the protocols supported by StreamConnector.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void close()
      Releases the resources allocated by this instance in the course of its execution and prepares it to be garbage collected.
      DatagramSocket getControlSocket()
      Returns a reference to the DatagramSocket that a stream should use for control data (e.g.
      Socket getControlTCPSocket()
      Returns a reference to the Socket that a stream should use for control data (e.g.
      DatagramSocket getDataSocket()
      Returns a reference to the DatagramSocket that a stream should use for data (e.g.
      Socket getDataTCPSocket()
      Returns a reference to the Socket that a stream should use for data (e.g.
      StreamConnector.Protocol getProtocol()
      Returns the protocol of this StreamConnector.
      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.
      void started()
      Notifies this instance that utilization of its DatagramSockets for data and/or control traffic has started.
      void stopped()
      Notifies this instance that utilization of its DatagramSockets for data and/or control traffic has temporarily stopped.
    • Method Detail

      • getDataSocket

        DatagramSocket getDataSocket()
        Returns a reference to the DatagramSocket that a stream should use for data (e.g. RTP) traffic.
        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.
      • getControlSocket

        DatagramSocket getControlSocket()
        Returns a reference to the DatagramSocket that a stream should use for control data (e.g. RTCP).
        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.
      • getDataTCPSocket

        Socket getDataTCPSocket()
        Returns a reference to the Socket that a stream should use for data (e.g. RTP) traffic.
        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.
      • getControlTCPSocket

        Socket getControlTCPSocket()
        Returns a reference to the Socket that a stream should use for control data (e.g. RTCP).
        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.
      • getProtocol

        StreamConnector.Protocol getProtocol()
        Returns the protocol of this StreamConnector.
        Returns:
        the protocol of this StreamConnector
      • close

        void close()
        Releases the resources allocated by this instance in the course of its execution and prepares it to be garbage collected.
      • started

        void started()
        Notifies this instance that utilization of its DatagramSockets for data and/or control traffic has started.
      • stopped

        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.
      • isRtcpmux

        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.
        Returns:
        true if this StreamConnector uses rtcp-mux, that is, if its data and control sockets share the same local address and port.