Class JingleMediaSession

  • Direct Known Subclasses:
    AudioMediaSession, AudioMediaSession, ScreenShareSession, TestMediaSession

    public abstract class JingleMediaSession
    extends java.lang.Object
    Public Abstract Class provides a clear interface between Media Session and Jingle API.

    When a Jingle Session is fully stablished, we will have a Payload Type and two transport candidates defined for it. Smack Jingle API don't implement Media Transmit and Receive methods. But provides an interface to let the user implements it using another API. For instance: JMF.

    The Class that implements this one, must have the support to transmit and receive the jmf. This interface let the user choose his own jmf API.
    • Constructor Detail

      • JingleMediaSession

        public JingleMediaSession​(PayloadType payloadType,
                                  TransportCandidate remote,
                                  TransportCandidate local,
                                  java.lang.String mediaLocator,
                                  JingleSession jingleSession)
        Creates a new JingleMediaSession Instance to handle Media methods.
        Parameters:
        payloadType - Payload Type of the transmission
        remote - Remote accepted Transport Candidate
        local - Local accepted Transport Candidate
        mediaLocator - Media Locator of the capture device
        jingleSession - the jingle session.
    • Method Detail

      • getPayloadType

        public PayloadType getPayloadType()
        Returns the PayloadType of the Media Session.
        Returns:
        the PayloadType
      • getLocal

        public TransportCandidate getLocal()
        Returns the Media Session local Candidate.
        Returns:
        the TransportCandidate
      • getRemote

        public TransportCandidate getRemote()
        Returns the Media Session remote Candidate.
        Returns:
        the TransportCandidate
      • getMediaLocator

        public java.lang.String getMediaLocator()
        Return the media locator or null if not defined.
        Returns:
        media locator
      • setMediaLocator

        public void setMediaLocator​(java.lang.String mediaLocator)
        Set the media locator.
        Parameters:
        mediaLocator - media locator or null to use default
      • addMediaReceivedListener

        public void addMediaReceivedListener​(MediaReceivedListener mediaReceivedListener)
        Adds a Media Received Listener.
        Parameters:
        mediaReceivedListener - TODO javadoc me please
      • removeMediaReceivedListener

        public void removeMediaReceivedListener​(MediaReceivedListener mediaReceivedListener)
        Removes a Media Received Listener.
        Parameters:
        mediaReceivedListener - TODO javadoc me please
      • removeAllMediaReceivedListener

        public void removeAllMediaReceivedListener()
        Removes all Media Received Listeners.
      • initialize

        public abstract void initialize()
        Initialize the RTP Channel preparing to transmit and receive.
      • startTransmit

        public abstract void startTransmit()
        Starts a RTP / UDP / TCP Transmission to the remote Candidate.
      • startReceive

        public abstract void startReceive()
        Starts a RTP / UDP / TCP Receiver from the remote Candidate to local Candidate.
      • setTransmit

        public abstract void setTransmit​(boolean active)
        Set transmit activity. If the active is true, the instance should trasmit. If it is set to false, the instance should pause transmit.
        Parameters:
        active - TODO javadoc me please
      • stopTransmit

        public abstract void stopTransmit()
        Stops a RTP / UDP / TCP Transmission to the remote Candidate.
      • stopReceive

        public abstract void stopReceive()
        Stops a RTP / UDP / TCP Receiver from the remote Candidate to local Candidate.
      • mediaReceived

        public void mediaReceived​(java.lang.String participant)
        Called when new Media is received.
        Parameters:
        participant - the particpant.
      • getJingleSession

        public JingleSession getJingleSession()
        Gets associated JingleSession.
        Returns:
        associated JingleSession