SIP Communicator: the OpenSource Java VoIP and Instant Messaging client.

net.java.sip.communicator.impl.neomedia
Class MediaStreamImpl

java.lang.Object
  extended by net.java.sip.communicator.service.neomedia.AbstractMediaStream
      extended by net.java.sip.communicator.impl.neomedia.MediaStreamImpl
All Implemented Interfaces:
EventListener, javax.media.rtp.ReceiveStreamListener, javax.media.rtp.SendStreamListener, javax.media.rtp.SessionListener, MediaStream
Direct Known Subclasses:
AudioMediaStreamImpl, VideoMediaStreamImpl

public class MediaStreamImpl
extends AbstractMediaStream
implements javax.media.rtp.ReceiveStreamListener, javax.media.rtp.SendStreamListener, javax.media.rtp.SessionListener

Implements MediaStream using JMF.

Author:
Lubomir Marinov, Emil Ivov

Field Summary
protected  Map<String,String> advancedAttributes
          Map of advanced attributes.
protected static String PROPERTY_NAME_RECEIVE_BUFFER_LENGTH
          The name of the property indicating the length of our receive buffer.
 
Fields inherited from interface net.java.sip.communicator.service.neomedia.MediaStream
PNAME_LOCAL_SSRC, PNAME_REMOTE_SSRC
 
Constructor Summary
MediaStreamImpl(MediaDevice device, ZrtpControlImpl zrtpControl)
          Initializes a new MediaStreamImpl instance which will use the specified MediaDevice for both capture and playback of media.
MediaStreamImpl(StreamConnector connector, MediaDevice device, ZrtpControlImpl zrtpControl)
          Initializes a new MediaStreamImpl instance which will use the specified MediaDevice for both capture and playback of media exchanged via the specified StreamConnector.
 
Method Summary
 void addDynamicRTPPayloadType(byte rtpPayloadType, MediaFormat format)
          Adds a new association in this MediaStream of the specified RTP payload type with the specified MediaFormat in order to allow it to report rtpPayloadType in RTP flows sending and receiving media in format.
 void addRTPExtension(byte extensionID, RTPExtension rtpExtension)
          Maps or updates the mapping between extensionID and rtpExtension.
 void close()
          Releases the resources allocated by this instance in the course of its execution and prepares it to be garbage collected.
protected  void configureDataInputStream(RTPConnectorInputStream dataInputStream)
          Performs any optional configuration on a specific RTPConnectorInputStream of an RTPManager to be used by this MediaStreamImpl.
protected  void configureDataOutputStream(RTPConnectorOutputStream dataOutputStream)
          Performs any optional configuration on a specific RTPConnectorOuputStream of an RTPManager to be used by this MediaStreamImpl.
protected  void configureRTPManagerBufferControl(javax.media.rtp.RTPManager rtpManager, javax.media.control.BufferControl bufferControl)
          Performs any optional configuration on the BufferControl of the specified RTPManager which is to be used as the RTPManager of this MediaStreamImpl.
protected  DtmfTransformEngine createDtmfTransformEngine()
          A stub that allows audio oriented streams to create and keep a reference to a DtmfTransformEngine.
protected  void deviceSessionChanged(MediaDeviceSession oldValue, MediaDeviceSession newValue)
          Notifies this MediaStream that the MediaDevice (and respectively the MediaDeviceSession with it) which this instance uses for capture and playback of media has been changed.
 byte getActiveRTPExtensionID(RTPExtension rtpExtension)
          Returns the ID currently assigned to a specific RTP extension.
 Map<Byte,RTPExtension> getActiveRTPExtensions()
          Returns a map containing all currently active RTPExtensions in use by this stream.
protected  CsrcTransformEngine getCsrcEngine()
          Returns the engine that is responsible for adding the list of CSRC identifiers to outgoing RTP packets during a conference.
 AbstractMediaDevice getDevice()
          Gets the MediaDevice that this stream uses to play back and capture media.
protected  MediaDeviceSession getDeviceSession()
          Gets the MediaDeviceSession which represents the work of this MediaStream with its associated MediaDevice.
 MediaDirection getDirection()
          Gets the direction in which this MediaStream is allowed to stream media.
 byte getDynamicRTPPayloadType(String encoding)
          Returns the payload type number that has been negotiated for the specified encoding or -1 if no payload type has been negotiated for it.
 Map<Byte,MediaFormat> getDynamicRTPPayloadTypes()
          Gets the existing associations in this MediaStream of RTP payload types to MediaFormats.
 MediaFormat getFormat()
          Gets the MediaFormat that this stream is currently transmitting in.
 long[] getLocalContributingSourceIDs()
          Returns the list of CSRC identifiers for all parties currently known to contribute to the media that this stream is sending toward its remote counter part.
 long getLocalSourceID()
          Gets the synchronization source (SSRC) identifier of the local peer or -1 if it is not yet known.
protected  int getPriority()
          Used to set the priority of the receive/send streams.
 long[] getRemoteContributingSourceIDs()
          Returns the List of CSRC identifiers representing the parties contributing to the stream that we are receiving from this MediaStream's remote party.
 InetSocketAddress getRemoteControlAddress()
          Gets the address that this stream is sending RTCP traffic to.
 InetSocketAddress getRemoteDataAddress()
          Gets the address that this stream is sending RTP traffic to.
 long getRemoteSourceID()
          Get the synchronization source (SSRC) identifier of the remote peer or -1 if it is not yet known.
protected  RTPTransformConnector getRTPConnector()
          Gets the RTPConnector through which this instance sends and receives RTP and RTCP traffic.
 MediaStreamTarget getTarget()
          Returns the target of this MediaStream to which it is to send and from which it is to receive data (e.g.
 ZrtpControl getZrtpControl()
          Gets the ZrtpControl which controls the ZRTP of this stream.
protected  void handleAttributes(Map<String,String> attrs)
          Handles attributes contained in MediaFormat.
 boolean isMute()
          Determines whether this MediaStream is set to transmit "silence" instead of the media being fed from its MediaDevice.
 boolean isStarted()
          Determines whether start() has been called on this MediaStream without stop() or close() afterwards.
protected  void registerCustomCodecFormats(javax.media.rtp.RTPManager rtpManager)
          Registers any custom JMF Formats with a specific RTPManager.
protected  void rtpConnectorChanged(RTPTransformConnector oldValue, RTPTransformConnector newValue)
          Notifies this MediaStream implementation that its RTPConnector instance has changed from a specific old value to a specific new value.
 void setAdvancedAttributes(Map<String,String> attrs)
          Set list of advanced attributes.
 void setConnector(StreamConnector connector)
          Sets the StreamConnector to be used by this instance for sending and receiving media.
 void setDevice(MediaDevice device)
          Sets the MediaDevice that this stream should use to play back and capture media.
 void setDirection(MediaDirection direction)
          Sets the direction in which media in this MediaStream is to be streamed.
 void setFormat(MediaFormat format)
          Sets the MediaFormat that this MediaStream should transmit in.
protected  void setLocalSourceID(long ssrc)
          Sets the local SSRC identifier and fires the corresponding PropertyChangeEvent.
 void setMute(boolean mute)
          Causes this MediaStream to stop transmitting the media being fed from this stream's MediaDevice and transmit "silence" instead.
protected  void setRemoteSourceID(long ssrc)
          Sets the remote SSRC identifier and fires the corresponding PropertyChangeEvent.
 void setTarget(MediaStreamTarget target)
          Sets the target of this MediaStream to which it is to send and from which it is to receive data (e.g.
 void start()
          Starts capturing media from this stream's MediaDevice and then streaming it through the local StreamConnector toward the stream's target address and port.
 void stop()
          Stops all streaming and capturing in this MediaStream and closes and releases all open/allocated devices/resources.
static String toString(javax.media.protocol.DataSource dataSource)
          Returns a human-readable representation of a specific DataSource instance in the form of a String value.
 void update(javax.media.rtp.event.ReceiveStreamEvent event)
          Notifies this ReceiveStreamListener that the RTPManager it is registered with has generated an event related to a ReceiveStream.
 void update(javax.media.rtp.event.SendStreamEvent event)
          Notifies this SendStreamListener that the RTPManager it is registered with has generated an event related to a SendStream.
 void update(javax.media.rtp.event.SessionEvent event)
          Notifies this SessionListener that the RTPManager it is registered with has generated an event which pertains to the session as a whole and does not belong to a ReceiveStream or a SendStream or a remote participant necessarily.
 
Methods inherited from class net.java.sip.communicator.service.neomedia.AbstractMediaStream
addPropertyChangeListener, firePropertyChange, getName, matches, removePropertyChangeListener, setName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROPERTY_NAME_RECEIVE_BUFFER_LENGTH

protected static final String PROPERTY_NAME_RECEIVE_BUFFER_LENGTH
The name of the property indicating the length of our receive buffer.

See Also:
Constant Field Values

advancedAttributes

protected Map<String,String> advancedAttributes
Map of advanced attributes.

Constructor Detail

MediaStreamImpl

public MediaStreamImpl(MediaDevice device,
                       ZrtpControlImpl zrtpControl)
Initializes a new MediaStreamImpl instance which will use the specified MediaDevice for both capture and playback of media. The new instance will not have an associated StreamConnector and it must be set later for the new instance to be able to exchange media with a remote peer.

Parameters:
device - the MediaDevice the new instance is to use for both capture and playback of media
zrtpControl - an existing control instance to control the ZRTP operations

MediaStreamImpl

public MediaStreamImpl(StreamConnector connector,
                       MediaDevice device,
                       ZrtpControlImpl zrtpControl)
Initializes a new MediaStreamImpl instance which will use the specified MediaDevice for both capture and playback of media exchanged via the specified StreamConnector.

Parameters:
connector - the StreamConnector the new instance is to use for sending and receiving media or null if the StreamConnector of the new instance is to not be set at initialization time but specified later on
device - the MediaDevice the new instance is to use for both capture and playback of media exchanged via the specified StreamConnector
zrtpControl - an existing control instance to control the ZRTP operations or null if a new control instance is to be created by the new MediaStreamImpl
Method Detail

configureDataOutputStream

protected void configureDataOutputStream(RTPConnectorOutputStream dataOutputStream)
Performs any optional configuration on a specific RTPConnectorOuputStream of an RTPManager to be used by this MediaStreamImpl. Allows extenders to override.

Parameters:
dataOutputStream - the RTPConnectorOutputStream to be used by an RTPManager of this MediaStreamImpl and to be configured

configureDataInputStream

protected void configureDataInputStream(RTPConnectorInputStream dataInputStream)
Performs any optional configuration on a specific RTPConnectorInputStream of an RTPManager to be used by this MediaStreamImpl. Allows extenders to override.

Parameters:
dataInputStream - the RTPConnectorInputStream to be used by an RTPManager of this MediaStreamImpl and to be configured

configureRTPManagerBufferControl

protected void configureRTPManagerBufferControl(javax.media.rtp.RTPManager rtpManager,
                                                javax.media.control.BufferControl bufferControl)
Performs any optional configuration on the BufferControl of the specified RTPManager which is to be used as the RTPManager of this MediaStreamImpl. Allows extenders to override.

Parameters:
rtpManager - the RTPManager which is to be used by this MediaStreamImpl
bufferControl - the BufferControl of rtpManager on which any optional configuration is to be performed

createDtmfTransformEngine

protected DtmfTransformEngine createDtmfTransformEngine()
A stub that allows audio oriented streams to create and keep a reference to a DtmfTransformEngine.

Returns:
a DtmfTransformEngine if this is an audio oriented stream and null otherwise.

addDynamicRTPPayloadType

public void addDynamicRTPPayloadType(byte rtpPayloadType,
                                     MediaFormat format)
Adds a new association in this MediaStream of the specified RTP payload type with the specified MediaFormat in order to allow it to report rtpPayloadType in RTP flows sending and receiving media in format. Usually, rtpPayloadType will be in the range of dynamic RTP payload types.

Specified by:
addDynamicRTPPayloadType in interface MediaStream
Parameters:
rtpPayloadType - the RTP payload type to be associated in this MediaStream with the specified MediaFormat
format - the MediaFormat to be associated in this MediaStream with rtpPayloadType
See Also:
MediaStream.addDynamicRTPPayloadType(byte, MediaFormat)

addRTPExtension

public void addRTPExtension(byte extensionID,
                            RTPExtension rtpExtension)
Maps or updates the mapping between extensionID and rtpExtension. If rtpExtension's MediaDirection attribute is set to INACTIVE the mapping is removed from the local extensions table and the extension would not be transmitted or handled by this stream's RTPConnector.

Specified by:
addRTPExtension in interface MediaStream
Parameters:
extensionID - the ID that is being mapped to rtpExtension
rtpExtension - the RTPExtension that we are mapping.

getActiveRTPExtensions

public Map<Byte,RTPExtension> getActiveRTPExtensions()
Returns a map containing all currently active RTPExtensions in use by this stream.

Specified by:
getActiveRTPExtensions in interface MediaStream
Returns:
a map containing all currently active RTPExtensions in use by this stream.

getActiveRTPExtensionID

public byte getActiveRTPExtensionID(RTPExtension rtpExtension)
Returns the ID currently assigned to a specific RTP extension.

Parameters:
rtpExtension - the RTP extension to get the currently assigned ID of
Returns:
the ID currently assigned to the specified RTP extension or -1 if no ID has been defined for this extension so far

getCsrcEngine

protected CsrcTransformEngine getCsrcEngine()
Returns the engine that is responsible for adding the list of CSRC identifiers to outgoing RTP packets during a conference.

Returns:
the engine that is responsible for adding the list of CSRC identifiers to outgoing RTP packets during a conference.

setAdvancedAttributes

public void setAdvancedAttributes(Map<String,String> attrs)
Set list of advanced attributes.

Parameters:
attrs - advanced attributes map

close

public void close()
Releases the resources allocated by this instance in the course of its execution and prepares it to be garbage collected.

Specified by:
close in interface MediaStream
See Also:
MediaStream.close()

deviceSessionChanged

protected void deviceSessionChanged(MediaDeviceSession oldValue,
                                    MediaDeviceSession newValue)
Notifies this MediaStream that the MediaDevice (and respectively the MediaDeviceSession with it) which this instance uses for capture and playback of media has been changed. Allows extenders to override and provide additional processing of oldValue and newValue.

Parameters:
oldValue - the MediaDeviceSession with the MediaDevice this instance used work with
newValue - the MediaDeviceSession with the MediaDevice this instance is to work with

getDevice

public AbstractMediaDevice getDevice()
Gets the MediaDevice that this stream uses to play back and capture media.

Specified by:
getDevice in interface MediaStream
Returns:
the MediaDevice that this stream uses to play back and capture media
See Also:
MediaStream.getDevice()

getDeviceSession

protected MediaDeviceSession getDeviceSession()
Gets the MediaDeviceSession which represents the work of this MediaStream with its associated MediaDevice.

Returns:
the MediaDeviceSession which represents the work of this MediaStream with its associated MediaDevice

getDirection

public MediaDirection getDirection()
Gets the direction in which this MediaStream is allowed to stream media.

Specified by:
getDirection in interface MediaStream
Returns:
the MediaDirection in which this MediaStream is allowed to stream media
See Also:
MediaStream.getDirection()

getDynamicRTPPayloadTypes

public Map<Byte,MediaFormat> getDynamicRTPPayloadTypes()
Gets the existing associations in this MediaStream of RTP payload types to MediaFormats. The returned Map only contains associations previously added in this instance with addDynamicRTPPayloadType(byte, MediaFormat) and not globally or well-known associations reported by MediaFormat.getRTPPayloadType().

Specified by:
getDynamicRTPPayloadTypes in interface MediaStream
Returns:
a Map of RTP payload type expressed as Byte to MediaFormat describing the existing (dynamic) associations in this instance of RTP payload types to MediaFormats. The Map represents a snapshot of the existing associations at the time of the getDynamicRTPPayloadTypes() method call and modifications to it are not reflected on the internal storage
See Also:
MediaStream.getDynamicRTPPayloadTypes()

getDynamicRTPPayloadType

public byte getDynamicRTPPayloadType(String encoding)
Returns the payload type number that has been negotiated for the specified encoding or -1 if no payload type has been negotiated for it. If multiple formats match the specified encoding, then this method would return the first one it encounters while iterating through the map.

Parameters:
encoding - the encoding whose payload type we are trying to obtain.
Returns:
the payload type number that has been negotiated for the specified encoding or -1 if no payload type has been negotiated for it.

getFormat

public MediaFormat getFormat()
Gets the MediaFormat that this stream is currently transmitting in.

Specified by:
getFormat in interface MediaStream
Returns:
the MediaFormat that this stream is currently transmitting in
See Also:
MediaStream.getFormat()

getLocalSourceID

public long getLocalSourceID()
Gets the synchronization source (SSRC) identifier of the local peer or -1 if it is not yet known.

Specified by:
getLocalSourceID in interface MediaStream
Returns:
the synchronization source (SSRC) identifier of the local peer or -1 if it is not yet known
See Also:
MediaStream.getLocalSourceID()

getRemoteControlAddress

public InetSocketAddress getRemoteControlAddress()
Gets the address that this stream is sending RTCP traffic to.

Specified by:
getRemoteControlAddress in interface MediaStream
Returns:
an InetSocketAddress instance indicating the address that this stream is sending RTCP traffic to
See Also:
MediaStream.getRemoteControlAddress()

getRemoteDataAddress

public InetSocketAddress getRemoteDataAddress()
Gets the address that this stream is sending RTP traffic to.

Specified by:
getRemoteDataAddress in interface MediaStream
Returns:
an InetSocketAddress instance indicating the address that this stream is sending RTP traffic to
See Also:
MediaStream.getRemoteDataAddress()

getRemoteSourceID

public long getRemoteSourceID()
Get the synchronization source (SSRC) identifier of the remote peer or -1 if it is not yet known.

Specified by:
getRemoteSourceID in interface MediaStream
Returns:
the synchronization source (SSRC) identifier of the remote peer or -1 if it is not yet known
See Also:
MediaStream.getRemoteSourceID()

getRTPConnector

protected RTPTransformConnector getRTPConnector()
Gets the RTPConnector through which this instance sends and receives RTP and RTCP traffic.

Returns:
the RTPConnector through which this instance sends and receives RTP and RTCP traffic

getZrtpControl

public ZrtpControl getZrtpControl()
Gets the ZrtpControl which controls the ZRTP of this stream.

Specified by:
getZrtpControl in interface MediaStream
Returns:
the ZrtpControl which controls the ZRTP of this stream

isMute

public boolean isMute()
Determines whether this MediaStream is set to transmit "silence" instead of the media being fed from its MediaDevice. "Silence" for video is understood as video data which is not the captured video data and may represent, for example, a black image.

Specified by:
isMute in interface MediaStream
Returns:
true if this MediaStream is set to transmit "silence" instead of the media fed from its MediaDevice; false, otherwise
See Also:
MediaStream.isMute()

isStarted

public boolean isStarted()
Determines whether start() has been called on this MediaStream without stop() or close() afterwards.

Specified by:
isStarted in interface MediaStream
Returns:
true if start() has been called on this MediaStream without stop() or close() afterwards
See Also:
MediaStream.isStarted()

registerCustomCodecFormats

protected void registerCustomCodecFormats(javax.media.rtp.RTPManager rtpManager)
Registers any custom JMF Formats with a specific RTPManager. Extenders should override in order to register their own customizations and should call back to this super implementation during the execution of their override in order to register the associations defined in this instance of (dynamic) RTP payload types to MediaFormats.

Parameters:
rtpManager - the RTPManager to register any custom JMF Formats with

rtpConnectorChanged

protected void rtpConnectorChanged(RTPTransformConnector oldValue,
                                   RTPTransformConnector newValue)
Notifies this MediaStream implementation that its RTPConnector instance has changed from a specific old value to a specific new value. Allows extenders to override and perform additional processing after this MediaStream has changed its RTPConnector instance.

Parameters:
oldValue - the RTPConnector of this MediaStream implementation before it got changed to newValue
newValue - the current RTPConnector of this MediaStream which replaced oldValue

setConnector

public void setConnector(StreamConnector connector)
Sets the StreamConnector to be used by this instance for sending and receiving media.

Specified by:
setConnector in interface MediaStream
Parameters:
connector - the StreamConnector to be used by this instance for sending and receiving media

setDevice

public void setDevice(MediaDevice device)
Sets the MediaDevice that this stream should use to play back and capture media.

Note: Also resets any previous direction set with setDirection(MediaDirection) to the direction of the specified MediaDevice.

Specified by:
setDevice in interface MediaStream
Parameters:
device - the MediaDevice that this stream should use to play back and capture media
See Also:
MediaStream.setDevice(MediaDevice)

setDirection

public void setDirection(MediaDirection direction)
Sets the direction in which media in this MediaStream is to be streamed. If this MediaStream is not currently started, calls to start() later on will start it only in the specified direction. If it is currently started in a direction different than the specified, directions other than the specified will be stopped.

Specified by:
setDirection in interface MediaStream
Parameters:
direction - the MediaDirection in which this MediaStream is to stream media when it is started
See Also:
MediaStream.setDirection(MediaDirection)

setFormat

public void setFormat(MediaFormat format)
Sets the MediaFormat that this MediaStream should transmit in.

Specified by:
setFormat in interface MediaStream
Parameters:
format - the MediaFormat that this MediaStream should transmit in
See Also:
MediaStream.setFormat(MediaFormat)

handleAttributes

protected void handleAttributes(Map<String,String> attrs)
Handles attributes contained in MediaFormat.

Parameters:
attrs - the attributes list to handle

setMute

public void setMute(boolean mute)
Causes this MediaStream to stop transmitting the media being fed from this stream's MediaDevice and transmit "silence" instead. "Silence" for video is understood as video data which is not the captured video data and may represent, for example, a black image.

Specified by:
setMute in interface MediaStream
Parameters:
mute - true to have this MediaStream transmit "silence" instead of the actual media data that it captures from its MediaDevice; false to transmit actual media data captured from the MediaDevice of this MediaStream
See Also:
MediaStream.setMute(boolean)

getTarget

public MediaStreamTarget getTarget()
Returns the target of this MediaStream to which it is to send and from which it is to receive data (e.g. RTP) and control data (e.g. RTCP).

Specified by:
getTarget in interface MediaStream
Returns:
the MediaStreamTarget describing the data (e.g. RTP) and the control data (e.g. RTCP) locations to which this MediaStream is to send and from which it is to receive
See Also:
MediaStream.setTarget(MediaStreamTarget)

setTarget

public void setTarget(MediaStreamTarget target)
Sets the target of this MediaStream to which it is to send and from which it is to receive data (e.g. RTP) and control data (e.g. RTCP).

Specified by:
setTarget in interface MediaStream
Parameters:
target - the MediaStreamTarget describing the data (e.g. RTP) and the control data (e.g. RTCP) locations to which this MediaStream is to send and from which it is to receive
See Also:
MediaStream.setTarget(MediaStreamTarget)

start

public void start()
Starts capturing media from this stream's MediaDevice and then streaming it through the local StreamConnector toward the stream's target address and port. Also puts the MediaStream in a listening state which make it play all media received from the StreamConnector on the stream's MediaDevice.

Specified by:
start in interface MediaStream
See Also:
MediaStream.start()

stop

public void stop()
Stops all streaming and capturing in this MediaStream and closes and releases all open/allocated devices/resources. Has no effect if this MediaStream is already closed and is simply ignored.

Specified by:
stop in interface MediaStream
See Also:
MediaStream.stop()

toString

public static String toString(javax.media.protocol.DataSource dataSource)
Returns a human-readable representation of a specific DataSource instance in the form of a String value.

Parameters:
dataSource - the DataSource to return a human-readable representation of
Returns:
a String value which gives a human-readable representation of the specified dataSource

update

public void update(javax.media.rtp.event.ReceiveStreamEvent event)
Notifies this ReceiveStreamListener that the RTPManager it is registered with has generated an event related to a ReceiveStream.

Specified by:
update in interface javax.media.rtp.ReceiveStreamListener
Parameters:
event - the ReceiveStreamEvent which specifies the ReceiveStream that is the cause of the event and the very type of the event
See Also:
ReceiveStreamListener.update(ReceiveStreamEvent)

update

public void update(javax.media.rtp.event.SendStreamEvent event)
Notifies this SendStreamListener that the RTPManager it is registered with has generated an event related to a SendStream.

Specified by:
update in interface javax.media.rtp.SendStreamListener
Parameters:
event - the SendStreamEvent which specifies the SendStream that is the cause of the event and the very type of the event
See Also:
SendStreamListener.update(SendStreamEvent)

update

public void update(javax.media.rtp.event.SessionEvent event)
Notifies this SessionListener that the RTPManager it is registered with has generated an event which pertains to the session as a whole and does not belong to a ReceiveStream or a SendStream or a remote participant necessarily.

Specified by:
update in interface javax.media.rtp.SessionListener
Parameters:
event - the SessionEvent which specifies the source and the very type of the event
See Also:
SessionListener.update(SessionEvent)

setLocalSourceID

protected void setLocalSourceID(long ssrc)
Sets the local SSRC identifier and fires the corresponding PropertyChangeEvent.

Parameters:
ssrc - the SSRC identifier that this stream will be using in outgoing RTP packets from now on.

setRemoteSourceID

protected void setRemoteSourceID(long ssrc)
Sets the remote SSRC identifier and fires the corresponding PropertyChangeEvent.

Parameters:
ssrc - the SSRC identifier that this stream will be using in outgoing RTP packets from now on.

getLocalContributingSourceIDs

public long[] getLocalContributingSourceIDs()
Returns the list of CSRC identifiers for all parties currently known to contribute to the media that this stream is sending toward its remote counter part. In other words, the method returns the list of CSRC IDs that this stream will include in outgoing RTP packets. This method will return an null in case this stream is not part of a mixed conference call.

Returns:
a long[] array of CSRC IDs representing parties that are currently known to contribute to the media that this stream is sending or an null in case this MediaStream is not part of a conference call.

getRemoteContributingSourceIDs

public long[] getRemoteContributingSourceIDs()
Returns the List of CSRC identifiers representing the parties contributing to the stream that we are receiving from this MediaStream's remote party.

Returns:
a List of CSRC identifiers representing the parties contributing to the stream that we are receiving from this MediaStream's remote party.

getPriority

protected int getPriority()
Used to set the priority of the receive/send streams. Underling implementations can override this and return different than current default value.

Returns:
the priority for the current thread.

SIP Communicator: the OpenSource Java VoIP and Instant Messaging client.

SIP Communicator, the OpenSource Java VoIP and Instant Messaging client.
Distributable under LGPL license.