Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add dependency-descriptor support #1481

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions node/src/rtpParametersFbsUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,10 @@ export function rtpHeaderExtensionUriFromFbs(
case FbsRtpHeaderExtensionUri.PlayoutDelay: {
return 'http://www.webrtc.org/experiments/rtp-hdrext/playout-delay';
}

case FbsRtpHeaderExtensionUri.DependencyDescriptor: {
return 'https://aomediacodec.github.io/av1-rtp-spec/#dependency-descriptor-rtp-header-extension';
}
}
}

Expand Down Expand Up @@ -468,6 +472,10 @@ export function rtpHeaderExtensionUriToFbs(
return FbsRtpHeaderExtensionUri.PlayoutDelay;
}

case 'https://aomediacodec.github.io/av1-rtp-spec/#dependency-descriptor-rtp-header-extension': {
return FbsRtpHeaderExtensionUri.DependencyDescriptor;
}

default: {
throw new TypeError(`invalid RtpHeaderExtensionUri: ${uri}`);
}
Expand Down
3 changes: 2 additions & 1 deletion node/src/rtpParametersTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,8 @@ export type RtpHeaderExtensionUri =
| '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'
| 'http://www.webrtc.org/experiments/rtp-hdrext/playout-delay';
| 'http://www.webrtc.org/experiments/rtp-hdrext/playout-delay'
| 'https://aomediacodec.github.io/av1-rtp-spec/#dependency-descriptor-rtp-header-extension';

