Skip to content

Commit 00bd528

Browse files
committed
Update SDP doc
1 parent a83c618 commit 00bd528

File tree

1 file changed

+30
-9
lines changed

1 file changed

+30
-9
lines changed

SDP.md

+30-9
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ str0m does not follow the exact specification for SDP negotiation, however, almo
99
These quotes are from the [spec section 6.1][sdpspec]:
1010

1111
> For recvonly RTP streams, the payload type numbers indicate the value of the payload type field
12-
> in RTP packets the offerer is expecting to receive for that codec. For sendonly RTP streams,
12+
> in RTP packets the offerer is expecting to receive for that codec. For sendonly RTP streams,
1313
> the payload type numbers indicate the value of the payload type field in RTP packets
1414
> the offerer is planning to send for that codec. For sendrecv RTP streams, the payload type
1515
> numbers indicate the value of the payload type field the offerer expects to receive, and would
@@ -48,13 +48,13 @@ are what the receiving side expects.
4848
4949
Example:
5050

51-
* OFFER is `sendrecv` VP8 with PT (Payload Type) 100
52-
* ANSWER is `sendrecv` VP8 with PT 96
51+
- OFFER is `sendrecv` VP8 with PT (Payload Type) 100
52+
- ANSWER is `sendrecv` VP8 with PT 96
5353

54-
The OFFER details the receiving capabilties. It *expects* VP8 to arrive at PT 100. This
54+
The OFFER details the receiving capabilties. It _expects_ VP8 to arrive at PT 100. This
5555
is not a suggestion.
5656

57-
Similarly the ANSWER is talking about its receiving capabilities. It *expects* VP8 to arrive
57+
Similarly the ANSWER is talking about its receiving capabilities. It _expects_ VP8 to arrive
5858
at PT 96. This is also not a suggestion.
5959

6060
We have an asymmetry…
@@ -86,14 +86,35 @@ be one in codecs. If you want to send a specific codec, you must also be prepare
8686

8787
Example:
8888

89-
* OFFER `sendrecv` VP8 PT 100, H264 PT 102
90-
* ANSWER `sendrecv` VP8 PT 96
89+
- OFFER `sendrecv` VP8 PT 100, H264 PT 102
90+
- ANSWER `sendrecv` VP8 PT 96
9191

9292
The answer side is not allowed to send H264 in the direction of the offer side, because it is not
9393
prepared to receive it. We do however have an asymmetry in payload types (96 vs 100).
9494

9595
Thus, a spec compliant implementation does not have to maintain separate codecs per direction,
9696
only separate payload type numbers.
9797

98-
[quote]: https://mailarchive.ietf.org/arch/msg/mmusic/2N1_-eUTVrmciX3LpSjkjFH7oCU/
99-
[sdpspec]: https://datatracker.ietf.org/doc/html/rfc3264#section-6.1
98+
## Direction change from Inactive
99+
100+
This is the behavior of libWebRTC:
101+
102+
- SFU adds first media for something we intend to send later.
103+
- OFFER from SFU for Inactive m-line: mid1
104+
- ANSWER from client confirming Inactive mid1
105+
106+
- Client adds media it wants to send.
107+
- OFFER from client for new m-line: mid2, _mid1 is now OFFERed as RecvOnly_
108+
- ANSWER _should confirm that mid1 is still inactive_
109+
110+
This is because the client is talking about it's receive capabilities. "I can receive on mid1". If the
111+
SFU blindly follows the client OFFER, it would thus transition (the SFU created)
112+
mid1 `Inactive` -> `SendOnly`, when the user (probably) didn't intend to.
113+
114+
To get around this str0m breaks with the spec. str0m keeps track of whether a `Media` (m-line) is created
115+
by str0m or the client. For media str0m creates, it refuses to allow the client to do the specific
116+
transition `Inactive` -> `RecvOnly`. All other transitions are fine, i.e. a client can change, also a
117+
str0m created media, from `Inactive` to `SendRecv`.
118+
119+
[quote]: https://mailarchive.ietf.org/arch/msg/mmusic/2N1_-eUTVrmciX3LpSjkjFH7oCU/
120+
[sdpspec]: https://datatracker.ietf.org/doc/html/rfc3264#section-6.1

0 commit comments

Comments
 (0)