Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
M
mediasoup
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
聂卓夫
mediasoup
Commits
77fca4f7
Unverified
提交
77fca4f7
authored
1月 27, 2022
作者:
oto313
提交者:
GitHub
1月 27, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Added support for RTP abs-capture-time header (#761)
Co-authored-by:
Nazar Mokrynskyi
<
nazar@mokrynskyi.com
>
上级
01eac7f6
隐藏空白字符变更
内嵌
并排
正在显示
11 个修改的文件
包含
144 行增加
和
14 行删除
+144
-14
supportedRtpCapabilities.d.ts.map
node/lib/supportedRtpCapabilities.d.ts.map
+2
-2
supportedRtpCapabilities.js
node/lib/supportedRtpCapabilities.js
+14
-0
supportedRtpCapabilities.ts
node/src/supportedRtpCapabilities.ts
+14
-0
test-PipeTransport.js
node/tests/test-PipeTransport.js
+30
-0
rtp_parameters.rs
rust/src/rtp_parameters.rs
+6
-0
supported_rtp_capabilities.rs
rust/src/supported_rtp_capabilities.rs
+14
-0
pipe_transport.rs
rust/tests/integration/pipe_transport.rs
+39
-10
RtpDictionaries.hpp
worker/include/RTC/RtpDictionaries.hpp
+2
-1
RtpHeaderExtensionIds.hpp
worker/include/RTC/RtpHeaderExtensionIds.hpp
+1
-0
Producer.cpp
worker/src/RTC/Producer.cpp
+20
-0
RtpHeaderExtensionUri.cpp
worker/src/RTC/RtpDictionaries/RtpHeaderExtensionUri.cpp
+2
-1
没有找到文件。
node/lib/supportedRtpCapabilities.d.ts.map
浏览文件 @
77fca4f7
{"version":3,"file":"supportedRtpCapabilities.d.ts","sourceRoot":"","sources":["../src/supportedRtpCapabilities.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAElD,QAAA,MAAM,wBAAwB,EAAE,eAkW/B,CAAC;AAEF,OAAO,EAAE,wBAAwB,EAAE,CAAC"}
\ No newline at end of file
{"version":3,"file":"supportedRtpCapabilities.d.ts","sourceRoot":"","sources":["../src/supportedRtpCapabilities.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAElD,QAAA,MAAM,wBAAwB,EAAE,eAgX/B,CAAC;AAEF,OAAO,EAAE,wBAAwB,EAAE,CAAC"}
\ No newline at end of file
node/lib/supportedRtpCapabilities.js
浏览文件 @
77fca4f7
...
...
@@ -326,6 +326,20 @@ const supportedRtpCapabilities = {
preferredId
:
12
,
preferredEncrypt
:
false
,
direction
:
'sendrecv'
},
{
kind
:
'video'
,
uri
:
'http://www.webrtc.org/experiments/rtp-hdrext/abs-capture-time'
,
preferredId
:
13
,
preferredEncrypt
:
false
,
direction
:
'sendrecv'
},
{
kind
:
'audio'
,
uri
:
'http://www.webrtc.org/experiments/rtp-hdrext/abs-capture-time'
,
preferredId
:
13
,
preferredEncrypt
:
false
,
direction
:
'sendrecv'
}
]
};
...
...
node/src/supportedRtpCapabilities.ts
浏览文件 @
77fca4f7
...
...
@@ -352,6 +352,20 @@ const supportedRtpCapabilities: RtpCapabilities =
preferredId
:
12
,
preferredEncrypt
:
false
,
direction
:
'sendrecv'
},
{
kind
:
'video'
,
uri
:
'http://www.webrtc.org/experiments/rtp-hdrext/abs-capture-time'
,
preferredId
:
13
,
preferredEncrypt
:
false
,
direction
:
'sendrecv'
},
{
kind
:
'audio'
,
uri
:
'http://www.webrtc.org/experiments/rtp-hdrext/abs-capture-time'
,
preferredId
:
13
,
preferredEncrypt
:
false
,
direction
:
'sendrecv'
}
]
};
...
...
node/tests/test-PipeTransport.js
浏览文件 @
77fca4f7
...
...
@@ -265,6 +265,12 @@ test('router.pipeToRouter() succeeds with audio', async () =>
id
:
10
,
encrypt
:
false
,
parameters
:
{}
},
{
uri
:
'http://www.webrtc.org/experiments/rtp-hdrext/abs-capture-time'
,
id
:
13
,
encrypt
:
false
,
parameters
:
{}
}
]);
expect
(
pipeConsumer
.
type
).
toBe
(
'pipe'
);
...
...
@@ -301,6 +307,12 @@ test('router.pipeToRouter() succeeds with audio', async () =>
id
:
10
,
encrypt
:
false
,
parameters
:
{}
},
{
uri
:
'http://www.webrtc.org/experiments/rtp-hdrext/abs-capture-time'
,
id
:
13
,
encrypt
:
false
,
parameters
:
{}
}
]);
expect
(
pipeProducer
.
paused
).
toBe
(
false
);
...
...
@@ -371,6 +383,12 @@ test('router.pipeToRouter() succeeds with video', async () =>
id
:
12
,
encrypt
:
false
,
parameters
:
{}
},
{
uri
:
'http://www.webrtc.org/experiments/rtp-hdrext/abs-capture-time'
,
id
:
13
,
encrypt
:
false
,
parameters
:
{}
}
]);
...
...
@@ -426,6 +444,12 @@ test('router.pipeToRouter() succeeds with video', async () =>
id
:
12
,
encrypt
:
false
,
parameters
:
{}
},
{
uri
:
'http://www.webrtc.org/experiments/rtp-hdrext/abs-capture-time'
,
id
:
13
,
encrypt
:
false
,
parameters
:
{}
}
]);
expect
(
pipeProducer
.
paused
).
toBe
(
true
);
...
...
@@ -495,6 +519,12 @@ test('router.createPipeTransport() with enableRtx succeeds', async () =>
id
:
12
,
encrypt
:
false
,
parameters
:
{}
},
{
uri
:
'http://www.webrtc.org/experiments/rtp-hdrext/abs-capture-time'
,
id
:
13
,
encrypt
:
false
,
parameters
:
{}
}
]);
...
...
rust/src/rtp_parameters.rs
浏览文件 @
77fca4f7
...
...
@@ -432,6 +432,9 @@ pub enum RtpHeaderExtensionUri {
/// <http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time>
#[serde(rename
=
"http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time"
)]
AbsSendTime
,
/// http://www.webrtc.org/experiments/rtp-hdrext/abs-capture-time
#[serde(rename
=
"http://www.webrtc.org/experiments/rtp-hdrext/abs-capture-time"
)]
AbsCaptureTime
,
#[doc(hidden)]
#[serde(other,
rename
=
"unsupported"
)]
Unsupported
,
...
...
@@ -460,6 +463,9 @@ impl RtpHeaderExtensionUri {
RtpHeaderExtensionUri
::
AbsSendTime
=>
{
"http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time"
}
RtpHeaderExtensionUri
::
AbsCaptureTime
=>
{
"http://www.webrtc.org/experiments/rtp-hdrext/abs-capture-time"
}
RtpHeaderExtensionUri
::
Unsupported
=>
"unsupported"
,
}
}
...
...
rust/src/supported_rtp_capabilities.rs
浏览文件 @
77fca4f7
...
...
@@ -356,6 +356,20 @@ pub fn get_supported_rtp_capabilities() -> RtpCapabilities {
preferred_encrypt
:
false
,
direction
:
RtpHeaderExtensionDirection
::
SendRecv
,
},
RtpHeaderExtension
{
kind
:
MediaKind
::
Video
,
uri
:
RtpHeaderExtensionUri
::
AbsCaptureTime
,
preferred_id
:
13
,
preferred_encrypt
:
false
,
direction
:
RtpHeaderExtensionDirection
::
SendRecv
,
},
RtpHeaderExtension
{
kind
:
MediaKind
::
Audio
,
uri
:
RtpHeaderExtensionUri
::
AbsCaptureTime
,
preferred_id
:
13
,
preferred_encrypt
:
false
,
direction
:
RtpHeaderExtensionDirection
::
SendRecv
,
},
],
}
}
rust/tests/integration/pipe_transport.rs
浏览文件 @
77fca4f7
...
...
@@ -317,11 +317,18 @@ fn pipe_to_router_succeeds_with_audio() {
);
assert_eq!
(
pipe_consumer
.rtp_parameters
()
.header_extensions
,
vec!
[
RtpHeaderExtensionParameters
{
uri
:
RtpHeaderExtensionUri
::
AudioLevel
,
id
:
10
,
encrypt
:
false
,
}],
vec!
[
RtpHeaderExtensionParameters
{
uri
:
RtpHeaderExtensionUri
::
AudioLevel
,
id
:
10
,
encrypt
:
false
,
},
RtpHeaderExtensionParameters
{
uri
:
RtpHeaderExtensionUri
::
AbsCaptureTime
,
id
:
13
,
encrypt
:
false
,
}
],
);
assert_eq!
(
pipe_consumer
.r
#
type
(),
ConsumerType
::
Pipe
);
assert_eq!
(
pipe_consumer
.paused
(),
false
);
...
...
@@ -355,11 +362,18 @@ fn pipe_to_router_succeeds_with_audio() {
);
assert_eq!
(
pipe_producer
.rtp_parameters
()
.header_extensions
,
vec!
[
RtpHeaderExtensionParameters
{
uri
:
RtpHeaderExtensionUri
::
AudioLevel
,
id
:
10
,
encrypt
:
false
,
}],
vec!
[
RtpHeaderExtensionParameters
{
uri
:
RtpHeaderExtensionUri
::
AudioLevel
,
id
:
10
,
encrypt
:
false
,
},
RtpHeaderExtensionParameters
{
uri
:
RtpHeaderExtensionUri
::
AbsCaptureTime
,
id
:
13
,
encrypt
:
false
,
}
],
);
assert_eq!
(
pipe_producer
.paused
(),
false
);
});
...
...
@@ -457,6 +471,11 @@ fn pipe_to_router_succeeds_with_video() {
id
:
12
,
encrypt
:
false
,
},
RtpHeaderExtensionParameters
{
uri
:
RtpHeaderExtensionUri
::
AbsCaptureTime
,
id
:
13
,
encrypt
:
false
,
},
],
);
assert_eq!
(
pipe_consumer
.r
#
type
(),
ConsumerType
::
Pipe
);
...
...
@@ -509,6 +528,11 @@ fn pipe_to_router_succeeds_with_video() {
id
:
12
,
encrypt
:
false
,
},
RtpHeaderExtensionParameters
{
uri
:
RtpHeaderExtensionUri
::
AbsCaptureTime
,
id
:
13
,
encrypt
:
false
,
},
],
);
assert_eq!
(
pipe_producer
.paused
(),
true
);
...
...
@@ -651,6 +675,11 @@ fn create_with_enable_rtx_succeeds() {
id
:
12
,
encrypt
:
false
,
},
RtpHeaderExtensionParameters
{
uri
:
RtpHeaderExtensionUri
::
AbsCaptureTime
,
id
:
13
,
encrypt
:
false
,
},
],
);
assert_eq!
(
pipe_consumer
.r
#
type
(),
ConsumerType
::
Pipe
);
...
...
worker/include/RTC/RtpDictionaries.hpp
浏览文件 @
77fca4f7
...
...
@@ -140,7 +140,8 @@ namespace RTC
FRAME_MARKING
=
7
,
SSRC_AUDIO_LEVEL
=
10
,
VIDEO_ORIENTATION
=
11
,
TOFFSET
=
12
TOFFSET
=
12
,
ABS_CAPTURE_TIME
=
13
,
};
private
:
...
...
worker/include/RTC/RtpHeaderExtensionIds.hpp
浏览文件 @
77fca4f7
...
...
@@ -18,6 +18,7 @@ namespace RTC
uint8_t
ssrcAudioLevel
{
0u
};
uint8_t
videoOrientation
{
0u
};
uint8_t
toffset
{
0u
};
uint8_t
absCaptureTime
{
0u
};
};
}
// namespace RTC
...
...
worker/src/RTC/Producer.cpp
浏览文件 @
77fca4f7
...
...
@@ -273,6 +273,11 @@ namespace RTC
{
this
->
rtpHeaderExtensionIds
.
toffset
=
exten
.
id
;
}
if
(
this
->
rtpHeaderExtensionIds
.
absCaptureTime
==
0u
&&
exten
.
type
==
RTC
::
RtpHeaderExtensionUri
::
Type
::
ABS_CAPTURE_TIME
)
{
this
->
rtpHeaderExtensionIds
.
absCaptureTime
=
exten
.
id
;
}
}
// Set the RTCP report generation interval.
...
...
@@ -1335,6 +1340,21 @@ namespace RTC
extensions
.
emplace_back
(
static_cast
<
uint8_t
>
(
RTC
::
RtpHeaderExtensionUri
::
Type
::
TOFFSET
),
extenLen
,
bufferPtr
);
bufferPtr
+=
extenLen
;
}
// Proxy http://www.webrtc.org/experiments/rtp-hdrext/abs-capture-time.
extenValue
=
packet
->
GetExtension
(
this
->
rtpHeaderExtensionIds
.
absCaptureTime
,
extenLen
);
if
(
extenValue
)
{
std
::
memcpy
(
bufferPtr
,
extenValue
,
extenLen
);
extensions
.
emplace_back
(
static_cast
<
uint8_t
>
(
RTC
::
RtpHeaderExtensionUri
::
Type
::
ABS_CAPTURE_TIME
),
extenLen
,
bufferPtr
);
// Not needed since this is the latest added extension.
// bufferPtr += extenLen;
}
...
...
worker/src/RTC/RtpDictionaries/RtpHeaderExtensionUri.cpp
浏览文件 @
77fca4f7
...
...
@@ -22,7 +22,8 @@ namespace RTC
{
"urn:ietf:params:rtp-hdrext:framemarking"
,
RtpHeaderExtensionUri
::
Type
::
FRAME_MARKING
},
{
"urn:ietf:params:rtp-hdrext:ssrc-audio-level"
,
RtpHeaderExtensionUri
::
Type
::
SSRC_AUDIO_LEVEL
},
{
"urn:3gpp:video-orientation"
,
RtpHeaderExtensionUri
::
Type
::
VIDEO_ORIENTATION
},
{
"urn:ietf:params:rtp-hdrext:toffset"
,
RtpHeaderExtensionUri
::
Type
::
TOFFSET
}
{
"urn:ietf:params:rtp-hdrext:toffset"
,
RtpHeaderExtensionUri
::
Type
::
TOFFSET
},
{
"http://www.webrtc.org/experiments/rtp-hdrext/abs-capture-time"
,
RtpHeaderExtensionUri
::
Type
::
ABS_CAPTURE_TIME
},
};
// clang-format on
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论