public class MediaStreamTrackReceiver extends SinglePacketTransformerAdapter implements TransformEngine
MediaStreamTrackDesc
s for a MediaStream
. It
is also part of the MediaStream
's transform chain and has the
opportunity to update its MediaStreamTrackDesc
s with received
packets.
This default implementation does no update the MediaStreamTrackDesc
s,
it only serves to contain the signalled tracks and encodings.Constructor and Description |
---|
MediaStreamTrackReceiver(MediaStreamImpl stream)
Ctor.
|
Modifier and Type | Method and Description |
---|---|
MediaStreamTrackDesc |
findMediaStreamTrackDesc(long ssrc)
Finds the
MediaStreamTrackDesc that corresponds to the SSRC that
is specified in the arguments. |
RTPEncodingDesc |
findRTPEncodingDesc(long ssrc)
Finds the
RTPEncodingDesc that matches ByteArrayBuffer
passed in as a parameter. |
RTPEncodingDesc |
findRTPEncodingDesc(RawPacket pkt)
Finds the
RTPEncodingDesc that matches the RawPacket
passed in as a parameter. |
MediaStreamTrackDesc[] |
getMediaStreamTracks()
Gets the
MediaStreamTrackDesc s that this instance is configured
to receive. |
PacketTransformer |
getRTCPTransformer()
Gets the PacketTransformer for RTCP packets.
|
PacketTransformer |
getRTPTransformer()
Gets the PacketTransformer for RTP packets.
|
MediaStreamImpl |
getStream()
Gets the
MediaStream that owns this instance. |
boolean |
setMediaStreamTracks(MediaStreamTrackDesc[] newTracks)
Updates this
MediaStreamTrackReceiver with the new RTP encoding
parameters. |
reverseTransform, transform
close, reverseTransform, transform
public MediaStreamTrackReceiver(MediaStreamImpl stream)
stream
- The MediaStream
that this instance receives
MediaStreamTrackDesc
s from.public RTPEncodingDesc findRTPEncodingDesc(RawPacket pkt)
RTPEncodingDesc
that matches the RawPacket
passed in as a parameter. Assumes that the packet is valid.pkt
- the packet to match.RTPEncodingDesc
that matches the pkt passed in as
a parameter, or null if there is no matching RTPEncodingDesc
.public RTPEncodingDesc findRTPEncodingDesc(long ssrc)
RTPEncodingDesc
that matches ByteArrayBuffer
passed in as a parameter.ssrc
- the SSRC of the RTPEncodingDesc
to match. If multiple
encodings share the same SSRC, the first match will be returned.RTPEncodingDesc
that matches the pkt passed in as
a parameter, or null if there is no matching RTPEncodingDesc
.public PacketTransformer getRTPTransformer()
getRTPTransformer
in interface TransformEngine
public PacketTransformer getRTCPTransformer()
getRTCPTransformer
in interface TransformEngine
public MediaStreamTrackDesc[] getMediaStreamTracks()
MediaStreamTrackDesc
s that this instance is configured
to receive.MediaStreamTrackDesc
s that this instance is
configured to receive.public boolean setMediaStreamTracks(MediaStreamTrackDesc[] newTracks)
MediaStreamTrackReceiver
with the new RTP encoding
parameters. Note that in order to avoid losing the state of existing
MediaStreamTrackDesc
instances, when one of the new instances
matches (i.e. the primary SSRC of its first encoding matches) an old
instance we keep the old instance.
Currently we also keep the old instance's configuration (TODO use the
new configuration).newTracks
- the MediaStreamTrackDesc
s that this instance
will receive. Note that the actual MediaStreamTrackDesc
instances
might not match. To get the actual instances call
getMediaStreamTracks()
.public MediaStreamImpl getStream()
MediaStream
that owns this instance.MediaStream
that owns this instance.public MediaStreamTrackDesc findMediaStreamTrackDesc(long ssrc)
MediaStreamTrackDesc
that corresponds to the SSRC that
is specified in the arguments.ssrc
- the SSRC of the MediaStreamTrackDesc
to match.MediaStreamTrackDesc
that matches the specified SSRC.
Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under Apache license.