public abstract class JingleMediaSession extends Object
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 and Description |
---|
JingleMediaSession(PayloadType payloadType,
TransportCandidate remote,
TransportCandidate local,
String mediaLocator,
JingleSession jingleSession)
Creates a new JingleMediaSession Instance to handle Media methods.
|
Modifier and Type | Method and Description |
---|---|
void |
addMediaReceivedListener(MediaReceivedListener mediaReceivedListener)
Adds a Media Received Listener.
|
JingleSession |
getJingleSession()
Gets associated JingleSession.
|
TransportCandidate |
getLocal()
Returns the Media Session local Candidate.
|
String |
getMediaLocator()
Return the media locator or null if not defined.
|
PayloadType |
getPayloadType()
Returns the PayloadType of the Media Session.
|
TransportCandidate |
getRemote()
Returns the Media Session remote Candidate.
|
abstract void |
initialize()
Initialize the RTP Channel preparing to transmit and receive.
|
void |
mediaReceived(String participant)
Called when new Media is received.
|
void |
removeAllMediaReceivedListener()
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 |
startReceive()
Starts a RTP / UDP / TCP Receiver from the remote Candidate to local Candidate.
|
abstract void |
startTransmit()
Starts a RTP / UDP / TCP Transmission to the remote Candidate.
|
abstract void |
stopReceive()
Stops a RTP / UDP / TCP Receiver from the remote Candidate to local Candidate.
|
abstract void |
stopTransmit()
Stops a RTP / UDP / TCP Transmission to the remote Candidate.
|
public JingleMediaSession(PayloadType payloadType, TransportCandidate remote, TransportCandidate local, String mediaLocator, JingleSession jingleSession)
payloadType
- Payload Type of the transmissionremote
- Remote accepted Transport Candidatelocal
- Local accepted Transport CandidatemediaLocator
- Media Locator of the capture devicepublic PayloadType getPayloadType()
public TransportCandidate getLocal()
public TransportCandidate getRemote()
public String getMediaLocator()
public void setMediaLocator(String mediaLocator)
mediaLocator
- media locator or null to use defaultpublic void addMediaReceivedListener(MediaReceivedListener mediaReceivedListener)
mediaReceivedListener
- public void removeMediaReceivedListener(MediaReceivedListener mediaReceivedListener)
mediaReceivedListener
- public void removeAllMediaReceivedListener()
public abstract void initialize()
public abstract void startTransmit()
public abstract void startReceive()
public abstract void setTransmit(boolean active)
active
- public abstract void stopTransmit()
public abstract void stopReceive()
public void mediaReceived(String participant)
public JingleSession getJingleSession()