public abstract class AbstractMediaStream extends java.lang.Object implements MediaStream
Modifier and Type | Field and Description |
---|---|
protected RTPTranslator |
rtpTranslator
The RTPTranslator, if any, which forwards RTP and RTCP traffic
between this and other MediaStreams.
|
PNAME_LOCAL_SSRC, PNAME_REMOTE_SSRC
Constructor and Description |
---|
AbstractMediaStream() |
Modifier and Type | Method and Description |
---|---|
void |
addPropertyChangeListener(java.beans.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 |
assertDirection(MediaDirection direction,
MediaDirection deviceDirection,
java.lang.String illegalArgumentExceptionMessage)
Asserts that the state of this instance will remain consistent if a
specific MediaDirection (i.e.
|
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 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.
|
byte |
getDynamicRTPPayloadType(java.lang.String codec)
Returns the payload type number that has been negotiated for the
specified encoding or -1 if no payload type has been
negotiated for it.
|
MediaFormat |
getFormat(byte pt)
Returns the MediaFormat that is associated to the payload type
passed in as a parameter.
|
MediaStreamTrackReceiver |
getMediaStreamTrackReceiver()
Gets the
MediaStreamTrackReceiver of this MediaStream . |
java.lang.String |
getName()
Returns the name of this stream or null if no name has been
set.
|
REDBlock |
getPrimaryREDBlock(ByteArrayBuffer baf)
Gets the primary
REDBlock that contains the payload of the RTP
packet passed in as a parameter. |
REDBlock |
getPrimaryREDBlock(RawPacket pkt)
Gets the primary
REDBlock that contains the payload of the RTP
packet passed in as a parameter. |
java.lang.Object |
getProperty(java.lang.String propertyName)
Gets the value of a specific opaque property of this
MediaStream.
|
RTPTranslator |
getRTPTranslator()
Gets the
RTPTranslator which forwards RTP and RTCP traffic
between this and other MediaStream s. |
TransformEngineChain |
getTransformEngineChain()
Gets the
TransformEngineChain of this MediaStream . |
protected void |
handleAttributes(MediaFormat format,
java.util.Map<java.lang.String,java.lang.String> attrs)
Handles attributes contained in MediaFormat.
|
void |
injectPacket(RawPacket pkt,
boolean data)
Sends a given RTP or RTCP packet to the remote peer/side.
|
void |
removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Removes the specified PropertyChangeListener from this stream so
that it won't receive further property change events.
|
void |
setName(java.lang.String name)
Sets the name of this stream.
|
void |
setProperty(java.lang.String propertyName,
java.lang.Object value)
Sets the value of a specific opaque property of this
MediaStream.
|
void |
setRTPTranslator(RTPTranslator rtpTranslator)
Sets the RTPTranslator which is to forward RTP and RTCP traffic
between this and other MediaStreams.
|
void |
setTransportCCEngine(TransportCCEngine engine)
Sets the
TransportCCEngine of this media stream. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addDynamicRTPPayloadType, addDynamicRTPPayloadTypeOverride, addRTPExtension, clearDynamicRTPPayloadTypes, clearRTPExtensions, close, getActiveRTPExtensions, getDevice, getDirection, getDynamicRTPPayloadTypes, getFormat, getLocalSourceID, getMediaStreamStats, getRemoteControlAddress, getRemoteDataAddress, getRemoteSourceID, getRemoteSourceIDs, getRetransmissionRequester, getSrtpControl, getStreamRTPManager, getTarget, getTransportProtocol, injectPacket, isKeyFrame, isKeyFrame, isMute, isStarted, removeReceiveStreamForSsrc, setConnector, setDevice, setDirection, setExternalTransformer, setFormat, setMute, setSSRCFactory, setTarget, start, stop
protected RTPTranslator rtpTranslator
public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
addPropertyChangeListener
in interface MediaStream
listener
- the PropertyChangeListener to register for
PropertyChangeEventsMediaStream.addPropertyChangeListener(PropertyChangeListener)
protected void assertDirection(MediaDirection direction, MediaDirection deviceDirection, java.lang.String illegalArgumentExceptionMessage) throws java.lang.IllegalArgumentException
direction
- the MediaDirection to validate against the
specified deviceDirectiondeviceDirection
- the MediaDirection of a
MediaDevice to validate against the specified directionillegalArgumentExceptionMessage
- the message of the
IllegalArgumentException to be thrown if the state of this
instance would've been compromised if direction and the
MediaDevice associated with deviceDirection were both
set on this instancejava.lang.IllegalArgumentException
- if the state of this instance would've
been compromised were both direction and the
MediaDevice associated with deviceDirection set on this
instanceprotected void firePropertyChange(java.lang.String property, java.lang.Object oldValue, java.lang.Object newValue)
property
- the name of the property of this instance 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 java.lang.String getName()
getName
in interface MediaStream
public java.lang.Object getProperty(java.lang.String propertyName)
getProperty
in interface MediaStream
propertyName
- the name of the opaque property of this
MediaStream the value of which is to be returnedprotected void handleAttributes(MediaFormat format, java.util.Map<java.lang.String,java.lang.String> attrs)
format
- the MediaFormat to handle the attributes ofattrs
- the attributes Map to handlepublic void injectPacket(RawPacket pkt, boolean data) throws TransmissionFailedException
pkt
- the packet to send.data
- true
to send an RTP packet or false
to send
an RTCP packet.TransmissionFailedException
- if the transmission failed.public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
removePropertyChangeListener
in interface MediaStream
listener
- the PropertyChangeListener to removeMediaStream.removePropertyChangeListener(PropertyChangeListener)
public void setName(java.lang.String name)
setName
in interface MediaStream
name
- the name of this stream or null if no name has been
set.public void setProperty(java.lang.String propertyName, java.lang.Object value)
setProperty
in interface MediaStream
propertyName
- the name of the opaque property of this
MediaStream the value of which is to be set to the specified
valuevalue
- the value of the opaque property of this
MediaStream specified by propertyName to be setpublic void setRTPTranslator(RTPTranslator rtpTranslator)
setRTPTranslator
in interface MediaStream
rtpTranslator
- the RTPTranslator which is to forward RTP
and RTCP traffic between this and other MediaStreamspublic RTPTranslator getRTPTranslator()
RTPTranslator
which forwards RTP and RTCP traffic
between this and other MediaStream
s.getRTPTranslator
in interface MediaStream
RTPTranslator
which forwards RTP and RTCP traffic
between this and other MediaStream
s or null
public TransformEngineChain getTransformEngineChain()
TransformEngineChain
of this MediaStream
.getTransformEngineChain
in interface MediaStream
public byte getDynamicRTPPayloadType(java.lang.String codec)
getDynamicRTPPayloadType
in interface MediaStream
codec
- the encoding whose payload type we are trying to obtain.public MediaStreamTrackReceiver getMediaStreamTrackReceiver()
MediaStreamTrackReceiver
of this MediaStream
.getMediaStreamTrackReceiver
in interface MediaStream
MediaStreamTrackReceiver
of this MediaStream
,
or null.public MediaFormat getFormat(byte pt)
getFormat
in interface MediaStream
pt
- the payload type of the MediaFormat to get.public void setTransportCCEngine(TransportCCEngine engine)
TransportCCEngine
of this media stream. Note that for
this to take effect it needs to be called early, before the transform
chain is initialized (i.e. before a connector is set).setTransportCCEngine
in interface MediaStream
engine
- the engine to set.public REDBlock getPrimaryREDBlock(ByteArrayBuffer baf)
REDBlock
that contains the payload of the RTP
packet passed in as a parameter.getPrimaryREDBlock
in interface MediaStream
baf
- the ByteArrayBuffer
that holds the RTP payload.REDBlock
that contains the payload of the RTP
packet passed in as a parameter, or null if the buffer is invalid.public REDBlock getPrimaryREDBlock(RawPacket pkt)
REDBlock
that contains the payload of the RTP
packet passed in as a parameter.getPrimaryREDBlock
in interface MediaStream
pkt
- the RawPacket
that holds the RTP payload.REDBlock
that contains the payload of the RTP
packet passed in as a parameter, or null if the buffer is invalid.
Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under Apache license.