Class RTCRtpSender

java.lang.Object
dev.onvoid.webrtc.internal.NativeObject
dev.onvoid.webrtc.RTCRtpSender

public class RTCRtpSender
extends NativeObject
The RTCRtpSender allows an application to control how a given MediaStreamTrack is encoded and transmitted to a remote peer. When setParameters(dev.onvoid.webrtc.RTCRtpSendParameters) is called on an RTCRtpSender, the encoding is changed appropriately.
Author:
Alex Andres
  • Method Summary

    Modifier and Type Method Description
    RTCRtpSendParameters getParameters()
    Returns the RTCRtpSender's current parameters for how track is encoded and transmitted to a remote RTCRtpReceiver.
    MediaStreamTrack getTrack()
    Returns the track that is associated with this RTCRtpSender.
    RTCDtlsTransport getTransport()
    The transport over which media from the MediaStreamTrack is sent in the form of RTP packets.
    void replaceTrack​(MediaStreamTrack withTrack)
    Attempts to replace the RTCRtpSender's current track with another track provided (or with a null track), without renegotiation.
    void setParameters​(RTCRtpSendParameters parameters)
    Updates how track is encoded and transmitted to a remote peer.
    void setStreams​(java.util.List<java.lang.String> streamIds)
    Sets the IDs of the media streams associated with this sender's track.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • getTrack

      public MediaStreamTrack getTrack()
      Returns the track that is associated with this RTCRtpSender. If track is ended, or if the track's output is disabled, i.e. the track is disabled and/or muted, the RTCRtpSender MUST send silence (audio), black frames (video) or a zero-information-content equivalent. In the case of video, the RTCRtpSender SHOULD send one black frame per second. If track is null then the RTCRtpSender does not send.
      Returns:
      The media track associated with this sender.
    • getTransport

      public RTCDtlsTransport getTransport()
      The transport over which media from the MediaStreamTrack is sent in the form of RTP packets. When bundling is used, multiple RTCRtpSenders will share one transport and will all send RTP and RTCP over the same transport.
      Returns:
      The transport over which media from the MediaStreamTrack is sent.
    • replaceTrack

      public void replaceTrack​(MediaStreamTrack withTrack)
      Attempts to replace the RTCRtpSender's current track with another track provided (or with a null track), without renegotiation. To avoid track identifiers changing on the remote receiving end when a track is replaced, the sender MUST retain the original track identifier and stream associations and use these in subsequent negotiations.
      Parameters:
      withTrack - The new media track.
    • setParameters

      public void setParameters​(RTCRtpSendParameters parameters)
      Updates how track is encoded and transmitted to a remote peer. Does not cause SDP renegotiation and can only be used to change what the media stack is sending or receiving within the envelope negotiated by Offer/Answer. The attributes in the RTCRtpSendParameters are designed to not enable this, so attributes like cname that cannot be changed are read-only. Other things, like bitrate, are controlled using limits such as maxBitrate, where the user agent needs to ensure it does not exceed the maximum bitrate specified by maxBitrate, while at the same time making sure it satisfies constraints on bitrate specified in other places such as the SDP.
      Parameters:
      parameters - The new RTP parameters.
    • getParameters

      public RTCRtpSendParameters getParameters()
      Returns the RTCRtpSender's current parameters for how track is encoded and transmitted to a remote RTCRtpReceiver.
      Returns:
      The current RTP parameters.
    • setStreams

      public void setStreams​(java.util.List<java.lang.String> streamIds)
      Sets the IDs of the media streams associated with this sender's track.
      Parameters:
      streamIds - The IDs of the media streams.