Class AudioMediaSession

  • All Implemented Interfaces:

    public class AudioMediaSession
    extends JingleMediaSession
    This Class implements a complete JingleMediaSession. It should be used to transmit and receive audio captured from the Mic. This Class should be automatically controlled by JingleSession. But you could also use in any VOIP application. For better NAT Traversal support this implementation don't support only receive or only transmit. To receive you MUST transmit. So the only implemented and functionally methods are startTransmit() and stopTransmit()
    • Constructor Detail

      • AudioMediaSession

        public AudioMediaSession​(PayloadType payloadType,
                                 TransportCandidate remote,
                                 TransportCandidate local,
                                 String locator,
                                 JingleSession jingleSession)
        Creates a org.jivesoftware.jingleaudio.jspeex.AudioMediaSession with defined payload type, remote and local candidates.
        payloadType - Payload of the jmf
        remote - the remote information. The candidate that the jmf will be sent to.
        local - the local information. The candidate that will receive the jmf
        locator - media locator
        jingleSession - the jingle session.
    • Method Detail

      • createSession

        public static createSession​(String localhost,
                                                                             int localPort,
                                                                             String remoteHost,
                                                                             int remotePort,
                                                                             int quality,
                                                                             boolean secure,
                                                                             boolean micOn)
        Create a Session using Speex Codec.
        localhost - localHost
        localPort - localPort
        remoteHost - remoteHost
        remotePort - remotePort
        eventHandler - eventHandler
        quality - quality
        secure - secure
        micOn - micOn
        MediaSession TODO javadoc me please
        Throws: - if there is no media processor. - if the format is not supported.
        IOException - if an I/O error occurred.
        GeneralSecurityException - if there was a geneeral security exception.
      • setTrasmit

        public void setTrasmit​(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.
        active - active state
      • setTransmit

        public 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.
        Specified by:
        setTransmit in class JingleMediaSession
        active - active state
      • newStreamIdentified

        public void newStreamIdentified​( streamPlayer)
        Specified by:
        newStreamIdentified in interface
      • senderReportReceived

        public void senderReportReceived​( report)
        Specified by:
        senderReportReceived in interface
      • streamClosed

        public void streamClosed​( stream,
                                 boolean timeout)
        Specified by:
        streamClosed in interface
      • getFreePort

        protected int getFreePort()
        Obtain a free port we can use.
        A free port number.