Skip to content

RtpSender: implement W3C getParameters / setParameters#50

Merged
nus merged 1 commit into
mainfrom
rtpsender-parameters
Jun 10, 2026
Merged

RtpSender: implement W3C getParameters / setParameters#50
nus merged 1 commit into
mainfrom
rtpsender-parameters

Conversation

@nus

@nus nus commented Jun 10, 2026

Copy link
Copy Markdown
Owner

Adds the sender-side parameter surface (W3C §5, BACKLOG "RtpSender / RtpReceiver surface is minimal").

What's new

Member Behavior
RtpEncodingParameters active / maxBitrate / maxFramerate. One per sender (webdartc has no simulcast).
RtpSendParameters transactionId + encodings.
RtpSender.getParameters() Snapshot of the current parameters with a fresh, single-use transactionId.
RtpSender.setParameters(params) Applies the mutable fields. Rejects a stale/mismatched transactionId and a changed encoding count (StateError). The token is single-use, mirroring the spec's [[LastReturnedParameters]] → null after apply.

Wire effect (not inert)

  • active == false gates sendRtp: an inactive encoding drops outgoing RTP before it reaches the wire or advances the seq/timestamp/stat counters (W3C: an inactive encoding produces no media).
  • maxBitrate / maxFramerate are stored advisories that round-trip through get/setParameters for a codec backend (webdartc_flutter) to read; the pure core does not pace sendRtp.

Tests (test/peer_connection/transceiver_test.dart, +6)

getParameters shape + token rotation, setParameters apply/round-trip, stale-token rejection, single-use rejection, encoding-count guard, and active=false dropping outgoing RTP.

Verification

  • dart analyze → No issues found
  • dart test (full unit suite + e2e) → all green (712 passed)

BACKLOG updated: sender getParameters/setParameters marked done; remaining in that entry are sender getStats and the receiver source methods.

🤖 Generated with Claude Code

Add the sender-side parameter surface (W3C §5):

- RtpEncodingParameters (active / maxBitrate / maxFramerate) and
  RtpSendParameters (transactionId + encodings). webdartc has a single
  encoding per sender (no simulcast).
- getParameters() returns a fresh snapshot with a new single-use transactionId.
- setParameters() applies the mutable fields, validating the transactionId
  against the last getParameters (single-use, per the spec's
  [[LastReturnedParameters]] model) and rejecting a changed encoding count.
- active gates sendRtp: an inactive encoding drops outgoing RTP before it
  touches the wire or the seq/timestamp/stat counters. maxBitrate/maxFramerate
  are stored advisories for a codec backend; the pure core does not pace.

Tests cover getParameters shape/token rotation, setParameters apply/round-trip,
stale-token and single-use rejection, encoding-count guard, and the active gate.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@nus nus merged commit bd9e388 into main Jun 10, 2026
15 checks passed
@nus nus deleted the rtpsender-parameters branch June 10, 2026 20:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant