Class JingleMediaSession

java.lang.Object
org.jivesoftware.smackx.jingleold.media.JingleMediaSession
Direct Known Subclasses:
AudioMediaSession, AudioMediaSession, ScreenShareSession, TestMediaSession

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

When a Jingle Session is fully established, 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 Details

    • JingleMediaSession

      public JingleMediaSession(PayloadType payloadType, TransportCandidate remote, TransportCandidate local, 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 Details

    • getPayloadType

      Returns the PayloadType of the Media Session.
      Returns:
      the PayloadType
    • getLocal

      Returns the Media Session local Candidate.
      Returns:
      the TransportCandidate
    • getRemote

      Returns the Media Session remote Candidate.
      Returns:
      the TransportCandidate
    • getMediaLocator

      Return the media locator or null if not defined.
      Returns:
      media locator
    • setMediaLocator

      public void setMediaLocator(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

      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 transmit. 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(String participant)
      Called when new Media is received.
      Parameters:
      participant - the participant.
    • getJingleSession

      Gets associated JingleSession.
      Returns:
      associated JingleSession