From 567f03f7a058a1b351af38d1597f5950583802b5 Mon Sep 17 00:00:00 2001 From: Taylor Brandstetter Date: Tue, 18 Feb 2020 13:41:54 -0800 Subject: [PATCH] Add constants for allowed network_priority values After chromium switches to using these, they'll be changed to an enum. Bug: webrtc:5658 Change-Id: Ic5d7d4651d204c31822194bd02c587e5b887ee17 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/168562 Commit-Queue: Taylor Reviewed-by: Karl Wiberg Cr-Commit-Position: refs/heads/master@{#30551} --- api/rtp_parameters.cc | 5 +++++ api/rtp_parameters.h | 10 +++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/api/rtp_parameters.cc b/api/rtp_parameters.cc index 2b580b1084..3ca9cd38f1 100644 --- a/api/rtp_parameters.cc +++ b/api/rtp_parameters.cc @@ -19,6 +19,11 @@ namespace webrtc { const double kDefaultBitratePriority = 1.0; +const double NetworkPriority::kVeryLow = 0.5; +const double NetworkPriority::kLow = 1.0; +const double NetworkPriority::kMedium = 2.0; +const double NetworkPriority::kHigh = 4.0; + RtcpFeedback::RtcpFeedback() = default; RtcpFeedback::RtcpFeedback(RtcpFeedbackType type) : type(type) {} RtcpFeedback::RtcpFeedback(RtcpFeedbackType type, diff --git a/api/rtp_parameters.h b/api/rtp_parameters.h index 4f45d65a3d..94ce00d916 100644 --- a/api/rtp_parameters.h +++ b/api/rtp_parameters.h @@ -91,6 +91,14 @@ enum class DegradationPreference { RTC_EXPORT extern const double kDefaultBitratePriority; +// TODO(deadbeef): Switch to an enum class. +struct RTC_EXPORT NetworkPriority { + static const double kVeryLow; + static const double kLow; + static const double kMedium; + static const double kHigh; +}; + struct RTC_EXPORT RtcpFeedback { RtcpFeedbackType type = RtcpFeedbackType::CCM; @@ -393,7 +401,7 @@ struct RTC_EXPORT RtpEncodingParameters { // we follow chromium's translation of the allowed string enum values for // this field to 1.0, 0.5, et cetera, similar to bitrate_priority above. // TODO(http://crbug.com/webrtc/8630): Implement this per encoding parameter. - double network_priority = kDefaultBitratePriority; + double network_priority = NetworkPriority::kLow; // If set, this represents the Transport Independent Application Specific // maximum bandwidth defined in RFC3890. If unset, there is no maximum