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

net.java.sip.communicator.service.neomedia
Class AbstractMediaStream

java.lang.Object
  extended by net.java.sip.communicator.service.neomedia.AbstractMediaStream
All Implemented Interfaces:
MediaStream
Direct Known Subclasses:
MediaStreamImpl

public abstract class AbstractMediaStream
extends Object
implements MediaStream

Abstract base implementation of MediaStream to ease the implementation of the interface.

Author:
Lubomir Marinov

Field Summary
 
Fields inherited from interface net.java.sip.communicator.service.neomedia.MediaStream
PNAME_LOCAL_SSRC, PNAME_REMOTE_SSRC
 
Constructor Summary
AbstractMediaStream()
           
 
Method Summary
 void addPropertyChangeListener(PropertyChangeListener listener)
          Adds a PropertyChangelistener to this stream which is to be notified upon property changes such as a SSRC ID which becomes known.
protected  void firePropertyChange(String property, Object oldValue, Object newValue)
          Fires a new PropertyChangeEvent to the PropertyChangeListeners registered with this instance 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.
 String getName()
          Returns the name of this stream or null if no name has been set.
static boolean matches(MediaFormat format, MediaType mediaType, String encoding, double clockRate, int channels)
          Determines whether a specific MediaFormat has specific values for its properties mediaType, encoding, clockRate and channels for MediaFormats with mediaType equal to MediaType.AUDIO.
 void removePropertyChangeListener(PropertyChangeListener listener)
          Removes the specified PropertyChangeListener from this stream so that it won't receive further property change events.
 void setName(String streamName)
          Sets the name of this stream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface net.java.sip.communicator.service.neomedia.MediaStream
addDynamicRTPPayloadType, addRTPExtension, close, getActiveRTPExtensions, getDevice, getDirection, getDynamicRTPPayloadTypes, getFormat, getLocalSourceID, getRemoteControlAddress, getRemoteDataAddress, getRemoteSourceID, getTarget, getZrtpControl, isMute, isStarted, setConnector, setDevice, setDirection, setFormat, setMute, setTarget, start, stop
 

Constructor Detail

AbstractMediaStream

public AbstractMediaStream()
Method Detail

addPropertyChangeListener

public void addPropertyChangeListener(PropertyChangeListener listener)
Adds a PropertyChangelistener to this stream which is to be notified upon property changes such as a SSRC ID which becomes known.

Specified by:
addPropertyChangeListener in interface MediaStream
Parameters:
listener - the PropertyChangeListener to register for PropertyChangeEvents
See Also:
MediaStream.addPropertyChangeListener(PropertyChangeListener)

firePropertyChange

protected void firePropertyChange(String property,
                                  Object oldValue,
                                  Object newValue)
Fires a new PropertyChangeEvent to the PropertyChangeListeners registered with this instance 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.

Parameters:
property - the name of the property of this instance which had its value changed
oldValue - the value of the property with the specified name before the change
newValue - the value of the property with the specified name after the change

matches

public static boolean matches(MediaFormat format,
                              MediaType mediaType,
                              String encoding,
                              double clockRate,
                              int channels)
Determines whether a specific MediaFormat has specific values for its properties mediaType, encoding, clockRate and channels for MediaFormats with mediaType equal to MediaType.AUDIO.

Parameters:
format - the MediaFormat whose properties we'd like to examine
mediaType - the type we expect MediaFormat to have
encoding - the encoding we are looking for.
clockRate - the clock rate that we'd like the format to have.
channels - the number of channels that expect to find in this format
Returns:
true if the specified format has specific values for its properties mediaType, encoding, clockRate and channels; otherwise, false

getName

public String getName()
Returns the name of this stream or null if no name has been set. A stream name is used by some protocols, for diagnostic purposes mostly. In XMPP for example this is the name of the content element that describes a stream.

Specified by:
getName in interface MediaStream
Returns:
the name of this stream or null if no name has been set.

setName

public void setName(String streamName)
Sets the name of this stream. Stream names are used by some protocols, for diagnostic purposes mostly. In XMPP for example this is the name of the content element that describes a stream.

Specified by:
setName in interface MediaStream
Parameters:
streamName - the name of this stream or null if no name has been set.

removePropertyChangeListener

public void removePropertyChangeListener(PropertyChangeListener listener)
Removes the specified PropertyChangeListener from this stream so that it won't receive further property change events.

Specified by:
removePropertyChangeListener in interface MediaStream
Parameters:
listener - the PropertyChangeListener to remove
See Also:
MediaStream.removePropertyChangeListener(PropertyChangeListener)

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

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