Skip to content
This repository was archived by the owner on Feb 25, 2026. It is now read-only.

RTP header extensions may conflict on transport receiver #803

Closed

Description

@robin-raymond

If there are multiple receivers with different header extensions mapped to the same ID this can cause issues in interpreting of the header extension. For example, RID might be mapped to an ID which conflicts in one sender with a different header extension.

This can cause receiver.receive(...) to fail. This can also cause changing transports on a receiver can fail due to attaching to a transport that already has header extensions assigned to different meanings for other receivers.

receiver.setTransport should be async to allow the receiver to interrogate the transport to ensure no conflicts occur with header extensions.

Activity

  1. ibc commented on Jan 15, 2018

    @ibc
    Contributor

    Yep. This is like "the egg or the chicken". The RID and MID header extensions are intended for demultiplexing RTP streams but they are set at RTCRtpParameters level within the corresponding RTCRtpSender.

    receiver.setTransport should be async to allow the receiver to interrogate the transport to ensure no conflicts occur with header extensions.

    How is that different from just throwing an exception? "Interrogating the transport" should be sync IMHO.

  2. robin-raymond commented on Jan 15, 2018

    @robin-raymond
    ContributorAuthor

    Not always possible in all implementations to make this synchronous.

  3. ibc commented on Jan 15, 2018

    @ibc
    Contributor

    IMHO it makes sense that this is a synchronous operation. Implementations should honor the spec and not the other way around.

  4. robin-raymond commented on Jan 15, 2018

    @robin-raymond
    ContributorAuthor

    @ibc This isn't so easy from experience in this case. The header extensions need to be registered as a transaction against the transport to ensure they take affect as multiple transports can conflict. This can cause contention if you attempt to do this synchronously. I would have a very difficult time making this synchronous in my own code for ortclib for example. There's a reason mechanisms that need to work across multiple objects become asynchronous vs objects than can act independently without interrogation / interaction / transacting with other active objects.

  5. ibc commented on Jan 15, 2018

    @ibc
    Contributor

    This is about iterating the RTCRtpParameters of all the RTCRtpSenders and RTCRtpReceivers managed by the given transport and checking whether MID and RID values do not conflict between them. Not sure why this cannot be synchronous. I've already done this in a synchronous way.

  6. robin-raymond commented on Jan 15, 2018

    @robin-raymond
    ContributorAuthor

    It's not enough to check if they conflict, receivers have to be registered on construction and de-registered when they detach. This can and does cause contention issues across objects. When detachment happens this has to be done asynchronously for my implementation (for a long host of reasons as a whole set of pipelines need to be torn down across objects) and if I have certain things happen synchronously then it might be possible a detachment happens after a new attachment which can cause a false failure. Maybe your implementation doesn't have this issue but I can say for 100% certainty that it would be very difficult for me to handle this case synchronously.

  7. ibc commented on Jan 15, 2018

    @ibc
    Contributor

    Fair enough.

  8. self-assigned this
    on Mar 1, 2018
  9. added a commit that references this issue on Jul 10, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions