From b91ee43c9dd08be0635891ffe9c64709cae2939f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Luis=20Mill=C3=A1n?= Date: Tue, 31 Oct 2023 10:05:16 +0100 Subject: [PATCH] RtpParametes: add RtpHeaderExtensionUri type --- src/RtpParameters.ts | 20 ++++++++++++++++++-- src/tests/fakeParameters.ts | 3 +++ 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/src/RtpParameters.ts b/src/RtpParameters.ts index cf9de484..cfcb0884 100644 --- a/src/RtpParameters.ts +++ b/src/RtpParameters.ts @@ -96,7 +96,7 @@ export type RtpHeaderExtension = /* * The URI of the RTP header extension, as defined in RFC 5285. */ - uri: string; + uri: RtpHeaderExtensionUri; /** * The preferred numeric identifier that goes in the RTP packet. Must be * unique. @@ -271,6 +271,22 @@ export type RtpEncodingParameters = networkPriority?: 'very-low' | 'low' | 'medium' | 'high'; }; +/** + * Supported RTP header extension URIs. + */ +export type RtpHeaderExtensionUri = + 'urn:ietf:params:rtp-hdrext:sdes:mid' | + 'urn:ietf:params:rtp-hdrext:sdes:rtp-stream-id' | + 'urn:ietf:params:rtp-hdrext:sdes:repaired-rtp-stream-id' | + 'http://tools.ietf.org/html/draft-ietf-avtext-framemarking-07' | + 'urn:ietf:params:rtp-hdrext:framemarking' | + 'urn:ietf:params:rtp-hdrext:ssrc-audio-level' | + 'urn:3gpp:video-orientation' | + 'urn:ietf:params:rtp-hdrext:toffset' | + 'http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01' | + 'http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time' | + 'http://www.webrtc.org/experiments/rtp-hdrext/abs-capture-time'; + /** * Defines a RTP header extension within the RTP parameters. The list of RTP * header extensions supported by mediasoup is defined in the @@ -284,7 +300,7 @@ export type RtpHeaderExtensionParameters = /** * The URI of the RTP header extension, as defined in RFC 5285. */ - uri: string; + uri: RtpHeaderExtensionUri; /** * The numeric identifier that goes in the RTP packet. Must be unique. */ diff --git a/src/tests/fakeParameters.ts b/src/tests/fakeParameters.ts index 109d4f61..09842990 100644 --- a/src/tests/fakeParameters.ts +++ b/src/tests/fakeParameters.ts @@ -294,16 +294,19 @@ export function generateNativeRtpCapabilities(): mediasoupClient.types.RtpCapabi }, { kind : 'video', + // @ts-ignore uri : 'http://www.webrtc.org/experiments/rtp-hdrext/playout-delay', preferredId : 6 }, { kind : 'video', + // @ts-ignore uri : 'http://www.webrtc.org/experiments/rtp-hdrext/video-content-type', preferredId : 7 }, { kind : 'video', + // @ts-ignore uri : 'http://www.webrtc.org/experiments/rtp-hdrext/video-timing', preferredId : 8 },