Class JingleMediaSession
java.lang.Object
org.jivesoftware.smackx.jingleold.media.JingleMediaSession
- Direct Known Subclasses:
AudioMediaSession
,AudioMediaSession
,ScreenShareSession
,TestMediaSession
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 Summary
ConstructorDescriptionJingleMediaSession
(PayloadType payloadType, TransportCandidate remote, TransportCandidate local, String mediaLocator, JingleSession jingleSession) Creates a new JingleMediaSession Instance to handle Media methods. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addMediaReceivedListener
(MediaReceivedListener mediaReceivedListener) Adds a Media Received Listener.Gets associated JingleSession.getLocal()
Returns the Media Session local Candidate.Return the media locator or null if not defined.Returns the PayloadType of the Media Session.Returns the Media Session remote Candidate.abstract void
Initialize the RTP Channel preparing to transmit and receive.void
mediaReceived
(String participant) Called when new Media is received.void
Removes all Media Received Listeners.void
removeMediaReceivedListener
(MediaReceivedListener mediaReceivedListener) Removes a Media Received Listener.void
setMediaLocator
(String mediaLocator) Set the media locator.abstract void
setTransmit
(boolean active) Set transmit activity.abstract void
Starts a RTP / UDP / TCP Receiver from the remote Candidate to local Candidate.abstract void
Starts a RTP / UDP / TCP Transmission to the remote Candidate.abstract void
Stops a RTP / UDP / TCP Receiver from the remote Candidate to local Candidate.abstract void
Stops a RTP / UDP / TCP Transmission to the remote Candidate.
-
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 transmissionremote
- Remote accepted Transport Candidatelocal
- Local accepted Transport CandidatemediaLocator
- Media Locator of the capture devicejingleSession
- 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
Set the media locator.- Parameters:
mediaLocator
- media locator or null to use default
-
addMediaReceivedListener
Adds a Media Received Listener.- Parameters:
mediaReceivedListener
- TODO javadoc me please
-
removeMediaReceivedListener
Removes a Media Received Listener.- Parameters:
mediaReceivedListener
- TODO javadoc me please
-
removeAllMediaReceivedListener
Removes all Media Received Listeners. -
initialize
Initialize the RTP Channel preparing to transmit and receive. -
startTransmit
Starts a RTP / UDP / TCP Transmission to the remote Candidate. -
startReceive
Starts a RTP / UDP / TCP Receiver from the remote Candidate to local Candidate. -
setTransmit
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
Stops a RTP / UDP / TCP Transmission to the remote Candidate. -
stopReceive
Stops a RTP / UDP / TCP Receiver from the remote Candidate to local Candidate. -
mediaReceived
Called when new Media is received.- Parameters:
participant
- the participant.
-
getJingleSession
Gets associated JingleSession.- Returns:
- associated JingleSession
-