| Index: webrtc/api/rtpparameters.h
|
| diff --git a/webrtc/api/rtpparameters.h b/webrtc/api/rtpparameters.h
|
| index f506c4031c3eacf6e923f3cea67d6f2f9586c4ee..a6764c4c42a4b4a868ecf0587ff6d51b085ae128 100644
|
| --- a/webrtc/api/rtpparameters.h
|
| +++ b/webrtc/api/rtpparameters.h
|
| @@ -16,6 +16,7 @@
|
| #include <vector>
|
|
|
| #include "webrtc/api/mediatypes.h"
|
| +#include "webrtc/config.h"
|
| #include "webrtc/base/optional.h"
|
|
|
| namespace webrtc {
|
| @@ -47,14 +48,13 @@ enum class FecMechanism {
|
|
|
| // Used in RtcpFeedback struct.
|
| enum class RtcpFeedbackType {
|
| - ACK,
|
| CCM,
|
| NACK,
|
| REMB, // "goog-remb"
|
| TRANSPORT_CC,
|
| };
|
|
|
| -// Used in RtcpFeedback struct when type is ACK, NACK or CCM.
|
| +// Used in RtcpFeedback struct when type is NACK or CCM.
|
| enum class RtcpFeedbackMessageType {
|
| // Equivalent to {type: "nack", parameter: undefined} in ORTC.
|
| GENERIC_NACK,
|
| @@ -76,7 +76,7 @@ enum class DegradationPreference {
|
| enum class PriorityType { VERY_LOW, LOW, MEDIUM, HIGH };
|
|
|
| struct RtcpFeedback {
|
| - RtcpFeedbackType type = RtcpFeedbackType::ACK;
|
| + RtcpFeedbackType type = RtcpFeedbackType::CCM;
|
|
|
| // Equivalent to ORTC "parameter" field with slight differences:
|
| // 1. It's an enum instead of a string.
|
| @@ -84,6 +84,12 @@ struct RtcpFeedback {
|
| // rather than an unset "parameter" value.
|
| rtc::Optional<RtcpFeedbackMessageType> message_type;
|
|
|
| + // Constructors for convenience.
|
| + RtcpFeedback() {}
|
| + explicit RtcpFeedback(RtcpFeedbackType type) : type(type) {}
|
| + RtcpFeedback(RtcpFeedbackType type, RtcpFeedbackMessageType message_type)
|
| + : type(type), message_type(message_type) {}
|
| +
|
| bool operator==(const RtcpFeedback& o) const {
|
| return type == o.type && message_type == o.message_type;
|
| }
|
| @@ -126,7 +132,12 @@ struct RtpCodecCapability {
|
| std::vector<RtcpFeedback> rtcp_feedback;
|
|
|
| // Codec-specific parameters that must be signaled to the remote party.
|
| + //
|
| // Corresponds to "a=fmtp" parameters in SDP.
|
| + //
|
| + // Contrary to ORTC, these parameters are named using all lowercase strings.
|
| + // This helps make the mapping to SDP simpler, if an application is using
|
| + // SDP. Boolean values are represented by the string "1".
|
| std::unordered_map<std::string, std::string> parameters;
|
|
|
| // Codec-specific parameters that may optionally be signaled to the remote
|
| @@ -184,6 +195,12 @@ struct RtpHeaderExtensionCapability {
|
| // TODO(deadbeef): Not implemented.
|
| bool preferred_encrypt = false;
|
|
|
| + // Constructors for convenience.
|
| + RtpHeaderExtensionCapability() = default;
|
| + explicit RtpHeaderExtensionCapability(const std::string& uri) : uri(uri) {}
|
| + RtpHeaderExtensionCapability(const std::string& uri, int preferred_id)
|
| + : uri(uri), preferred_id(preferred_id) {}
|
| +
|
| bool operator==(const RtpHeaderExtensionCapability& o) const {
|
| return uri == o.uri && preferred_id == o.preferred_id &&
|
| preferred_encrypt == o.preferred_encrypt;
|
| @@ -193,33 +210,23 @@ struct RtpHeaderExtensionCapability {
|
| }
|
| };
|
|
|
| -// Used in RtpParameters; represents a specific configuration of a header
|
| -// extension.
|
| -struct RtpHeaderExtensionParameters {
|
| - // URI of this extension, as defined in RFC5285.
|
| - std::string uri;
|
| -
|
| - // ID value that goes in the packet.
|
| - int id = 0;
|
| -
|
| - // If true, the value in the header is encrypted.
|
| - // TODO(deadbeef): Not implemented.
|
| - bool encrypt = false;
|
| -
|
| - bool operator==(const RtpHeaderExtensionParameters& o) const {
|
| - return uri == o.uri && id == o.id && encrypt == o.encrypt;
|
| - }
|
| - bool operator!=(const RtpHeaderExtensionParameters& o) const {
|
| - return !(*this == o);
|
| - }
|
| -};
|
| +// See webrtc/config.h. Has "uri" and "id" fields.
|
| +// TODO(deadbeef): This is missing "encrypt" flag, which is unimplemented.
|
| +typedef RtpExtension RtpHeaderExtensionParameters;
|
|
|
| struct RtpFecParameters {
|
| // If unset, a value is chosen by the implementation.
|
| + // Works just like RtpEncodingParameters.ssrc.
|
| rtc::Optional<uint32_t> ssrc;
|
|
|
| FecMechanism mechanism = FecMechanism::RED;
|
|
|
| + // Constructors for convenience.
|
| + RtpFecParameters() = default;
|
| + explicit RtpFecParameters(FecMechanism mechanism) : mechanism(mechanism) {}
|
| + RtpFecParameters(FecMechanism mechanism, uint32_t ssrc)
|
| + : ssrc(ssrc), mechanism(mechanism) {}
|
| +
|
| bool operator==(const RtpFecParameters& o) const {
|
| return ssrc == o.ssrc && mechanism == o.mechanism;
|
| }
|
| @@ -228,33 +235,46 @@ struct RtpFecParameters {
|
|
|
| struct RtpRtxParameters {
|
| // If unset, a value is chosen by the implementation.
|
| + // Works just like RtpEncodingParameters.ssrc.
|
| rtc::Optional<uint32_t> ssrc;
|
|
|
| + // Constructors for convenience.
|
| + RtpRtxParameters() = default;
|
| + explicit RtpRtxParameters(uint32_t ssrc) : ssrc(ssrc) {}
|
| +
|
| bool operator==(const RtpRtxParameters& o) const { return ssrc == o.ssrc; }
|
| bool operator!=(const RtpRtxParameters& o) const { return !(*this == o); }
|
| };
|
|
|
| struct RtpEncodingParameters {
|
| // If unset, a value is chosen by the implementation.
|
| + // Note that the chosen value is NOT returned by GetParameters, because it
|
| + // may change due to an SSRC conflict, in which case the conflict is handled
|
| + // internally without any event.
|
| rtc::Optional<uint32_t> ssrc;
|
|
|
| // Can be used to reference a codec in the |codecs| member of the
|
| // RtpParameters that contains this RtpEncodingParameters. If unset, the
|
| - // implementation will choose the first possible codec.
|
| - // TODO(deadbeef): Not implemented.
|
| + // implementation will choose the first possible codec (if a sender), or
|
| + // prepare to receive any codec (for a receiver).
|
| + // TODO(deadbeef): Not implemented. Implementation will always choose the
|
| + // first codec from the list.
|
| rtc::Optional<int> codec_payload_type;
|
|
|
| // Specifies the FEC mechanism, if set.
|
| - // TODO(deadbeef): Not implemented.
|
| + // TODO(deadbeef): Not implemented. Current implementation will use whatever
|
| + // FEC codecs are available, including red+ulpfec.
|
| rtc::Optional<RtpFecParameters> fec;
|
|
|
| // Specifies the RTX parameters, if set.
|
| - // TODO(deadbeef): Not implemented.
|
| + // TODO(deadbeef): Not implemented with PeerConnection senders/receivers.
|
| rtc::Optional<RtpRtxParameters> rtx;
|
|
|
| // Only used for audio. If set, determines whether or not discontinuous
|
| // transmission will be used, if an available codec supports it. If not
|
| // set, the implementation default setting will be used.
|
| + // TODO(deadbeef): Not implemented. Current implementation will use a CN
|
| + // codec as long as it's present.
|
| rtc::Optional<DtxStatus> dtx;
|
|
|
| // The relative priority of this encoding.
|
| @@ -264,7 +284,13 @@ struct RtpEncodingParameters {
|
| // If set, this represents the Transport Independent Application Specific
|
| // maximum bandwidth defined in RFC3890. If unset, there is no maximum
|
| // bitrate.
|
| + //
|
| // Just called "maxBitrate" in ORTC spec.
|
| + //
|
| + // TODO(deadbeef): With ORTC RtpSenders, this currently sets the total
|
| + // bandwidth for the entire bandwidth estimator (audio and video). This is
|
| + // just always how "b=AS" was handled, but it's not correct and should be
|
| + // fixed.
|
| rtc::Optional<int> max_bitrate_bps;
|
|
|
| // TODO(deadbeef): Not implemented.
|
| @@ -329,7 +355,8 @@ struct RtpCodecParameters {
|
|
|
| // The number of audio channels used. Unset for video codecs. If unset for
|
| // audio, the implementation default is used.
|
| - // TODO(deadbeef): The "implementation default" part is unimplemented.
|
| + // TODO(deadbeef): The "implementation default" part isn't fully implemented.
|
| + // Only defaults to 1.
|
| rtc::Optional<int> num_channels;
|
|
|
| // The maximum packetization time to be used by an RtpSender.
|
| @@ -343,12 +370,18 @@ struct RtpCodecParameters {
|
| rtc::Optional<int> ptime;
|
|
|
| // Feedback mechanisms to be used for this codec.
|
| - // TODO(deadbeef): Not implemented.
|
| + // TODO(deadbeef): Not implemented with PeerConnection senders/receivers.
|
| std::vector<RtcpFeedback> rtcp_feedback;
|
|
|
| // Codec-specific parameters that must be signaled to the remote party.
|
| + //
|
| // Corresponds to "a=fmtp" parameters in SDP.
|
| - // TODO(deadbeef): Not implemented.
|
| + //
|
| + // Contrary to ORTC, these parameters are named using all lowercase strings.
|
| + // This helps make the mapping to SDP simpler, if an application is using
|
| + // SDP. Boolean values are represented by the string "1".
|
| + //
|
| + // TODO(deadbeef): Not implemented with PeerConnection senders/receivers.
|
| std::unordered_map<std::string, std::string> parameters;
|
|
|
| bool operator==(const RtpCodecParameters& o) const {
|
| @@ -397,7 +430,7 @@ struct RtpParameters {
|
|
|
| std::vector<RtpCodecParameters> codecs;
|
|
|
| - // TODO(deadbeef): Not implemented.
|
| + // TODO(deadbeef): Not implemented with PeerConnection senders/receivers.
|
| std::vector<RtpHeaderExtensionParameters> header_extensions;
|
|
|
| std::vector<RtpEncodingParameters> encodings;
|
|
|