From 734d620e32a7f5599f40585edcb478f10ba31387 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Negro=20Mart=C3=ADn?= Date: Tue, 25 Jun 2024 11:09:14 +0200 Subject: [PATCH] playout-delay capability added for audio --- node/src/supportedRtpCapabilities.ts | 7 +++++++ node/src/test/test-PipeTransport.ts | 12 ++++++++++++ rust/src/supported_rtp_capabilities.rs | 7 +++++++ rust/tests/integration/pipe_transport.rs | 12 +++++++++++- 4 files changed, 37 insertions(+), 1 deletion(-) diff --git a/node/src/supportedRtpCapabilities.ts b/node/src/supportedRtpCapabilities.ts index 88c8d11345..741ce2d764 100644 --- a/node/src/supportedRtpCapabilities.ts +++ b/node/src/supportedRtpCapabilities.ts @@ -335,6 +335,13 @@ const supportedRtpCapabilities: RtpCapabilities = { preferredEncrypt: false, direction: 'sendrecv', }, + { + kind: 'audio', + uri: 'http://www.webrtc.org/experiments/rtp-hdrext/playout-delay', + preferredId: 14, + preferredEncrypt: false, + direction: 'sendrecv', + }, ], }; diff --git a/node/src/test/test-PipeTransport.ts b/node/src/test/test-PipeTransport.ts index 140f033ca4..4f2c24363d 100644 --- a/node/src/test/test-PipeTransport.ts +++ b/node/src/test/test-PipeTransport.ts @@ -271,6 +271,12 @@ test('router.pipeToRouter() succeeds with audio', async () => { encrypt: false, parameters: {}, }, + { + uri: 'http://www.webrtc.org/experiments/rtp-hdrext/playout-delay', + id: 14, + encrypt: false, + parameters: {}, + }, ]); expect(pipeConsumer.type).toBe('pipe'); expect(pipeConsumer.paused).toBe(false); @@ -313,6 +319,12 @@ test('router.pipeToRouter() succeeds with audio', async () => { encrypt: false, parameters: {}, }, + { + uri: 'http://www.webrtc.org/experiments/rtp-hdrext/playout-delay', + id: 14, + encrypt: false, + parameters: {}, + }, ]); expect(pipeProducer.paused).toBe(false); }, 2000); diff --git a/rust/src/supported_rtp_capabilities.rs b/rust/src/supported_rtp_capabilities.rs index bdcca5b913..bf1c5c3b7a 100644 --- a/rust/src/supported_rtp_capabilities.rs +++ b/rust/src/supported_rtp_capabilities.rs @@ -393,6 +393,13 @@ pub fn get_supported_rtp_capabilities() -> RtpCapabilities { preferred_encrypt: false, direction: RtpHeaderExtensionDirection::SendRecv, }, + RtpHeaderExtension { + kind: MediaKind::Audio, + uri: RtpHeaderExtensionUri::PlayoutDelay, + preferred_id: 14, + preferred_encrypt: false, + direction: RtpHeaderExtensionDirection::SendRecv, + }, ], } } diff --git a/rust/tests/integration/pipe_transport.rs b/rust/tests/integration/pipe_transport.rs index 739cfe16a7..c11ff0d32a 100644 --- a/rust/tests/integration/pipe_transport.rs +++ b/rust/tests/integration/pipe_transport.rs @@ -350,6 +350,11 @@ fn pipe_to_router_succeeds_with_audio() { uri: RtpHeaderExtensionUri::AbsCaptureTime, id: 13, encrypt: false, + }, + RtpHeaderExtensionParameters { + uri: RtpHeaderExtensionUri::PlayoutDelay, + id: 14, + encrypt: false, } ], ); @@ -395,7 +400,12 @@ fn pipe_to_router_succeeds_with_audio() { uri: RtpHeaderExtensionUri::AbsCaptureTime, id: 13, encrypt: false, - } + }, + RtpHeaderExtensionParameters { + uri: RtpHeaderExtensionUri::PlayoutDelay, + id: 14, + encrypt: false, + }, ], ); assert!(!pipe_producer.paused());