|
SIP Communicator: the OpenSource Java VoIP and Instant Messaging client. | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.java.sip.communicator.service.neomedia.AbstractMediaStream
net.java.sip.communicator.impl.neomedia.MediaStreamImpl
public class MediaStreamImpl
Implements MediaStream using JMF.
| 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 |
|---|
protected static final String PROPERTY_NAME_RECEIVE_BUFFER_LENGTH
protected Map<String,String> advancedAttributes
| Constructor Detail |
|---|
public MediaStreamImpl(MediaDevice device,
ZrtpControlImpl zrtpControl)
device - the MediaDevice the new instance is to use for
both capture and playback of mediazrtpControl - an existing control instance to control the ZRTP
operations
public MediaStreamImpl(StreamConnector connector,
MediaDevice device,
ZrtpControlImpl zrtpControl)
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 ondevice - the MediaDevice the new instance is to use for
both capture and playback of media exchanged via the specified
StreamConnectorzrtpControl - 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 |
|---|
protected void configureDataOutputStream(RTPConnectorOutputStream dataOutputStream)
dataOutputStream - the RTPConnectorOutputStream to be used
by an RTPManager of this MediaStreamImpl and to be
configuredprotected void configureDataInputStream(RTPConnectorInputStream dataInputStream)
dataInputStream - the RTPConnectorInputStream to be used
by an RTPManager of this MediaStreamImpl and to be
configured
protected void configureRTPManagerBufferControl(javax.media.rtp.RTPManager rtpManager,
javax.media.control.BufferControl bufferControl)
rtpManager - the RTPManager which is to be used by this
MediaStreamImplbufferControl - the BufferControl of rtpManager on
which any optional configuration is to be performedprotected DtmfTransformEngine createDtmfTransformEngine()
public void addDynamicRTPPayloadType(byte rtpPayloadType,
MediaFormat format)
addDynamicRTPPayloadType in interface MediaStreamrtpPayloadType - the RTP payload type to be associated in this
MediaStream with the specified MediaFormatformat - the MediaFormat to be associated in this
MediaStream with rtpPayloadTypeMediaStream.addDynamicRTPPayloadType(byte, MediaFormat)
public void addRTPExtension(byte extensionID,
RTPExtension rtpExtension)
addRTPExtension in interface MediaStreamextensionID - the ID that is being mapped to rtpExtensionrtpExtension - the RTPExtension that we are mapping.public Map<Byte,RTPExtension> getActiveRTPExtensions()
getActiveRTPExtensions in interface MediaStreampublic byte getActiveRTPExtensionID(RTPExtension rtpExtension)
rtpExtension - the RTP extension to get the currently assigned ID of
protected CsrcTransformEngine getCsrcEngine()
public void setAdvancedAttributes(Map<String,String> attrs)
attrs - advanced attributes mappublic void close()
close in interface MediaStreamMediaStream.close()
protected void deviceSessionChanged(MediaDeviceSession oldValue,
MediaDeviceSession newValue)
oldValue - the MediaDeviceSession with the
MediaDevice this instance used work withnewValue - the MediaDeviceSession with the
MediaDevice this instance is to work withpublic AbstractMediaDevice getDevice()
getDevice in interface MediaStreamMediaStream.getDevice()protected MediaDeviceSession getDeviceSession()
public MediaDirection getDirection()
getDirection in interface MediaStreamMediaStream.getDirection()public Map<Byte,MediaFormat> getDynamicRTPPayloadTypes()
addDynamicRTPPayloadType(byte, MediaFormat) and not globally or
well-known associations reported by
MediaFormat.getRTPPayloadType().
getDynamicRTPPayloadTypes in interface MediaStreamMediaStream.getDynamicRTPPayloadTypes()public byte getDynamicRTPPayloadType(String encoding)
encoding - the encoding whose payload type we are trying to obtain.
public MediaFormat getFormat()
getFormat in interface MediaStreamMediaStream.getFormat()public long getLocalSourceID()
getLocalSourceID in interface MediaStreamMediaStream.getLocalSourceID()public InetSocketAddress getRemoteControlAddress()
getRemoteControlAddress in interface MediaStreamMediaStream.getRemoteControlAddress()public InetSocketAddress getRemoteDataAddress()
getRemoteDataAddress in interface MediaStreamMediaStream.getRemoteDataAddress()public long getRemoteSourceID()
getRemoteSourceID in interface MediaStreamMediaStream.getRemoteSourceID()protected RTPTransformConnector getRTPConnector()
public ZrtpControl getZrtpControl()
getZrtpControl in interface MediaStreampublic boolean isMute()
isMute in interface MediaStreamMediaStream.isMute()public boolean isStarted()
start() has been called on this
MediaStream without stop() or close()
afterwards.
isStarted in interface MediaStreamstart() has been called on this
MediaStream without stop() or close()
afterwardsMediaStream.isStarted()protected void registerCustomCodecFormats(javax.media.rtp.RTPManager rtpManager)
rtpManager - the RTPManager to register any custom JMF
Formats with
protected void rtpConnectorChanged(RTPTransformConnector oldValue,
RTPTransformConnector newValue)
oldValue - the RTPConnector of this MediaStream
implementation before it got changed to newValuenewValue - the current RTPConnector of this
MediaStream which replaced oldValuepublic void setConnector(StreamConnector connector)
setConnector in interface MediaStreamconnector - the StreamConnector to be used by this instance
for sending and receiving mediapublic void setDevice(MediaDevice device)
Note: Also resets any previous direction set with
setDirection(MediaDirection) to the direction of the specified
MediaDevice.
setDevice in interface MediaStreamdevice - the MediaDevice that this stream should use to
play back and capture mediaMediaStream.setDevice(MediaDevice)public void setDirection(MediaDirection direction)
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.
setDirection in interface MediaStreamdirection - the MediaDirection in which this
MediaStream is to stream media when it is startedMediaStream.setDirection(MediaDirection)public void setFormat(MediaFormat format)
setFormat in interface MediaStreamformat - the MediaFormat that this MediaStream
should transmit inMediaStream.setFormat(MediaFormat)protected void handleAttributes(Map<String,String> attrs)
attrs - the attributes list to handlepublic void setMute(boolean mute)
setMute in interface MediaStreammute - 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 MediaStreamMediaStream.setMute(boolean)public MediaStreamTarget getTarget()
getTarget in interface MediaStreamMediaStream.setTarget(MediaStreamTarget)public void setTarget(MediaStreamTarget target)
setTarget in interface MediaStreamtarget - 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 receiveMediaStream.setTarget(MediaStreamTarget)public void start()
start in interface MediaStreamMediaStream.start()public void stop()
stop in interface MediaStreamMediaStream.stop()public static String toString(javax.media.protocol.DataSource dataSource)
dataSource - the DataSource to return a human-readable
representation of
public void update(javax.media.rtp.event.ReceiveStreamEvent event)
update in interface javax.media.rtp.ReceiveStreamListenerevent - the ReceiveStreamEvent which specifies the
ReceiveStream that is the cause of the event and the very type
of the eventReceiveStreamListener.update(ReceiveStreamEvent)public void update(javax.media.rtp.event.SendStreamEvent event)
update in interface javax.media.rtp.SendStreamListenerevent - the SendStreamEvent which specifies the
SendStream that is the cause of the event and the very type of
the eventSendStreamListener.update(SendStreamEvent)public void update(javax.media.rtp.event.SessionEvent event)
update in interface javax.media.rtp.SessionListenerevent - the SessionEvent which specifies the source and the
very type of the eventSessionListener.update(SessionEvent)protected void setLocalSourceID(long ssrc)
ssrc - the SSRC identifier that this stream will be using in
outgoing RTP packets from now on.protected void setRemoteSourceID(long ssrc)
ssrc - the SSRC identifier that this stream will be using in
outgoing RTP packets from now on.public long[] getLocalContributingSourceIDs()
public long[] getRemoteContributingSourceIDs()
protected int getPriority()
|
SIP Communicator: the OpenSource Java VoIP and Instant Messaging client. | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||