Package org.jitsi.impl.neomedia.rtp
Class MediaStreamTrackReceiver
- java.lang.Object
-
- org.jitsi.impl.neomedia.transform.SinglePacketTransformer
-
- org.jitsi.impl.neomedia.transform.SinglePacketTransformerAdapter
-
- org.jitsi.impl.neomedia.rtp.MediaStreamTrackReceiver
-
- All Implemented Interfaces:
PacketTransformer,TransformEngine
- Direct Known Subclasses:
VideoMediaStreamTrackReceiver
public class MediaStreamTrackReceiver extends SinglePacketTransformerAdapter implements TransformEngine
Contains theMediaStreamTrackDescs for aMediaStream. It is also part of theMediaStream's transform chain and has the opportunity to update itsMediaStreamTrackDescs with received packets. This default implementation does no update theMediaStreamTrackDescs, it only serves to contain the signalled tracks and encodings.- Author:
- George Politis, Boris Grozev
-
-
Constructor Summary
Constructors Constructor Description MediaStreamTrackReceiver(MediaStreamImpl stream)Ctor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MediaStreamTrackDescfindMediaStreamTrackDesc(long ssrc)Finds theMediaStreamTrackDescthat corresponds to the SSRC that is specified in the arguments.RTPEncodingDescfindRTPEncodingDesc(long ssrc)Finds theRTPEncodingDescthat matchesByteArrayBufferpassed in as a parameter.RTPEncodingDescfindRTPEncodingDesc(RawPacket pkt)Finds theRTPEncodingDescthat matches theRawPacketpassed in as a parameter.MediaStreamTrackDesc[]getMediaStreamTracks()Gets theMediaStreamTrackDescs that this instance is configured to receive.PacketTransformergetRTCPTransformer()Gets the PacketTransformer for RTCP packets.PacketTransformergetRTPTransformer()Gets the PacketTransformer for RTP packets.MediaStreamImplgetStream()Gets theMediaStreamthat owns this instance.booleansetMediaStreamTracks(MediaStreamTrackDesc[] newTracks)Updates thisMediaStreamTrackReceiverwith the new RTP encoding parameters.-
Methods inherited from class org.jitsi.impl.neomedia.transform.SinglePacketTransformerAdapter
reverseTransform, transform
-
Methods inherited from class org.jitsi.impl.neomedia.transform.SinglePacketTransformer
close, reverseTransform, transform
-
-
-
-
Constructor Detail
-
MediaStreamTrackReceiver
public MediaStreamTrackReceiver(MediaStreamImpl stream)
Ctor.- Parameters:
stream- TheMediaStreamthat this instance receivesMediaStreamTrackDescs from.
-
-
Method Detail
-
findRTPEncodingDesc
public RTPEncodingDesc findRTPEncodingDesc(RawPacket pkt)
Finds theRTPEncodingDescthat matches theRawPacketpassed in as a parameter. Assumes that the packet is valid.- Parameters:
pkt- the packet to match.- Returns:
- the
RTPEncodingDescthat matches the pkt passed in as a parameter, or null if there is no matchingRTPEncodingDesc.
-
findRTPEncodingDesc
public RTPEncodingDesc findRTPEncodingDesc(long ssrc)
Finds theRTPEncodingDescthat matchesByteArrayBufferpassed in as a parameter.- Parameters:
ssrc- the SSRC of theRTPEncodingDescto match. If multiple encodings share the same SSRC, the first match will be returned.- Returns:
- the
RTPEncodingDescthat matches the pkt passed in as a parameter, or null if there is no matchingRTPEncodingDesc.
-
getRTPTransformer
public PacketTransformer getRTPTransformer()
Gets the PacketTransformer for RTP packets.- Specified by:
getRTPTransformerin interfaceTransformEngine- Returns:
- the PacketTransformer for RTP packets
-
getRTCPTransformer
public PacketTransformer getRTCPTransformer()
Gets the PacketTransformer for RTCP packets.- Specified by:
getRTCPTransformerin interfaceTransformEngine- Returns:
- the PacketTransformer for RTCP packets
-
getMediaStreamTracks
public MediaStreamTrackDesc[] getMediaStreamTracks()
Gets theMediaStreamTrackDescs that this instance is configured to receive.- Returns:
- the
MediaStreamTrackDescs that this instance is configured to receive.
-
setMediaStreamTracks
public boolean setMediaStreamTracks(MediaStreamTrackDesc[] newTracks)
Updates thisMediaStreamTrackReceiverwith the new RTP encoding parameters. Note that in order to avoid losing the state of existingMediaStreamTrackDescinstances, 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).- Parameters:
newTracks- theMediaStreamTrackDescs that this instance will receive. Note that the actualMediaStreamTrackDescinstances might not match. To get the actual instances callgetMediaStreamTracks().- Returns:
- true if the MSTs have changed, otherwise false.
-
getStream
public MediaStreamImpl getStream()
Gets theMediaStreamthat owns this instance.- Returns:
- the
MediaStreamthat owns this instance.
-
findMediaStreamTrackDesc
public MediaStreamTrackDesc findMediaStreamTrackDesc(long ssrc)
Finds theMediaStreamTrackDescthat corresponds to the SSRC that is specified in the arguments.- Parameters:
ssrc- the SSRC of theMediaStreamTrackDescto match.- Returns:
- the
MediaStreamTrackDescthat matches the specified SSRC.
-
-