aboutsummaryrefslogtreecommitdiff
path: root/api/rtp_parameters.h
diff options
context:
space:
mode:
Diffstat (limited to 'api/rtp_parameters.h')
-rw-r--r--api/rtp_parameters.h42
1 files changed, 35 insertions, 7 deletions
diff --git a/api/rtp_parameters.h b/api/rtp_parameters.h
index 7fe9f2bc83..a098bad6b0 100644
--- a/api/rtp_parameters.h
+++ b/api/rtp_parameters.h
@@ -246,6 +246,18 @@ struct RTC_EXPORT RtpHeaderExtensionCapability {
// RTP header extension, see RFC8285.
struct RTC_EXPORT RtpExtension {
+ enum Filter {
+ // Encrypted extensions will be ignored and only non-encrypted extensions
+ // will be considered.
+ kDiscardEncryptedExtension,
+ // Encrypted extensions will be preferred but will fall back to
+ // non-encrypted extensions if necessary.
+ kPreferEncryptedExtension,
+ // Encrypted extensions will be required, so any non-encrypted extensions
+ // will be discarded.
+ kRequireEncryptedExtension,
+ };
+
RtpExtension();
RtpExtension(absl::string_view uri, int id);
RtpExtension(absl::string_view uri, int id, bool encrypt);
@@ -260,17 +272,28 @@ struct RTC_EXPORT RtpExtension {
// Return "true" if the given RTP header extension URI may be encrypted.
static bool IsEncryptionSupported(absl::string_view uri);
- // Returns the named header extension if found among all extensions,
- // nullptr otherwise.
+ // Returns the header extension with the given URI or nullptr if not found.
+ static const RtpExtension* FindHeaderExtensionByUri(
+ const std::vector<RtpExtension>& extensions,
+ absl::string_view uri,
+ Filter filter);
+ ABSL_DEPRECATED(
+ "Use RtpExtension::FindHeaderExtensionByUri with filter argument")
static const RtpExtension* FindHeaderExtensionByUri(
const std::vector<RtpExtension>& extensions,
absl::string_view uri);
- // Return a list of RTP header extensions with the non-encrypted extensions
- // removed if both the encrypted and non-encrypted extension is present for
- // the same URI.
- static std::vector<RtpExtension> FilterDuplicateNonEncrypted(
- const std::vector<RtpExtension>& extensions);
+ // Returns the header extension with the given URI and encrypt parameter,
+ // if found, otherwise nullptr.
+ static const RtpExtension* FindHeaderExtensionByUriAndEncryption(
+ const std::vector<RtpExtension>& extensions,
+ absl::string_view uri,
+ bool encrypt);
+
+ // Returns a list of extensions where any extension URI is unique.
+ static const std::vector<RtpExtension> DeduplicateHeaderExtensions(
+ const std::vector<RtpExtension>& extensions,
+ Filter filter);
// Encryption of Header Extensions, see RFC 6904 for details:
// https://tools.ietf.org/html/rfc6904
@@ -357,6 +380,11 @@ struct RTC_EXPORT RtpExtension {
static constexpr char kVideoFrameTrackingIdUri[] =
"http://www.webrtc.org/experiments/rtp-hdrext/video-frame-tracking-id";
+ // Header extension for Mixer-to-Client audio levels per CSRC as defined in
+ // https://tools.ietf.org/html/rfc6465
+ static constexpr char kCsrcAudioLevelsUri[] =
+ "urn:ietf:params:rtp-hdrext:csrc-audio-level";
+
// Inclusive min and max IDs for two-byte header extensions and one-byte
// header extensions, per RFC8285 Section 4.2-4.3.
static constexpr int kMinId = 1;