Skip to content

rtc: route sender reports to the owning receiver - #439

Merged
haaspors merged 1 commit into
masterfrom
rtcp-route-sr-to-receiver
Aug 3, 2026
Merged

rtc: route sender reports to the owning receiver#439
haaspors merged 1 commit into
masterfrom
rtcp-route-sr-to-receiver

Conversation

@haaspors

@haaspors haaspors commented Aug 3, 2026

Copy link
Copy Markdown
Owner

Follow-up to #413 — the receive-side mirror of #426.

r_rtc_rtp_listener_handle_rtcp broadcast the whole RTCP compound to every receiver. A Sender Report identifies the remote source it describes in its sender SSRC, which the owning receiver already registers in recv_ssrcmap, so an SR can route to that receiver the same way sender feedback now routes to senders.

What changed

  • Each SR is delivered only to the receiver owning its sender SSRC, reassembled into a fresh per-receiver compound, instead of being broadcast.
  • Every other packet type (SDES, BYE, and the reception feedback about our outbound streams) is still copied to each receiver, matching the previous behaviour — the issue scoped this to SR / reception statistics, not all receiver RTCP.
  • The compound is now mapped once: the per-receiver and per-sender buffers are both built under that single map, then dispatched after unmapping.

Scope note

An RTCP buffer that fails r_rtcp_buffer_map (a malformed compound) is now dropped rather than handed raw to every receiver. Previously each receiver got a buffer its own map would reject anyway, so no useful data is lost. An SR whose sender SSRC no receiver has registered is likewise dropped rather than broadcast — the same routing-by-SSRC semantics as the sender side.

Testing

  • New receiver_receives_own_sender_report: an SR for an unowned source is dropped; an SR naming the receiver's source arrives as a lone SR carrying that sender SSRC. Proven load-bearing by neutering the routing (the unowned SR then reaches the receiver).
  • Full suite passes; ASan clean on the touched suites.

🤖 Generated with Claude Code

A Sender Report names the remote source it describes in its sender SSRC,
which the owning receiver already registered in recv_ssrcmap. Route each
SR to that receiver instead of broadcasting it to every receiver, mirror-
ing the sender-side feedback routing: reassemble a fresh per-receiver
compound carrying the SRs it owns plus the packet types that still fan
out (SDES, BYE and the outbound-stream feedback).

Map the compound once and build the per-receiver and per-sender buffers
under that single map rather than broadcasting the raw buffer and mapping
again for senders.

Closes #427

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@haaspors
haaspors merged commit 822a2db into master Aug 3, 2026
18 checks passed
@haaspors
haaspors deleted the rtcp-route-sr-to-receiver branch August 3, 2026 09:43
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