Class AudioMediaSession
java.lang.Object
org.jivesoftware.smackx.jingleold.media.JingleMediaSession
org.jivesoftware.smackx.jingleold.mediaimpl.jspeex.AudioMediaSession
- All Implemented Interfaces:
mil.jfcom.cie.media.session.MediaSessionListener
public class AudioMediaSession
extends JingleMediaSession
implements mil.jfcom.cie.media.session.MediaSessionListener
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 Summary
ConstructorDescriptionAudioMediaSession
(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. -
Method Summary
Modifier and TypeMethodDescriptionstatic mil.jfcom.cie.media.session.MediaSession
createSession
(String localhost, int localPort, String remoteHost, int remotePort, mil.jfcom.cie.media.session.MediaSessionListener eventHandler, int quality, boolean secure, boolean micOn) Create a Session using Speex Codec.protected int
Obtain a free port we can use.void
Initialize the Audio Channel to make it able to send and receive audio.void
newStreamIdentified
(mil.jfcom.cie.media.session.StreamPlayer streamPlayer) void
senderReportReceived
(javax.media.rtp.rtcp.SenderReport report) void
setTransmit
(boolean active) Set transmit activity.void
setTrasmit
(boolean active) Deprecated.void
For NAT Reasons this method does nothing.void
Starts transmission and for NAT Traversal reasons start receiving also.void
Deprecated.usestartTransmit()
instead.void
For NAT Reasons this method does nothing.void
Stops transmission and for NAT Traversal reasons stop receiving also.void
Deprecated.usestopTransmit()
instead.void
streamClosed
(mil.jfcom.cie.media.session.StreamPlayer stream, boolean timeout) Methods inherited from class org.jivesoftware.smackx.jingleold.media.JingleMediaSession
addMediaReceivedListener, getJingleSession, getLocal, getMediaLocator, getPayloadType, getRemote, mediaReceived, removeAllMediaReceivedListener, removeMediaReceivedListener, setMediaLocator
-
Constructor Details
-
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.- Parameters:
payloadType
- Payload of the jmfremote
- the remote information. The candidate that the jmf will be sent to.local
- the local information. The candidate that will receive the jmflocator
- media locatorjingleSession
- the jingle session.
-
-
Method Details
-
createSession
public static mil.jfcom.cie.media.session.MediaSession createSession(String localhost, int localPort, String remoteHost, int remotePort, mil.jfcom.cie.media.session.MediaSessionListener eventHandler, int quality, boolean secure, boolean micOn) throws javax.media.NoProcessorException, javax.media.format.UnsupportedFormatException, IOException, GeneralSecurityException Create a Session using Speex Codec.- Parameters:
localhost
- localHostlocalPort
- localPortremoteHost
- remoteHostremotePort
- remotePorteventHandler
- eventHandlerquality
- qualitysecure
- securemicOn
- micOn- Returns:
- MediaSession TODO javadoc me please
- Throws:
javax.media.NoProcessorException
- if there is no media processor.javax.media.format.UnsupportedFormatException
- if the format is not supported.IOException
- if an I/O error occurred.GeneralSecurityException
- if there was a general security exception.
-
initialize
Initialize the Audio Channel to make it able to send and receive audio.- Specified by:
initialize
in classJingleMediaSession
-
startTrasmit
Deprecated.usestartTransmit()
instead.Starts transmission and for NAT Traversal reasons start receiving also. -
startTransmit
Starts transmission and for NAT Traversal reasons start receiving also.- Specified by:
startTransmit
in classJingleMediaSession
-
setTrasmit
Deprecated.usesetTransmit(boolean)
instead.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
- active state
-
setTransmit
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 classJingleMediaSession
- Parameters:
active
- active state
-
startReceive
For NAT Reasons this method does nothing. Use startTransmit() to start transmit and receive jmf- Specified by:
startReceive
in classJingleMediaSession
-
stopTrasmit
Deprecated.usestopTransmit()
instead.Stops transmission and for NAT Traversal reasons stop receiving also. -
stopTransmit
Stops transmission and for NAT Traversal reasons stop receiving also.- Specified by:
stopTransmit
in classJingleMediaSession
-
stopReceive
For NAT Reasons this method does nothing. Use startTransmit() to start transmit and receive jmf- Specified by:
stopReceive
in classJingleMediaSession
-
newStreamIdentified
- Specified by:
newStreamIdentified
in interfacemil.jfcom.cie.media.session.MediaSessionListener
-
senderReportReceived
- Specified by:
senderReportReceived
in interfacemil.jfcom.cie.media.session.MediaSessionListener
-
streamClosed
- Specified by:
streamClosed
in interfacemil.jfcom.cie.media.session.MediaSessionListener
-
getFreePort
Obtain a free port we can use.- Returns:
- A free port number.
-
setTransmit(boolean)
instead.