T
- the peer extension class like, for example,
CallPeerSipImpl or CallPeerJabberImplU
- the provider extension class like, for example,
OperationSetBasicTelephonySipImpl or
OperationSetBasicTelephonySipImplV
- the provider extension class like, for example,
ProtocolProviderServiceSipImpl or
ProtocolProviderServiceJabberImplpublic abstract class MediaAwareCall<T extends MediaAwareCallPeer<?,?,V>,U extends OperationSetBasicTelephony<V>,V extends ProtocolProviderService> extends AbstractCall<T,V> implements CallPeerListener, java.beans.PropertyChangeListener, DTMFListener
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DEFAULT_DEVICE
The name of the property of MediaAwareCall the value of which
corresponds to the value returned by
getDefaultDevice(MediaType) . |
protected boolean |
localVideoAllowed
Our video streaming policy.
|
protected org.jitsi.service.neomedia.MediaUseCase |
mediaUseCase
Device used in call will be chosen according to MediaUseCase.
|
protected U |
parentOpSet
The OperationSetBasicTelephony implementation which created us.
|
CONFERENCE, CONFERENCE_FOCUS, useTranslator
Modifier | Constructor and Description |
---|---|
protected |
MediaAwareCall(U parentOpSet)
Crates a Call instance belonging to parentOpSet.
|
Modifier and Type | Method and Description |
---|---|
protected void |
addCallPeer(T callPeer)
Adds callPeer to the list of peers in this call.
|
void |
addLocalUserSoundLevelListener(SoundLevelListener l)
Adds a specific SoundLevelListener to the list of
listeners interested in and notified about changes in local sound level
related information.
|
void |
addVideoPropertyChangeListener(java.beans.PropertyChangeListener listener)
Registers a listener with all CallPeer currently
participating with the call so that it would be notified of changes in
video related properties (e.g.
|
protected void |
conferenceFocusChanged(boolean oldValue,
boolean newValue)
Notifies this instance that the value of its property
Call.CONFERENCE_FOCUS has changed from a specific old value to a
specific new value. |
protected CallConference |
createConference()
Creates a new CallConference instance which is to represent the
telephony conference-related state of this Call.
|
org.jitsi.service.neomedia.recording.Recorder |
createRecorder()
Creates a new Recorder which is to record this Call
(into a file which is to be specified when starting the returned
Recorder).
|
protected void |
firePropertyChange(java.lang.String property,
java.lang.Object oldValue,
java.lang.Object newValue)
Fires a new PropertyChangeEvent to the
PropertyChangeListeners registered with this Call in
order to notify about a change in the value of a specific property which
had its old value modified to a specific new value.
|
MediaAwareCallConference |
getConference()
Gets the telephony conference-related state of this Call.
|
org.jitsi.service.neomedia.device.MediaDevice |
getDefaultDevice(org.jitsi.service.neomedia.MediaType mediaType)
Gets a MediaDevice which is capable of capture and/or playback
of media of the specified MediaType, is the default choice of
the user for a MediaDevice with the specified MediaType
and is appropriate for the current state of this Call.
|
org.jitsi.service.neomedia.MediaUseCase |
getMediaUseCase()
Get the media use case.
|
U |
getParentOperationSet()
Returns a reference to the OperationSetBasicTelephony
implementation instance that created this call.
|
org.jitsi.service.neomedia.RTPTranslator |
getRTPTranslator(org.jitsi.service.neomedia.MediaType mediaType)
Gets the RTPTranslator which forwards RTP and RTCP traffic
between the CallPeers of this Call when the local
peer represented by this Call is acting as a conference focus.
|
boolean |
isConferenceFocus()
Gets the indicator which determines whether the local peer represented by
this Call is acting as a conference focus and thus may need to
send the corresponding parameters in its outgoing signaling.
|
boolean |
isLocalVideoAllowed(org.jitsi.service.neomedia.MediaUseCase useCase)
Determines whether the streaming of local video in this Call
is currently allowed.
|
boolean |
isLocalVideoStreaming()
Determines whether we are currently streaming video toward at least one
of the peers in this call.
|
boolean |
isMute()
Determines whether this call is mute.
|
void |
peerAddressChanged(CallPeerChangeEvent evt)
Dummy implementation of a method (inherited from CallPeerListener)
that we don't need.
|
void |
peerDisplayNameChanged(CallPeerChangeEvent evt)
Dummy implementation of a method (inherited from CallPeerListener)
that we don't need.
|
void |
peerImageChanged(CallPeerChangeEvent evt)
Dummy implementation of a method (inherited from CallPeerListener)
that we don't need.
|
void |
peerStateChanged(CallPeerChangeEvent evt)
Verifies whether the call peer has entered a state.
|
void |
peerTransportAddressChanged(CallPeerChangeEvent evt)
Dummy implementation of a method (inherited from CallPeerListener)
that we don't need.
|
void |
propertyChange(java.beans.PropertyChangeEvent ev)
Notifies this instance about a change of the value of a specific property
from a specific old value to a specific new value.
|
void |
removeLocalUserSoundLevelListener(SoundLevelListener l)
Removes a specific SoundLevelListener from the list of listeners
interested in and notified about changes in local sound level related
information.
|
void |
removeVideoPropertyChangeListener(java.beans.PropertyChangeListener listener)
Removes listener from all CallPeers currently
participating with the call so that it won't receive further notifications
on changes in video related properties (e.g.
|
void |
setAudioDevice(org.jitsi.service.neomedia.device.MediaDevice audioDevice)
Sets the MediaDevice to be used by this Call for audio
capture and/or playback.
|
protected void |
setCallState(CallState newState,
CallPeerChangeEvent cause)
Sets the state of this Call and fires a new
CallChangeEvent notifying the registered
CallChangeListeners about the change of the state.
|
void |
setConference(CallConference conference)
Sets the telephony conference-related state of this Call.
|
void |
setLocalVideoAllowed(boolean allowed,
org.jitsi.service.neomedia.MediaUseCase useCase)
Modifies the local media setup of all peers in the call to reflect the
requested setting for the streaming of the local video and then passes
the setting to the participating MediaAwareCallPeer instances.
|
void |
setMute(boolean mute)
Sets the mute property for this call.
|
void |
setVideoDevice(org.jitsi.service.neomedia.device.MediaDevice videoDevice,
org.jitsi.service.neomedia.MediaUseCase useCase)
Sets the MediaDevice to be used by this Call for video
capture and/or playback and the use case of the video streaming in this
MediaAwareCall.
|
void |
toneReceived(DTMFReceivedEvent evt)
Called when a new incoming DTMFTone has been received.
|
addPropertyChangeListener, doAddCallPeer, doRemoveCallPeer, getCallPeerCount, getCallPeerList, getCallPeers, getProtocolProvider, removePropertyChangeListener
addCallChangeListener, equals, fireCallChangeEvent, fireCallChangeEvent, fireCallPeerEvent, fireCallPeerEvent, getCallID, getCallState, hashCode, isAutoAnswer, isDefaultEncrypted, isSipZrtpAttribute, removeCallChangeListener, setAutoAnswer, setCallState, toString
getData, setData
public static final java.lang.String DEFAULT_DEVICE
getDefaultDevice(MediaType)
. The oldValue
and the newValue of the fired PropertyChangeEvent are
not to be relied on and instead a call to getDefaultDevice is to
be performed to retrieve the new value.protected boolean localVideoAllowed
protected final U extends OperationSetBasicTelephony<V> parentOpSet
protected org.jitsi.service.neomedia.MediaUseCase mediaUseCase
protected MediaAwareCall(U parentOpSet)
parentOpSet
- a reference to the operation set that's creating us
and that we would be able to use for even dispatching.protected void addCallPeer(T callPeer)
callPeer
- the new CallPeerpublic void peerImageChanged(CallPeerChangeEvent evt)
peerImageChanged
in interface CallPeerListener
evt
- unused.public void peerAddressChanged(CallPeerChangeEvent evt)
peerAddressChanged
in interface CallPeerListener
evt
- unused.public void peerTransportAddressChanged(CallPeerChangeEvent evt)
peerTransportAddressChanged
in interface CallPeerListener
evt
- unused.public void peerDisplayNameChanged(CallPeerChangeEvent evt)
peerDisplayNameChanged
in interface CallPeerListener
evt
- unused.public void peerStateChanged(CallPeerChangeEvent evt)
peerStateChanged
in interface CallPeerListener
evt
- The CallPeerChangeEvent instance containing
the source event as well as its previous and its new status.public U getParentOperationSet()
public org.jitsi.service.neomedia.RTPTranslator getRTPTranslator(org.jitsi.service.neomedia.MediaType mediaType)
mediaType
- the MediaType of the MediaStream which
RTP and RTCP traffic is to be forwarded betweenpublic boolean isConferenceFocus()
isConferenceFocus
in class Call
public org.jitsi.service.neomedia.device.MediaDevice getDefaultDevice(org.jitsi.service.neomedia.MediaType mediaType)
For example, when the local peer represented by this Call instance is acting as a conference focus, the audio device must be a mixer.
mediaType
- the MediaType in which the retrieved
MediaDevice is to capture and/or play back mediapublic void addLocalUserSoundLevelListener(SoundLevelListener l)
addLocalUserSoundLevelListener
in class Call
l
- the SoundLevelListener to addpublic void removeLocalUserSoundLevelListener(SoundLevelListener l)
removeLocalUserSoundLevelListener
in class Call
l
- the SoundLevelListener to removepublic boolean isMute()
public void setMute(boolean mute)
mute
- the new value of the mute property for this callpublic void setLocalVideoAllowed(boolean allowed, org.jitsi.service.neomedia.MediaUseCase useCase) throws OperationFailedException
allowed
- true if local video transmission is allowed and
false otherwise.useCase
- the use case of the video (i.e video call or desktop
streaming/sharing session)OperationFailedException
- if video initialization fails.public org.jitsi.service.neomedia.MediaUseCase getMediaUseCase()
public boolean isLocalVideoAllowed(org.jitsi.service.neomedia.MediaUseCase useCase)
useCase
- the use case of the video (i.e video call or desktop
streaming/sharing session)public boolean isLocalVideoStreaming()
public void addVideoPropertyChangeListener(java.beans.PropertyChangeListener listener)
listener
- the PropertyChangeListener to be notified
when the properties associated with member CallPeers change
their values.public void removeVideoPropertyChangeListener(java.beans.PropertyChangeListener listener)
listener
- the PropertyChangeListener to unregister from
member CallPeers change their values.public org.jitsi.service.neomedia.recording.Recorder createRecorder() throws OperationFailedException
OperationFailedException
- if anything goes wrong while creating
the new Recorder for this Callpublic void setAudioDevice(org.jitsi.service.neomedia.device.MediaDevice audioDevice)
audioDevice
- the MediaDevice to be used by this
Call for audio capture and/or playbackpublic void setVideoDevice(org.jitsi.service.neomedia.device.MediaDevice videoDevice, org.jitsi.service.neomedia.MediaUseCase useCase)
videoDevice
- the MediaDevice to be used by this
Call for video capture and/or playbackuseCase
- the use case of the video streaming to be set on this
MediaAwareCall such as webcam capture or desktop
sharing/streamingprotected void setCallState(CallState newState, CallPeerChangeEvent cause)
setCallState
in class Call
newState
- the CallState into which this Call is
to entercause
- the CallPeerChangeEvent which is the cause for the
request to have this Call enter the specified CallStateCall.setCallState(CallState, CallPeerChangeEvent)
public void propertyChange(java.beans.PropertyChangeEvent ev)
propertyChange
in interface java.beans.PropertyChangeListener
ev
- a PropertyChangeEvent which specifies the name of the
property which has its value changed and the old and new valuesprotected void conferenceFocusChanged(boolean oldValue, boolean newValue)
Call.CONFERENCE_FOCUS
has changed from a specific old value to a
specific new value. Fires a PropertyChangeEvent to the
registered PropertyChangeListeners. Protocol implementations
which extend MediaAwareCall will likely want to override in
order to add notifying the associated CallPeers about the change
of the property value (e.g. SIP will want to include the
"isfocus" parameter in the Contact header while the local peer
is acting as a conference focus.)oldValue
- the value of the property CONFERENCE_FOCUS
before the changenewValue
- the value of the property CONFERENCE_FOCUS after
the changeprotected CallConference createConference()
createConference
in class Call
public MediaAwareCallConference getConference()
getConference
in class Call
protected void firePropertyChange(java.lang.String property, java.lang.Object oldValue, java.lang.Object newValue)
AbstractCall.propertyChangeSupport
.
Listens to the changes in the values of the properties of this
Call.firePropertyChange
in class AbstractCall<T extends MediaAwareCallPeer<?,?,V>,V extends ProtocolProviderService>
property
- the name of the property of this Call which had
its value changedoldValue
- the value of the property with the specified name before
the changenewValue
- the value of the property with the specified name after
the changepublic void setConference(CallConference conference)
setConference
in class Call
conference
- the CallConference instance to represent the
telephony conference-related state of this Callpublic void toneReceived(DTMFReceivedEvent evt)
DTMFListener.toneReceived(net.java.sip.communicator.service.protocol.event.DTMFReceivedEvent)
toneReceived
in interface DTMFListener
evt
- the DTMFReceivedEvent containing the newly
received tone.
Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under Apache license.