Skip to content

Consolidate setting up streams for RTPReceiver #2088

@boks1971

Description

@boks1971

Summary

There are two (or three) different paths to initialise streams of RTPReceiver. This request is for consolidation/simplification.

Motivation

Simplification/Consolidation.

Describe alternatives you've considered

There are three cases to consider while initialising streams of RTPReceiver.

  1. Undeclared SSRC: SDP does not have SSRC or MID/RID and there is only one media description.
  2. Declared SSRC: SDP has SSRC. May or may not have MID/RID.
  3. Declared MID/RID: SDP has MID/RID. May or may not have SSRC.

Precedence

  1. If MID/RID is in SDP (even if there are SSRCs), that path is used to initialise streams.
  2. SSRC in SDP.
  3. Undeclared SSRC: This is a special case.

For case #2 above, streams are initialised first whereas in the other two cases, streams are initialised in handleIncomingSSRC when first packet(s) of an RTP stream is(are) received.

To simplify, even case #2 can be done in handleIncomingSSRC. startRTP can just be used to set up undeclaredMediaProcessor (although the naming might have to change) and start SCTP. All the RTP streams can be initialised in undeclaredMediaProcessor and handleIncomingSSRC. This will provide a unified flow for setting up streams for all cases.

Additional context

Original bug that triggered work on splitting configuring receive and starting receive - #2054
Comment in the PR that addressed the bug where this was originally proposed - #2087 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions