RtpSender: implement W3C getParameters / setParameters#50
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds the sender-side parameter surface (W3C §5, BACKLOG "RtpSender / RtpReceiver surface is minimal").
What's new
RtpEncodingParametersactive/maxBitrate/maxFramerate. One per sender (webdartc has no simulcast).RtpSendParameterstransactionId+encodings.RtpSender.getParameters()transactionId.RtpSender.setParameters(params)transactionIdand a changed encoding count (StateError). The token is single-use, mirroring the spec's[[LastReturnedParameters]]→ null after apply.Wire effect (not inert)
active == falsegatessendRtp: 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/maxFramerateare stored advisories that round-trip through get/setParameters for a codec backend (webdartc_flutter) to read; the pure core does not pacesendRtp.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=falsedropping outgoing RTP.Verification
dart analyze→ No issues founddart test(full unit suite + e2e) → all green (712 passed)BACKLOG updated: sender
getParameters/setParametersmarked done; remaining in that entry are sendergetStatsand the receiver source methods.🤖 Generated with Claude Code