public abstract class MediaEndpoint extends Object
WebRtcEndpoint wrapper that supports buffering of
IceCandidates until the WebRtcEndpoint is created.
Connections to other peers are opened using the corresponding method of the
internal endpoint.| Constructor and Description |
|---|
MediaEndpoint(boolean web,
Participant owner,
String endpointName,
org.kurento.client.MediaPipeline pipeline,
org.slf4j.Logger log)
Constructor to set the owner, the endpoint's name and the media pipeline.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addIceCandidate(org.kurento.client.IceCandidate candidate)
Add a new
IceCandidate received gathered by the remote peer of
this WebRtcEndpoint. |
org.kurento.client.SdpEndpoint |
createEndpoint(CountDownLatch endpointLatch)
If this object doesn't have a
WebRtcEndpoint, it is created in a
thread-safe way using the internal MediaPipeline. |
protected void |
gatherCandidates()
If supported, it instructs the internal endpoint to start gathering
IceCandidates. |
protected String |
generateOffer()
Orders the internal endpoint (
RtpEndpoint or
WebRtcEndpoint) to generate the offer String that can be used to
initiate a connection. |
org.kurento.client.SdpEndpoint |
getEndpoint() |
String |
getEndpointName() |
MutedMediaType |
getMuteType() |
Participant |
getOwner() |
org.kurento.client.MediaPipeline |
getPipeline() |
protected org.kurento.client.RtpEndpoint |
getRtpEndpoint() |
protected org.kurento.client.WebRtcEndpoint |
getWebEndpoint() |
protected void |
internalEndpointInitialization(CountDownLatch endpointLatch)
Creates the endpoint (RTP or WebRTC) and any other additional elements
(if needed).
|
boolean |
isWeb() |
abstract void |
mute(MutedMediaType muteType)
Mute the media stream.
|
protected String |
processAnswer(String answer)
Orders the internal endpoint (
RtpEndpoint or
WebRtcEndpoint) to process the answer String. |
protected String |
processOffer(String offer)
Orders the internal endpoint (
RtpEndpoint or
WebRtcEndpoint) to process the offer String. |
protected org.kurento.client.ListenerSubscription |
registerElemErrListener(org.kurento.client.MediaElement element)
Registers a listener for when the
MediaElement triggers an
ErrorEvent. |
protected void |
registerOnIceCandidateEventListener()
If supported, it registers a listener for when a new
IceCandidate
is gathered by the internal endpoint (WebRtcEndpoint) and sends
it to the remote User Agent as a notification using the messaging
capabilities of the Participant. |
protected void |
resolveCurrentMuteType(MutedMediaType newMuteType) |
void |
setEndpointName(String endpointName)
Sets the endpoint's name (as indicated by the browser).
|
void |
setMediaPipeline(org.kurento.client.MediaPipeline pipeline)
Sets the
MediaPipeline used to create the internal
WebRtcEndpoint. |
void |
setMuteType(MutedMediaType muteType) |
abstract void |
unmute()
Reconnect the muted media leg(s).
|
protected void |
unregisterElementErrListener(org.kurento.client.MediaElement element,
org.kurento.client.ListenerSubscription subscription)
Unregisters the error listener from the media element using the provided
subscription.
|
void |
unregisterErrorListeners()
Unregisters all error listeners created for media elements owned by this
instance.
|
public MediaEndpoint(boolean web,
Participant owner,
String endpointName,
org.kurento.client.MediaPipeline pipeline,
org.slf4j.Logger log)
owner - endpointName - pipeline - public boolean isWeb()
public Participant getOwner()
public org.kurento.client.SdpEndpoint getEndpoint()
RtpEndpoint or
WebRtcEndpoint)protected org.kurento.client.WebRtcEndpoint getWebEndpoint()
protected org.kurento.client.RtpEndpoint getRtpEndpoint()
public org.kurento.client.SdpEndpoint createEndpoint(CountDownLatch endpointLatch)
WebRtcEndpoint, it is created in a
thread-safe way using the internal MediaPipeline. Otherwise no
actions are taken. It also registers an error listener for the endpoint
and for any additional media elements.endpointLatch - latch whose countdown is performed when the
asynchronous call to build the WebRtcEndpoint returnspublic org.kurento.client.MediaPipeline getPipeline()
public void setMediaPipeline(org.kurento.client.MediaPipeline pipeline)
MediaPipeline used to create the internal
WebRtcEndpoint.pipeline - the MediaPipelinepublic String getEndpointName()
public void setEndpointName(String endpointName)
endpointName - the namepublic void unregisterErrorListeners()
public abstract void mute(MutedMediaType muteType)
muteType - which type of leg to disconnect (audio, video or both)public abstract void unmute()
public void setMuteType(MutedMediaType muteType)
public MutedMediaType getMuteType()
protected void resolveCurrentMuteType(MutedMediaType newMuteType)
protected void internalEndpointInitialization(CountDownLatch endpointLatch)
endpointLatch - public void addIceCandidate(org.kurento.client.IceCandidate candidate)
throws RoomException
IceCandidate received gathered by the remote peer of
this WebRtcEndpoint.candidate - the remote candidateRoomExceptionprotected org.kurento.client.ListenerSubscription registerElemErrListener(org.kurento.client.MediaElement element)
MediaElement triggers an
ErrorEvent. Notifies the owner with the error.element - the MediaElementListenerSubscription that can be used to deregister the
listenerprotected void unregisterElementErrListener(org.kurento.client.MediaElement element,
org.kurento.client.ListenerSubscription subscription)
element - the MediaElementsubscription - the associated ListenerSubscriptionprotected String processOffer(String offer) throws RoomException
RtpEndpoint or
WebRtcEndpoint) to process the offer String.offer - String with the Sdp offerRoomExceptionSdpEndpoint.processOffer(String)protected String generateOffer() throws RoomException
RtpEndpoint or
WebRtcEndpoint) to generate the offer String that can be used to
initiate a connection.RoomExceptionSdpEndpoint.generateOffer()protected String processAnswer(String answer) throws RoomException
RtpEndpoint or
WebRtcEndpoint) to process the answer String.answer - String with the Sdp answer from remoteRoomExceptionSdpEndpoint.processAnswer(String)protected void registerOnIceCandidateEventListener()
throws RoomException
IceCandidate
is gathered by the internal endpoint (WebRtcEndpoint) and sends
it to the remote User Agent as a notification using the messaging
capabilities of the Participant.RoomException - if thrown, unable to register the listenerWebRtcEndpoint.addOnIceCandidateListener(org.kurento.client.EventListener),
Participant.sendIceCandidate(String, IceCandidate)protected void gatherCandidates()
throws RoomException
IceCandidates.RoomExceptionCopyright © 2015 Kurento. All rights reserved.