From 2ef1582fd4436ccbe4f29db9ea3329c59a62f276 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20=C5=9Aled=C5=BA?= Date: Fri, 6 Dec 2024 14:56:29 +0100 Subject: [PATCH] Improve RTPCodecParameters docs (#178) --- lib/ex_webrtc/rtp_codec_parameters.ex | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/lib/ex_webrtc/rtp_codec_parameters.ex b/lib/ex_webrtc/rtp_codec_parameters.ex index 6ebc25d4..4693278d 100644 --- a/lib/ex_webrtc/rtp_codec_parameters.ex +++ b/lib/ex_webrtc/rtp_codec_parameters.ex @@ -5,6 +5,18 @@ defmodule ExWebRTC.RTPCodecParameters do alias ExSDP.Attribute.{FMTP, RTPMapping, RTCPFeedback} + @typedoc """ + RTP codec parameters. + + * `payload_type` - payload type used to identify the codec. + Keep in mind that the actual payload type depends on who sends the SDP offer first. + If the browser sends it first and uses a different payload type for the same codec, + Elixir WebRTC will override its settings and use the payload type provided by the browser. + If Elixir WebRTC sends the offer first and uses a different payload type for the same codec, + the browser will override its settings and use the payload type provided by Elixir WebRTC. + + For the meanings of the other fields, refer to the [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCRtpSender/getParameters#codecs) + """ @type t() :: %__MODULE__{ payload_type: non_neg_integer(), mime_type: binary(),