9.3 MediaStreamTrack

A MediaStreamTrack object’s reference to its MediaStream in the non-local media source case (an RTP source, as is the case for each MediaStreamTrack associated with an RTCRtpReceiver) is always strong.

Whenever an RTCRtpReceiver receives data on an RTP source whose corresponding MediaStreamTrack is muted, but not ended, and the [[Receptive]] slot of the RTCRtpTransceiver object the RTCRtpReceiver is a member of is true, it MUST queue a task to set the muted state of the corresponding MediaStreamTrack to false.

When one of the SSRCs for RTP source media streams received by an RTCRtpReceiver is removed either due to reception of a BYE or via timeout, it MUST queue a task to set the muted state of the corresponding MediaStreamTrack to true. Note that setRemoteDescription can also lead to the setting of the muted state of the track to the value true.

The procedures add a track, remove a track and set a track’s muted state are specified in [GETUSERMEDIA].

When a MediaStreamTrack track produced by an RTCRtpReceiver receiver has ended [GETUSERMEDIA] (such as via a call to receiver.track.stop), the user agent MAY choose to free resources allocated for the incoming stream, by for instance turning off the decoder of receiver.

9.3.1 MediaTrackSupportedConstraints, MediaTrackCapabilities, MediaTrackConstraints and MediaTrackSettings

The concept of constraints and constrainable properties, including MediaTrackConstraints (MediaStreamTrack.getConstraints(), MediaStreamTrack.applyConstraints()), and MediaTrackSettings (MediaStreamTrack.getSettings()) are outlined in [GETUSERMEDIA]. However, the constrainable properties of tracks sourced from a peer connection are different than those sourced by getUserMedia(); the constraints and settings applicable to MediaStreamTracks sourced from a remote source are defined here. The settings of a remote track represent the latest frame received.

MediaStreamTrack.getCapabilities() MUST always return the empty set and MediaStreamTrack.applyConstraints() MUST always reject with OverconstrainedError on remote tracks for constraints defined here.

The following constrainable properties are defined to apply to video MediaStreamTracks sourced from a remote source:

Property NameValuesNotes
widthConstrainULongAs a setting, this is the width, in pixels, of the latest frame received.
heightConstrainULongAs a setting, this is the height, in pixels, of the latest frame received.
frameRateConstrainDoubleAs a setting, this is an estimate of the frame rate based on recently received frames.
aspectRatioConstrainDoubleAs a setting, this is the aspect ratio of the latest frame; this is the width in pixels divided by height in pixels as a double rounded to the tenth decimal place.

This document does not define any constrainable properties to apply to audio MediaStreamTracks sourced from a remote source.