Package 

Class Component

  • All Implemented Interfaces:
    java.beans.PropertyChangeListener , java.util.EventListener

    
    public class Component
     implements PropertyChangeListener
                        

    A component is a piece of a media stream requiring a single transport address; a media stream may require multiple components, each of which has to work for the media stream as a whole to work. For media streams based on RTP, there are two components per media stream - one for RTP, and one for RTCP.

    • Constructor Detail

    • Method Detail

      • getComponentID

         int getComponentID()

        Returns the ID of this Component. For RTP/RTCP flows this would be 1 for RTP and 2 for RTCP.

      • getDefaultCandidate

         LocalCandidate getDefaultCandidate()

        Returns the Candidate that has been selected as the default for this Component or null if no such Candidate has been selected yet. A candidate is said to be default if it would be the target of media from a non-ICE peer;

      • getDefaultRemoteCandidate

         Candidate<out Object> getDefaultRemoteCandidate()

        Returns the Candidate that the remote party has reported as default for this Component or null if no such Candidate has been reported yet. A candidate is said to be default if it would be the target of media from a non-ICE peer;

      • setDefaultRemoteCandidate

         void setDefaultRemoteCandidate(Candidate<out Object> candidate)

        Sets the Candidate that the remote party has reported as default for this Component. A candidate is said to be default if it would be the target of media from a non-ICE peer;

        Parameters:
        candidate - the Candidate that the remote party has reported as default for this Component.
      • addLocalCandidate

         boolean addLocalCandidate(LocalCandidate candidate)

        Add a local candidate to this component. The method should only be accessed and local candidates added by the candidate harvesters registered with the agent.

        Parameters:
        candidate - the candidate object to be added
      • countLocalHostCandidates

         int countLocalHostCandidates()

        Returns the number of local host candidates currently registered in this Component.

      • getLocalCandidateCount

         int getLocalCandidateCount()

        Returns the number of all local candidates currently registered in this Component.

      • addRemoteCandidate

         void addRemoteCandidate(RemoteCandidate candidate)

        Adds a remote Candidates to this media-stream Component.

        Parameters:
        candidate - the Candidate instance to add.
      • addUpdateRemoteCandidates

         void addUpdateRemoteCandidates(RemoteCandidate candidate)

        Update the media-stream Component with the specified Candidates. This would happen when performing trickle ICE.

        Parameters:
        candidate - new Candidate to add.
      • addRemoteCandidates

         void addRemoteCandidates(List<RemoteCandidate> candidates)

        Adds a List of remote Candidates as reported by a remote agent.

        Parameters:
        candidates - the List of Candidates reported by the remote agent for this component.
      • getRemoteCandidateCount

         int getRemoteCandidateCount()

        Returns the number of all remote candidates currently registered in this Component.

      • toString

         String toString()

        Returns a String representation of this Component containing its ID, parent stream name and any existing candidates.

      • toShortString

         String toShortString()

        Returns a short String representation of this Component.

      • findLocalCandidate

         LocalCandidate findLocalCandidate(TransportAddress address, LocalCandidate base)

        Returns the local LocalCandidate with the specified address if it belongs to this component or null if it doesn't. If base is also specified, tries to find a candidate whose base matches base.

        Parameters:
        address - the TransportAddress we are looking for.
        base - an optional base to match.
      • getName

         String getName()

        Returns a human readable name that can be used in debug logs associated with this component.

      • build

         static Component build(int componentID, IceMediaStream mediaStream, Logger parentLogger)

        Use builder pattern to allow creation of immutable Component instances, from outside the current package.

        Parameters:
        componentID - the id of this component.
        mediaStream - the IceMediaStream instance that would be the parent of this component.