public class CallPeerMediaHandlerSipImpl extends CallPeerMediaHandler<CallPeerSipImpl>
AUDIO_LOCAL_SSRC, AUDIO_REMOTE_SSRC, locallyOnHold, SSRC_UNKNOWN, VIDEO_LOCAL_SSRC, VIDEO_REMOTE_SSRC
Constructor and Description |
---|
CallPeerMediaHandlerSipImpl(CallPeerSipImpl peer)
Creates a new handler that will be managing media streams for
peer.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
createOffer()
Creates a session description String representing the
MediaStreams that this MediaHandler is prepared to
exchange.
|
java.net.URL |
getCallInfoURL()
Returns a URL pointing ta a location with call control
information for this peer or null if no such URL is
available for the CallPeer associated with this handler..
|
protected org.jitsi.service.configuration.ConfigurationService |
getConfigurationService()
Returns a reference to the currently valid media service for use by this
handler's generic ancestor.
|
protected org.jitsi.service.neomedia.MediaService |
getMediaService()
Returns a reference to the currently valid media service for use by this
handler's generic ancestor.
|
protected NetworkAddressManagerService |
getNetworkAddressManagerService()
Returns a reference to the currently valid network address manager
service for use by this handler's generic ancestor.
|
org.jitsi.service.neomedia.QualityControl |
getQualityControl()
Returns the quality control for video calls if any.
|
protected TransportManagerSipImpl |
getTransportManager()
Returns the transport manager that is handling our address management.
|
void |
processAnswer(java.lang.String answer)
Handles the specified answer by creating and initializing the
corresponding MediaStreams.
|
java.lang.String |
processOffer(java.lang.String offerString)
Parses offerString, creates the MediaStreams that it
describes and constructs a response representing the state of this
MediaHandler.
|
protected TransportManagerSipImpl |
queryTransportManager()
Returns the transport manager that is handling our address management.
|
protected ch.imvs.sdes4j.srtp.SrtpCryptoAttribute |
selectSdesCryptoSuite(boolean isInitiator,
org.jitsi.service.neomedia.SDesControl sDesControl,
javax.sdp.MediaDescription mediaDescription)
Returns the selected crypto suite selected.
|
protected void |
setAndAddPreferredEncryptionProtocol(org.jitsi.service.neomedia.MediaType mediaType,
javax.sdp.MediaDescription localMd,
javax.sdp.MediaDescription remoteMd)
Selects the preferred encryption protocol (only used by the callee).
|
void |
setSupportQualityControls(boolean value)
Sometimes as initing a call with custom preset can set and we force
that quality controls is supported.
|
void |
start()
Starts this CallPeerMediaHandler.
|
protected void |
throwOperationFailedException(java.lang.String message,
int errorCode,
java.lang.Throwable cause)
Lets the underlying implementation take note of this error and only
then throws it to the using bundles.
|
addAdvertisedEncryptionMethod, addVideoListener, close, closeStream, findMediaFormat, fireVideoEvent, fireVideoEvent, getAdvertisedEncryptionMethods, getDefaultDevice, getDirectionUserPreference, getDynamicPayloadTypes, getEncryptionMethod, getExtensionsForType, getHarvestingTime, getICECandidateExtendedType, getICELocalHostAddress, getICELocalReflexiveAddress, getICELocalRelayedAddress, getICERemoteHostAddress, getICERemoteReflexiveAddress, getICERemoteRelayedAddress, getICEState, getLabel, getLocallySupportedFormats, getLocallySupportedFormats, getLocalVisualComponent, getMediaHandler, getMsid, getMsLabel, getNbHarvesting, getNbHarvesting, getPeer, getRemoteSSRC, getRtpExtensionsRegistry, getSrtpControls, getStream, getTotalHarvestingTime, getVisualComponent, getVisualComponents, initStream, intersectFormats, intersectRTPExtensions, isDeviceActive, isDeviceActive, isLocalAudioTransmissionEnabled, isLocallyOnHold, isLocalVideoTransmissionEnabled, isMute, isRemotelyOnHold, isRTPTranslationEnabled, isSecure, mediaHandlerPropertyChange, processKeyFrameRequest, removeAndCleanupOtherSrtpControls, removeVideoListener, requestKeyFrame, sendHolePunchPacket, setCsrcAudioLevelListener, setDisableHolePunching, setLocalAudioTransmissionEnabled, setLocallyOnHold, setLocalUserAudioLevelListener, setLocalVideoTransmissionEnabled, setMediaHandler, setMute, setStreamAudioLevelListener, startSrtpMultistream
public CallPeerMediaHandlerSipImpl(CallPeerSipImpl peer)
peer
- that CallPeerSipImpl instance that we will be
managing media for.public java.lang.String createOffer() throws OperationFailedException
OperationFailedException
- if creating the SDP fails for some
reason.public java.lang.String processOffer(java.lang.String offerString) throws OperationFailedException, java.lang.IllegalArgumentException
offerString
- The SDP offer that we'd like to parse, handle and get
a response for.OperationFailedException
- if parsing or handling
offerString fails or we have a problem while creating the
response.java.lang.IllegalArgumentException
- if there's a problem with the format
or semantics of the offerString.public void processAnswer(java.lang.String answer) throws OperationFailedException, java.lang.IllegalArgumentException
answer
- the SDP answer that we'd like to handle.OperationFailedException
- if we fail to handle answer for
reasons like failing to initialize media devices or streams.java.lang.IllegalArgumentException
- if there's a problem with the syntax or
the semantics of answer.public java.net.URL getCallInfoURL()
protected NetworkAddressManagerService getNetworkAddressManagerService()
NetworkAddressManagerService
protected org.jitsi.service.configuration.ConfigurationService getConfigurationService()
MediaService
protected org.jitsi.service.neomedia.MediaService getMediaService()
MediaService
protected void throwOperationFailedException(java.lang.String message, int errorCode, java.lang.Throwable cause) throws OperationFailedException
throwOperationFailedException
in class CallPeerMediaHandler<CallPeerSipImpl>
message
- the message to be logged and then wrapped in a new
OperationFailedExceptionerrorCode
- the error code to be assigned to the new
OperationFailedExceptioncause
- the Throwable that has caused the necessity to log
an error and have a new OperationFailedException thrownOperationFailedException
- the exception that we wanted this method
to throw.protected TransportManagerSipImpl getTransportManager()
getTransportManager
in class CallPeerMediaHandler<CallPeerSipImpl>
protected TransportManagerSipImpl queryTransportManager()
queryTransportManager
in class CallPeerMediaHandler<CallPeerSipImpl>
public org.jitsi.service.neomedia.QualityControl getQualityControl()
public void setSupportQualityControls(boolean value)
value
- whether quality controls is supported..protected ch.imvs.sdes4j.srtp.SrtpCryptoAttribute selectSdesCryptoSuite(boolean isInitiator, org.jitsi.service.neomedia.SDesControl sDesControl, javax.sdp.MediaDescription mediaDescription)
isInitiator
- True if the local call instance is the initiator of
the call. False otherwise.sDesControl
- The SDES based SRTP MediaStream encryption control.mediaDescription
- The description received from the
remote peer. This contains the SDES crypto suites available for the
remote peer.protected void setAndAddPreferredEncryptionProtocol(org.jitsi.service.neomedia.MediaType mediaType, javax.sdp.MediaDescription localMd, javax.sdp.MediaDescription remoteMd)
mediaType
- The type of media (AUDIO or VIDEO).localMd
- the description of the local peer.remoteMd
- the description of the remote peer.public void start() throws java.lang.IllegalStateException
CallPeerMediaHandler.start()
.start
in class CallPeerMediaHandler<CallPeerSipImpl>
java.lang.IllegalStateException
- if this method is called without this
handler having first seen a media description or having generated an
offer.
Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under Apache license.