/**
* Defines a RTP header extension within the RTP parameters. The list of RTP
Expand Down
7 changes: 7 additions & 0 deletions node/src/supportedRtpCapabilities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,13 @@ const supportedRtpCapabilities: RtpCapabilities = {
preferredEncrypt: false,
direction: 'sendrecv',
},
{
kind: 'video',
uri: 'https://aomediacodec.github.io/av1-rtp-spec/#dependency-descriptor-rtp-header-extension',
preferredId: 8,
preferredEncrypt: false,
direction: 'sendrecv',
},
{
kind: 'audio',
uri: 'urn:ietf:params:rtp-hdrext:ssrc-audio-level',
Expand Down
18 changes: 18 additions & 0 deletions node/src/test/test-PipeTransport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,12 @@ test('router.pipeToRouter() succeeds with video', async () => {
encrypt: false,
parameters: {},
},
{
uri: 'https://aomediacodec.github.io/av1-rtp-spec/#dependency-descriptor-rtp-header-extension',
id: 8,
encrypt: false,
parameters: {},
},
{
uri: 'urn:3gpp:video-orientation',
id: 11,
Expand Down Expand Up @@ -448,6 +454,12 @@ test('router.pipeToRouter() succeeds with video', async () => {
encrypt: false,
parameters: {},
},
{
uri: 'https://aomediacodec.github.io/av1-rtp-spec/#dependency-descriptor-rtp-header-extension',
id: 8,
encrypt: false,
parameters: {},
},
{
uri: 'urn:3gpp:video-orientation',
id: 11,
Expand Down Expand Up @@ -569,6 +581,12 @@ test('router.createPipeTransport() with enableRtx succeeds', async () => {
encrypt: false,
parameters: {},
},
{
uri: 'https://aomediacodec.github.io/av1-rtp-spec/#dependency-descriptor-rtp-header-extension',
id: 8,
encrypt: false,
parameters: {},
},
{
uri: 'urn:3gpp:video-orientation',
id: 11,
Expand Down
16 changes: 16 additions & 0 deletions rust/src/rtp_parameters.rs
Original file line number Diff line number Diff line change
Expand Up @@ -589,6 +589,12 @@ pub enum RtpHeaderExtensionUri {
#[serde(rename = "http://www.webrtc.org/experiments/rtp-hdrext/playout-delay")]
PlayoutDelay,

/// <https://aomediacodec.github.io/av1-rtp-spec/#dependency-descriptor-rtp-header-extension>
#[serde(
rename = "https://aomediacodec.github.io/av1-rtp-spec/#dependency-descriptor-rtp-header-extension"
)]
DependencyDescriptor,

#[doc(hidden)]
#[serde(other, rename = "unsupported")]
Unsupported,
Expand Down Expand Up @@ -627,6 +633,9 @@ impl RtpHeaderExtensionUri {
RtpHeaderExtensionUri::PlayoutDelay => {
rtp_parameters::RtpHeaderExtensionUri::PlayoutDelay
}
RtpHeaderExtensionUri::DependencyDescriptor => {
rtp_parameters::RtpHeaderExtensionUri::DependencyDescriptor
}
RtpHeaderExtensionUri::Unsupported => panic!("Invalid RTP extension header URI"),
}
}
Expand Down Expand Up @@ -663,6 +672,9 @@ impl RtpHeaderExtensionUri {
rtp_parameters::RtpHeaderExtensionUri::PlayoutDelay => {
RtpHeaderExtensionUri::PlayoutDelay
}
rtp_parameters::RtpHeaderExtensionUri::DependencyDescriptor => {
RtpHeaderExtensionUri::DependencyDescriptor
}
}
}
}
Expand Down Expand Up @@ -690,6 +702,7 @@ impl FromStr for RtpHeaderExtensionUri {
Ok(Self::AbsCaptureTime)
}
"http://www.webrtc.org/experiments/rtp-hdrext/playout-delay" => Ok(Self::PlayoutDelay),
"https://aomediacodec.github.io/av1-rtp-spec/#dependency-descriptor-rtp-header-extension" => Ok(Self::DependencyDescriptor),
_ => Err(RtpHeaderExtensionUriParseError::Unsupported),
}
}
Expand Down Expand Up @@ -724,6 +737,9 @@ impl RtpHeaderExtensionUri {
RtpHeaderExtensionUri::PlayoutDelay => {
"http://www.webrtc.org/experiments/rtp-hdrext/playout-delay"
}
RtpHeaderExtensionUri::DependencyDescriptor => {
"https://aomediacodec.github.io/av1-rtp-spec/#dependency-descriptor-rtp-header-extension"
}
RtpHeaderExtensionUri::Unsupported => "unsupported",
}
}
Expand Down
7 changes: 7 additions & 0 deletions rust/src/supported_rtp_capabilities.rs
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,13 @@ pub fn get_supported_rtp_capabilities() -> RtpCapabilities {
preferred_encrypt: false,
direction: RtpHeaderExtensionDirection::SendRecv,
},
RtpHeaderExtension {
kind: MediaKind::Video,
uri: RtpHeaderExtensionUri::DependencyDescriptor,
preferred_id: 8,
preferred_encrypt: false,
direction: RtpHeaderExtensionDirection::SendRecv,
},
RtpHeaderExtension {
kind: MediaKind::Audio,
uri: RtpHeaderExtensionUri::AudioLevel,
Expand Down
15 changes: 15 additions & 0 deletions rust/tests/integration/pipe_transport.rs
Original file line number Diff line number Diff line change
Expand Up @@ -494,6 +494,11 @@ fn pipe_to_router_succeeds_with_video() {
id: 7,
encrypt: false,
},
RtpHeaderExtensionParameters {
uri: RtpHeaderExtensionUri::DependencyDescriptor,
id: 8,
encrypt: false,
},
RtpHeaderExtensionParameters {
uri: RtpHeaderExtensionUri::VideoOrientation,
id: 11,
Expand Down Expand Up @@ -556,6 +561,11 @@ fn pipe_to_router_succeeds_with_video() {
id: 7,
encrypt: false,
},
RtpHeaderExtensionParameters {
uri: RtpHeaderExtensionUri::DependencyDescriptor,
id: 8,
encrypt: false,
},
RtpHeaderExtensionParameters {
uri: RtpHeaderExtensionUri::VideoOrientation,
id: 11,
Expand Down Expand Up @@ -758,6 +768,11 @@ fn create_with_enable_rtx_succeeds() {
id: 7,
encrypt: false,
},
RtpHeaderExtensionParameters {
uri: RtpHeaderExtensionUri::DependencyDescriptor,
id: 8,
encrypt: false,
},
RtpHeaderExtensionParameters {
uri: RtpHeaderExtensionUri::VideoOrientation,
id: 11,
Expand Down
Loading
Loading