Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
M
mediasoup
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
聂卓夫
mediasoup
Commits
2a28bb32
提交
2a28bb32
authored
4月 01, 2019
作者:
Iñaki Baz Castillo
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Refactor RTP header extensions (change order, remove the now useless RTP extensions mapping)
上级
f93aae18
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
19 个修改的文件
包含
225 行增加
和
259 行删除
+225
-259
ortc.js
lib/ortc.js
+2
-34
supportedRtpCapabilities.js
lib/supportedRtpCapabilities.js
+16
-16
test-Consumer.js
test/test-Consumer.js
+24
-24
test-PipeTransport.js
test/test-PipeTransport.js
+10
-10
test-ortc.js
test/test-ortc.js
+14
-20
compile_commands_template.json
worker/compile_commands_template.json
+5
-0
FuzzerRtpPacket.cpp
worker/fuzzer/src/RTC/FuzzerRtpPacket.cpp
+18
-18
Producer.hpp
worker/include/RTC/Producer.hpp
+0
-2
RtpDictionaries.hpp
worker/include/RTC/RtpDictionaries.hpp
+7
-7
RtpHeaderExtensionIds.hpp
worker/include/RTC/RtpHeaderExtensionIds.hpp
+4
-3
RtpPacket.hpp
worker/include/RTC/RtpPacket.hpp
+69
-69
AudioLevelObserver.cpp
worker/src/RTC/AudioLevelObserver.cpp
+1
-1
PlainRtpTransport.cpp
worker/src/RTC/PlainRtpTransport.cpp
+4
-4
Producer.cpp
worker/src/RTC/Producer.cpp
+0
-0
RtpHeaderExtensionUri.cpp
worker/src/RTC/RtpDictionaries/RtpHeaderExtensionUri.cpp
+5
-5
RtpPacket.cpp
worker/src/RTC/RtpPacket.cpp
+36
-36
Transport.cpp
worker/src/RTC/Transport.cpp
+3
-3
WebRtcTransport.cpp
worker/src/RTC/WebRtcTransport.cpp
+4
-4
TestRtpPacket.cpp
worker/test/src/RTC/TestRtpPacket.cpp
+3
-3
没有找到文件。
lib/ortc.js
浏览文件 @
2a28bb32
...
...
@@ -123,7 +123,6 @@ exports.generateRouterRtpCapabilities = function(mediaCodecs)
*
* @returns {Object} with codecs, headerExtensions and encodings arrays of objects.
* Each codec has payloadType and mappedPayloadType.
* Each headerExtension has id and mappedId.
* Each encoding may have rid and/or ssrc, and mandatory mappedSsrc.
* @throws {TypeError} if wrong arguments.
* @throws {UnsupportedError} if codec not supported.
...
...
@@ -133,9 +132,8 @@ exports.getProducerRtpParametersMapping = function(params, caps)
{
const
rtpMapping
=
{
codecs
:
[],
headerExtensions
:
[],
encodings
:
[]
codecs
:
[],
encodings
:
[]
};
// Match parameters media codecs to capabilities media codecs.
...
...
@@ -209,25 +207,6 @@ exports.getProducerRtpParametersMapping = function(params, caps)
});
}
// Generate header extensions mapping.
for
(
const
ext
of
(
params
.
headerExtensions
||
[]))
{
const
matchedCapExt
=
caps
.
headerExtensions
.
find
((
capExt
)
=>
matchHeaderExtensions
(
ext
,
capExt
));
if
(
!
matchedCapExt
)
{
throw
new
UnsupportedError
(
`unsupported header extensions [uri:"
${
ext
.
uri
}
", id:
${
ext
.
id
}
]`
);
}
rtpMapping
.
headerExtensions
.
push
(
{
id
:
ext
.
id
,
mappedId
:
matchedCapExt
.
preferredId
});
}
// Generate encodings mapping.
for
(
const
encoding
of
(
params
.
encodings
||
[]))
{
...
...
@@ -644,14 +623,3 @@ function matchCodecs(aCodec, bCodec, { strict = false, modify = false } = {})
return
true
;
}
function
matchHeaderExtensions
(
aExt
,
bExt
)
{
if
(
aExt
.
kind
&&
bExt
.
kind
&&
aExt
.
kind
!==
bExt
.
kind
)
return
false
;
if
(
aExt
.
uri
!==
bExt
.
uri
)
return
false
;
return
true
;
}
lib/supportedRtpCapabilities.js
浏览文件 @
2a28bb32
...
...
@@ -197,55 +197,55 @@ const supportedRtpCapabilities =
[
{
kind
:
'audio'
,
uri
:
'urn:ietf:params:rtp-hdrext:s
src-audio-level
'
,
uri
:
'urn:ietf:params:rtp-hdrext:s
des:mid
'
,
preferredId
:
1
,
preferredEncrypt
:
false
},
{
kind
:
'video'
,
uri
:
'urn:ietf:params:rtp-hdrext:
toffset
'
,
preferredId
:
2
,
uri
:
'urn:ietf:params:rtp-hdrext:
sdes:mid
'
,
preferredId
:
1
,
preferredEncrypt
:
false
},
{
kind
:
'
audi
o'
,
uri
:
'
http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time'
,
// eslint-disable-line max-len
preferredId
:
3
,
kind
:
'
vide
o'
,
uri
:
'
urn:ietf:params:rtp-hdrext:sdes:rtp-stream-id'
,
preferredId
:
2
,
preferredEncrypt
:
false
},
{
kind
:
'video'
,
uri
:
'
http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time'
,
// eslint-disable-line max-len
uri
:
'
urn:ietf:params:rtp-hdrext:sdes:repaired-rtp-stream-id'
,
preferredId
:
3
,
preferredEncrypt
:
false
},
{
kind
:
'
vide
o'
,
uri
:
'
urn:3gpp:video-orientation'
,
kind
:
'
audi
o'
,
uri
:
'
http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time'
,
// eslint-disable-line max-len
preferredId
:
4
,
preferredEncrypt
:
false
},
{
kind
:
'
audi
o'
,
uri
:
'
urn:ietf:params:rtp-hdrext:sdes:mid'
,
preferredId
:
5
,
kind
:
'
vide
o'
,
uri
:
'
http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time'
,
// eslint-disable-line max-len
preferredId
:
4
,
preferredEncrypt
:
false
},
{
kind
:
'
vide
o'
,
uri
:
'urn:ietf:params:rtp-hdrext:s
des:mid
'
,
kind
:
'
audi
o'
,
uri
:
'urn:ietf:params:rtp-hdrext:s
src-audio-level
'
,
preferredId
:
5
,
preferredEncrypt
:
false
},
{
kind
:
'video'
,
uri
:
'urn:
ietf:params:rtp-hdrext:sdes:rtp-stream-id
'
,
uri
:
'urn:
3gpp:video-orientation
'
,
preferredId
:
6
,
preferredEncrypt
:
false
},
{
kind
:
'video'
,
uri
:
'urn:ietf:params:rtp-hdrext:
sdes:repaired-rtp-stream-id
'
,
uri
:
'urn:ietf:params:rtp-hdrext:
toffset
'
,
preferredId
:
7
,
preferredEncrypt
:
false
}
...
...
test/test-Consumer.js
浏览文件 @
2a28bb32
...
...
@@ -190,50 +190,50 @@ const consumerDeviceCapabilities =
[
{
kind
:
'audio'
,
uri
:
'urn:ietf:params:rtp-hdrext:s
src-audio-level
'
,
uri
:
'urn:ietf:params:rtp-hdrext:s
des:mid
'
,
preferredId
:
1
,
preferredEncrypt
:
false
},
{
kind
:
'video'
,
uri
:
'urn:ietf:params:rtp-hdrext:
toffset
'
,
preferredId
:
2
,
uri
:
'urn:ietf:params:rtp-hdrext:
sdes:mid
'
,
preferredId
:
1
,
preferredEncrypt
:
false
},
{
kind
:
'
audi
o'
,
uri
:
'
http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time'
,
// eslint-disable-line max-len
preferredId
:
3
,
kind
:
'
vide
o'
,
uri
:
'
urn:ietf:params:rtp-hdrext:sdes:rtp-stream-id'
,
preferredId
:
2
,
preferredEncrypt
:
false
},
{
kind
:
'
vide
o'
,
kind
:
'
audi
o'
,
uri
:
'http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time'
,
// eslint-disable-line max-len
preferredId
:
3
,
preferredId
:
4
,
preferredEncrypt
:
false
},
{
kind
:
'video'
,
uri
:
'
urn:3gpp:video-orientation'
,
uri
:
'
http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time'
,
// eslint-disable-line max-len
preferredId
:
4
,
preferredEncrypt
:
false
},
{
kind
:
'audio'
,
uri
:
'urn:ietf:params:rtp-hdrext:s
des:mid
'
,
uri
:
'urn:ietf:params:rtp-hdrext:s
src-audio-level
'
,
preferredId
:
5
,
preferredEncrypt
:
false
},
{
kind
:
'video'
,
uri
:
'urn:
ietf:params:rtp-hdrext:sdes:mid
'
,
preferredId
:
5
,
uri
:
'urn:
3gpp:video-orientation
'
,
preferredId
:
6
,
preferredEncrypt
:
false
},
{
kind
:
'video'
,
uri
:
'urn:ietf:params:rtp-hdrext:
sdes:rtp-stream-id
'
,
preferredId
:
6
,
uri
:
'urn:ietf:params:rtp-hdrext:
toffset
'
,
preferredId
:
7
,
preferredEncrypt
:
false
}
],
...
...
@@ -495,14 +495,14 @@ test('consumer.dump() succeeds', async () =>
expect
(
data
.
rtpParameters
.
headerExtensions
).
toEqual
(
[
{
uri
:
'
urn:ietf:params:rtp-hdrext:ssrc-audio-level
'
,
id
:
1
,
uri
:
'
http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time
'
,
id
:
4
,
parameters
:
{},
encrypt
:
false
},
{
uri
:
'
http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time
'
,
id
:
3
,
uri
:
'
urn:ietf:params:rtp-hdrext:ssrc-audio-level
'
,
id
:
5
,
parameters
:
{},
encrypt
:
false
}
...
...
@@ -556,20 +556,20 @@ test('consumer.dump() succeeds', async () =>
expect
(
data
.
rtpParameters
.
headerExtensions
).
toEqual
(
[
{
uri
:
'
urn:ietf:params:rtp-hdrext:toffset
'
,
id
:
2
,
uri
:
'
http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time
'
,
id
:
4
,
parameters
:
{},
encrypt
:
false
},
{
uri
:
'
http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time
'
,
id
:
3
,
uri
:
'
urn:3gpp:video-orientation
'
,
id
:
6
,
parameters
:
{},
encrypt
:
false
},
{
uri
:
'urn:
3gpp:video-orientation
'
,
id
:
4
,
uri
:
'urn:
ietf:params:rtp-hdrext:toffset
'
,
id
:
7
,
parameters
:
{},
encrypt
:
false
}
...
...
test/test-PipeTransport.js
浏览文件 @
2a28bb32
...
...
@@ -231,7 +231,7 @@ test('router.pipeToRouter() succeeds with audio', async () =>
[
{
uri
:
'urn:ietf:params:rtp-hdrext:ssrc-audio-level'
,
id
:
1
id
:
5
}
]);
expect
(
pipeConsumer
.
rtpParameters
.
encodings
).
toEqual
(
...
...
@@ -268,7 +268,7 @@ test('router.pipeToRouter() succeeds with audio', async () =>
[
{
uri
:
'urn:ietf:params:rtp-hdrext:ssrc-audio-level'
,
id
:
1
id
:
5
}
]);
expect
(
pipeProducer
.
rtpParameters
.
encodings
).
toEqual
(
...
...
@@ -319,12 +319,12 @@ test('router.pipeToRouter() succeeds with video', async () =>
expect
(
pipeConsumer
.
rtpParameters
.
headerExtensions
).
toEqual
(
[
{
uri
:
'urn:
ietf:params:rtp-hdrext:toffset
'
,
id
:
2
uri
:
'urn:
3gpp:video-orientation
'
,
id
:
6
},
{
uri
:
'urn:
3gpp:video-orientation
'
,
id
:
4
uri
:
'urn:
ietf:params:rtp-hdrext:toffset
'
,
id
:
7
}
]);
expect
(
pipeConsumer
.
rtpParameters
.
encodings
).
toEqual
(
...
...
@@ -361,12 +361,12 @@ test('router.pipeToRouter() succeeds with video', async () =>
expect
(
pipeProducer
.
rtpParameters
.
headerExtensions
).
toEqual
(
[
{
uri
:
'urn:
ietf:params:rtp-hdrext:toffset
'
,
id
:
2
uri
:
'urn:
3gpp:video-orientation
'
,
id
:
6
},
{
uri
:
'urn:
3gpp:video-orientation
'
,
id
:
4
uri
:
'urn:
ietf:params:rtp-hdrext:toffset
'
,
id
:
7
}
]);
expect
(
pipeProducer
.
paused
).
toBe
(
true
);
...
...
test/test-ortc.js
浏览文件 @
2a28bb32
...
...
@@ -283,12 +283,6 @@ test('getProducerRtpParametersMapping(), getConsumableRtpParameters(), getConsum
{
payloadType
:
112
,
mappedPayloadType
:
102
}
]);
expect
(
rtpMapping
.
headerExtensions
).
toEqual
(
[
{
id
:
1
,
mappedId
:
5
},
{
id
:
2
,
mappedId
:
4
}
]);
expect
(
rtpMapping
.
encodings
[
0
].
ssrc
).
toBe
(
11111111
);
expect
(
rtpMapping
.
encodings
[
0
].
rid
).
toBe
(
undefined
);
expect
(
rtpMapping
.
encodings
[
0
].
mappedSsrc
).
toBeType
(
'number'
);
...
...
@@ -384,38 +378,38 @@ test('getProducerRtpParametersMapping(), getConsumableRtpParameters(), getConsum
[
{
kind
:
'audio'
,
uri
:
'urn:ietf:params:rtp-hdrext:s
src-audio-level
'
,
uri
:
'urn:ietf:params:rtp-hdrext:s
des:mid
'
,
preferredId
:
1
,
preferredEncrypt
:
false
},
{
kind
:
'video'
,
uri
:
'urn:ietf:params:rtp-hdrext:
toffset
'
,
preferredId
:
2
,
uri
:
'urn:ietf:params:rtp-hdrext:
sdes:mid
'
,
preferredId
:
1
,
preferredEncrypt
:
false
},
{
kind
:
'video'
,
uri
:
'urn:
3gpp:video-orientation
'
,
preferredId
:
4
,
uri
:
'urn:
ietf:params:rtp-hdrext:sdes:rtp-stream-id
'
,
preferredId
:
2
,
preferredEncrypt
:
false
},
{
kind
:
'audio'
,
uri
:
'urn:ietf:params:rtp-hdrext:s
des:mid
'
,
uri
:
'urn:ietf:params:rtp-hdrext:s
src-audio-level
'
,
preferredId
:
5
,
preferredEncrypt
:
false
},
{
kind
:
'video'
,
uri
:
'urn:
ietf:params:rtp-hdrext:sdes:mid
'
,
preferredId
:
5
,
uri
:
'urn:
3gpp:video-orientation
'
,
preferredId
:
6
,
preferredEncrypt
:
false
},
{
kind
:
'video'
,
uri
:
'urn:ietf:params:rtp-hdrext:
sdes:rtp-stream-id
'
,
preferredId
:
6
,
uri
:
'urn:ietf:params:rtp-hdrext:
toffset
'
,
preferredId
:
7
,
preferredEncrypt
:
false
}
]
...
...
@@ -463,12 +457,12 @@ test('getProducerRtpParametersMapping(), getConsumableRtpParameters(), getConsum
expect
(
consumerRtpParameters
.
headerExtensions
).
toEqual
(
[
{
uri
:
'urn:
ietf:params:rtp-hdrext:toffset
'
,
id
:
2
uri
:
'urn:
3gpp:video-orientation
'
,
id
:
6
},
{
uri
:
'urn:
3gpp:video-orientation
'
,
id
:
4
uri
:
'urn:
ietf:params:rtp-hdrext:toffset
'
,
id
:
7
}
]);
...
...
worker/compile_commands_template.json
浏览文件 @
2a28bb32
...
...
@@ -404,6 +404,11 @@
"directory"
:
"PATH/out"
,
"file"
:
"PATH/src/RTC/RTCP/FeedbackPsRemb.cpp"
},
{
"command"
:
"c++ -c -DMS_LITTLE_ENDIAN -D_POSIX_C_SOURCE=200112 -D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DHAVE_INT16_T -DHAVE_INT32_T -DHAVE_INT8_T -DHAVE_UINT16_T -DHAVE_UINT32_T -DHAVE_UINT64_T -DHAVE_UINT8_T -DHAVE_STDINT_H -DHAVE_INTTYPES_H -DHAVE_NETINET_IN_H -DCPU_CISC -IPATH/include -IPATH/deps/netstring/netstring-c -IPATH/deps/libuv/include -IPATH/deps/openssl/openssl/include -IPATH/deps/libsrtp/srtp/include -std=c++11 -Wall -Wextra -Wno-unused-parameter -m64 -g -o PATH/out/Release/obj.target/mediasoup-worker/src/RTC/RembClient.o PATH/src/RTC/RembClient.cpp"
,
"directory"
:
"PATH/out"
,
"file"
:
"PATH/src/RTC/RembClient.cpp"
},
{
"command"
:
"c++ -c -DMS_LITTLE_ENDIAN -D_POSIX_C_SOURCE=200112 -D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DHAVE_INT16_T -DHAVE_INT32_T -DHAVE_INT8_T -DHAVE_UINT16_T -DHAVE_UINT32_T -DHAVE_UINT64_T -DHAVE_UINT8_T -DHAVE_STDINT_H -DHAVE_INTTYPES_H -DHAVE_NETINET_IN_H -DCPU_CISC -IPATH/include -IPATH/deps/netstring/netstring-c -IPATH/deps/libuv/include -IPATH/deps/openssl/openssl/include -IPATH/deps/libsrtp/srtp/include -std=c++11 -Wall -Wextra -Wno-unused-parameter -m64 -g -o PATH/out/Release/obj.target/mediasoup-worker/src/RTC/RembServer/AimdRateControl.o PATH/src/RTC/RembServer/AimdRateControl.cpp"
,
"directory"
:
"PATH/out"
,
...
...
worker/fuzzer/src/RTC/FuzzerRtpPacket.cpp
浏览文件 @
2a28bb32
...
...
@@ -53,18 +53,6 @@ void Fuzzer::RTC::RtpPacket::Fuzz(const uint8_t* data, size_t len)
packet
->
HasOneByteExtensions
();
packet
->
HasTwoBytesExtensions
();
packet
->
SetAudioLevelExtensionId
(
1
);
packet
->
GetExtension
(
1
,
extenLen
);
packet
->
ReadAudioLevel
(
volume
,
voice
);
packet
->
SetVideoOrientationExtensionId
(
2
);
packet
->
GetExtension
(
2
,
extenLen
);
packet
->
ReadVideoOrientation
(
camera
,
flip
,
rotation
);
packet
->
SetAbsSendTimeExtensionId
(
3
);
packet
->
GetExtension
(
3
,
extenLen
);
packet
->
ReadAbsSendTime
(
absSendTime
);
packet
->
SetMidExtensionId
(
5
);
packet
->
GetExtension
(
5
,
extenLen
);
packet
->
ReadMid
(
mid
);
...
...
@@ -73,6 +61,18 @@ void Fuzzer::RTC::RtpPacket::Fuzz(const uint8_t* data, size_t len)
packet
->
GetExtension
(
6
,
extenLen
);
packet
->
ReadRid
(
rid
);
packet
->
SetAbsSendTimeExtensionId
(
3
);
packet
->
GetExtension
(
3
,
extenLen
);
packet
->
ReadAbsSendTime
(
absSendTime
);
packet
->
SetSsrcAudioLevelExtensionId
(
1
);
packet
->
GetExtension
(
1
,
extenLen
);
packet
->
ReadSsrcAudioLevel
(
volume
,
voice
);
packet
->
SetVideoOrientationExtensionId
(
2
);
packet
->
GetExtension
(
2
,
extenLen
);
packet
->
ReadVideoOrientation
(
camera
,
flip
,
rotation
);
uint8_t
value1
[]
=
{
0x01
,
0x02
,
0x03
,
0x04
};
extensions
.
emplace_back
(
...
...
@@ -126,18 +126,18 @@ void Fuzzer::RTC::RtpPacket::Fuzz(const uint8_t* data, size_t len)
packet
->
SetExtensions
(
2
,
extensions
);
packet
->
SetExtensions
(
1
,
extensions
);
packet
->
SetAudioLevelExtensionId
(
11
);
packet
->
SetAbsSendTimeExtensionId
(
13
);
packet
->
GetExtension
(
13
,
extenLen
);
packet
->
ReadAbsSendTime
(
absSendTime
);
packet
->
SetSsrcAudioLevelExtensionId
(
11
);
packet
->
GetExtension
(
11
,
extenLen
);
packet
->
ReadAudioLevel
(
volume
,
voice
);
packet
->
Read
Ssrc
AudioLevel
(
volume
,
voice
);
packet
->
SetVideoOrientationExtensionId
(
12
);
packet
->
GetExtension
(
12
,
extenLen
);
packet
->
ReadVideoOrientation
(
camera
,
flip
,
rotation
);
packet
->
SetAbsSendTimeExtensionId
(
13
);
packet
->
GetExtension
(
13
,
extenLen
);
packet
->
ReadAbsSendTime
(
absSendTime
);
packet
->
GetPayload
();
packet
->
GetPayloadLength
();
packet
->
GetPayloadPadding
();
...
...
worker/include/RTC/Producer.hpp
浏览文件 @
2a28bb32
...
...
@@ -49,7 +49,6 @@ namespace RTC
struct
RtpMapping
{
std
::
map
<
uint8_t
,
uint8_t
>
codecs
;
std
::
map
<
uint8_t
,
uint8_t
>
headerExtensions
;
std
::
vector
<
RtpEncodingMapping
>
encodings
;
};
...
...
@@ -118,7 +117,6 @@ namespace RTC
std
::
map
<
RTC
::
RtpStreamRecv
*
,
uint32_t
>
mapRtpStreamMappedSsrc
;
std
::
map
<
uint32_t
,
uint32_t
>
mapMappedSsrcSsrc
;
struct
RTC
::
RtpHeaderExtensionIds
rtpHeaderExtensionIds
;
struct
RTC
::
RtpHeaderExtensionIds
mappedRtpHeaderExtensionIds
;
bool
paused
{
false
};
// Timestamp when last RTCP was sent.
uint64_t
lastRtcpSentTime
{
0
};
...
...
worker/include/RTC/RtpDictionaries.hpp
浏览文件 @
2a28bb32
...
...
@@ -127,13 +127,13 @@ namespace RTC
enum
class
Type
:
uint8_t
{
UNKNOWN
=
0
,
SSRC_AUDIO_LEVEL
=
1
,
TO_OFFSET
=
2
,
ABS_SEND_TIME
=
3
,
VIDEO_ORIENTATION
=
4
,
MID
=
5
,
RTP_STREAM_ID
=
6
,
REPAIRED_RTP_STREAM_ID
=
7
MID
=
1
,
RTP_STREAM_ID
=
2
,
REPAIRED_RTP_STREAM_ID
=
3
,
ABS_SEND_TIME
=
4
,
SSRC_AUDIO_LEVEL
=
5
,
VIDEO_ORIENTATION
=
6
,
TOFFSET
=
7
};
private
:
...
...
worker/include/RTC/RtpHeaderExtensionIds.hpp
浏览文件 @
2a28bb32
...
...
@@ -7,12 +7,13 @@ namespace RTC
// the same Transport. Others are different for each Producer.
struct
RtpHeaderExtensionIds
{
uint8_t
ssrcAudioLevel
{
0u
};
// 0 means no ssrc-audio-level id.
uint8_t
videoOrientation
{
0u
};
// 0 means no video-orientation id.
uint8_t
absSendTime
{
0u
};
// 0 means no abs-send-time id.
uint8_t
mid
{
0u
};
// 0 means no MID id.
uint8_t
rid
{
0u
};
// 0 means no RID id.
uint8_t
rrid
{
0u
};
// 0 means no RRID id.
uint8_t
absSendTime
{
0u
};
// 0 means no abs-send-time id.
uint8_t
ssrcAudioLevel
{
0u
};
// 0 means no ssrc-audio-level id.
uint8_t
videoOrientation
{
0u
};
// 0 means no video-orientation id.
uint8_t
toffset
{
0u
};
// 0 means no toffset id.
};
}
// namespace RTC
...
...
worker/include/RTC/RtpPacket.hpp
浏览文件 @
2a28bb32
...
...
@@ -122,17 +122,17 @@ namespace RTC
uint8_t
*
GetHeaderExtensionValue
()
const
;
bool
HasOneByteExtensions
()
const
;
bool
HasTwoBytesExtensions
()
const
;
void
SetAudioLevelExtensionId
(
uint8_t
id
);
void
SetVideoOrientationExtensionId
(
uint8_t
id
);
void
SetAbsSendTimeExtensionId
(
uint8_t
id
);
void
SetMidExtensionId
(
uint8_t
id
);
void
SetRidExtensionId
(
uint8_t
id
);
void
SetRepairedRidExtensionId
(
uint8_t
id
);
bool
ReadAudioLevel
(
uint8_t
&
volume
,
bool
&
voice
)
const
;
bool
ReadVideoOrientation
(
bool
&
camera
,
bool
&
flip
,
uint16_t
&
rotation
)
const
;
bool
ReadAbsSendTime
(
uint32_t
&
time
)
const
;
void
SetAbsSendTimeExtensionId
(
uint8_t
id
)
;
void
SetSsrcAudioLevelExtensionId
(
uint8_t
id
)
;
void
SetVideoOrientationExtensionId
(
uint8_t
id
)
;
bool
ReadMid
(
std
::
string
&
mid
)
const
;
bool
ReadRid
(
std
::
string
&
rid
)
const
;
bool
ReadAbsSendTime
(
uint32_t
&
time
)
const
;
bool
ReadSsrcAudioLevel
(
uint8_t
&
volume
,
bool
&
voice
)
const
;
bool
ReadVideoOrientation
(
bool
&
camera
,
bool
&
flip
,
uint16_t
&
rotation
)
const
;
uint8_t
*
GetExtension
(
uint8_t
id
,
uint8_t
&
len
)
const
;
uint8_t
*
GetPayload
()
const
;
size_t
GetPayloadLength
()
const
;
...
...
@@ -156,12 +156,12 @@ namespace RTC
HeaderExtension
*
headerExtension
{
nullptr
};
std
::
map
<
uint8_t
,
OneByteExtension
*>
mapOneByteExtensions
;
std
::
map
<
uint8_t
,
TwoBytesExtension
*>
mapTwoBytesExtensions
;
uint8_t
audioLevelExtensionId
{
0
};
uint8_t
videoOrientationExtensionId
{
0
};
uint8_t
absSendTimeExtensionId
{
0
};
uint8_t
midExtensionId
{
0
};
uint8_t
ridExtensionId
{
0
};
uint8_t
rridExtensionId
{
0
};
uint8_t
absSendTimeExtensionId
{
0
};
uint8_t
ssrcAudioLevelExtensionId
{
0
};
uint8_t
videoOrientationExtensionId
{
0
};
uint8_t
*
payload
{
nullptr
};
size_t
payloadLength
{
0
};
uint8_t
payloadPadding
{
0
};
...
...
@@ -292,102 +292,90 @@ namespace RTC
return
(
GetHeaderExtensionId
()
&
0
b1111111111110000
)
==
0
b0001000000000000
;
}
inline
void
RtpPacket
::
Set
AudioLevel
ExtensionId
(
uint8_t
id
)
inline
void
RtpPacket
::
Set
Mid
ExtensionId
(
uint8_t
id
)
{
if
(
id
==
0u
)
return
;
this
->
audioLevel
ExtensionId
=
id
;
this
->
mid
ExtensionId
=
id
;
}
inline
void
RtpPacket
::
Set
VideoOrientation
ExtensionId
(
uint8_t
id
)
inline
void
RtpPacket
::
Set
Rid
ExtensionId
(
uint8_t
id
)
{
if
(
id
==
0u
)
return
;
this
->
videoOrientation
ExtensionId
=
id
;
this
->
rid
ExtensionId
=
id
;
}
inline
void
RtpPacket
::
Set
AbsSendTime
ExtensionId
(
uint8_t
id
)
inline
void
RtpPacket
::
Set
RepairedRid
ExtensionId
(
uint8_t
id
)
{
if
(
id
==
0u
)
return
;
this
->
absSendTime
ExtensionId
=
id
;
this
->
rrid
ExtensionId
=
id
;
}
inline
void
RtpPacket
::
Set
Mid
ExtensionId
(
uint8_t
id
)
inline
void
RtpPacket
::
Set
AbsSendTime
ExtensionId
(
uint8_t
id
)
{
if
(
id
==
0u
)
return
;
this
->
mid
ExtensionId
=
id
;
this
->
absSendTime
ExtensionId
=
id
;
}
inline
void
RtpPacket
::
Set
Rid
ExtensionId
(
uint8_t
id
)
inline
void
RtpPacket
::
Set
SsrcAudioLevel
ExtensionId
(
uint8_t
id
)
{
if
(
id
==
0u
)
return
;
this
->
rid
ExtensionId
=
id
;
this
->
ssrcAudioLevel
ExtensionId
=
id
;
}
inline
void
RtpPacket
::
Set
RepairedRid
ExtensionId
(
uint8_t
id
)
inline
void
RtpPacket
::
Set
VideoOrientation
ExtensionId
(
uint8_t
id
)
{
if
(
id
==
0u
)
return
;
this
->
rrid
ExtensionId
=
id
;
this
->
videoOrientation
ExtensionId
=
id
;
}
inline
bool
RtpPacket
::
Read
AudioLevel
(
uint8_t
&
volume
,
bool
&
voice
)
const
inline
bool
RtpPacket
::
Read
Mid
(
std
::
string
&
mid
)
const
{
uint8_t
extenLen
;
uint8_t
*
extenValue
=
GetExtension
(
this
->
audioLevel
ExtensionId
,
extenLen
);
uint8_t
*
extenValue
=
GetExtension
(
this
->
mid
ExtensionId
,
extenLen
);
if
(
!
extenValue
||
extenLen
!=
1
)
if
(
!
extenValue
||
extenLen
==
0
)
return
false
;
volume
=
Utils
::
Byte
::
Get1Byte
(
extenValue
,
0
);
voice
=
(
volume
&
(
1
<<
7
))
?
true
:
false
;
volume
&=
~
(
1
<<
7
);
mid
.
assign
(
reinterpret_cast
<
const
char
*>
(
extenValue
),
static_cast
<
size_t
>
(
extenLen
));
return
true
;
}
inline
bool
RtpPacket
::
Read
VideoOrientation
(
bool
&
camera
,
bool
&
flip
,
uint16_t
&
rotation
)
const
inline
bool
RtpPacket
::
Read
Rid
(
std
::
string
&
rid
)
const
{
// First try with the RID id then with the Repaired RID id.
uint8_t
extenLen
;
uint8_t
*
extenValue
=
GetExtension
(
this
->
videoOrientation
ExtensionId
,
extenLen
);
uint8_t
*
extenValue
=
GetExtension
(
this
->
rid
ExtensionId
,
extenLen
);
if
(
!
extenValue
||
extenLen
!=
1
)
return
false
;
if
(
extenValue
&&
extenLen
>
0
)
{
rid
.
assign
(
reinterpret_cast
<
const
char
*>
(
extenValue
),
static_cast
<
size_t
>
(
extenLen
));
uint8_t
cvoByte
=
Utils
::
Byte
::
Get1Byte
(
extenValue
,
0
);
uint8_t
cameraValue
=
((
cvoByte
&
0
b00001000
)
>>
3
);
uint8_t
flipValue
=
((
cvoByte
&
0
b00000100
)
>>
2
);
uint8_t
rotationValue
=
(
cvoByte
&
0
b00000011
);
return
true
;
}
camera
=
cameraValue
?
true
:
false
;
flip
=
flipValue
?
true
:
false
;
extenValue
=
GetExtension
(
this
->
rridExtensionId
,
extenLen
);
// Using counter clockwise values.
switch
(
rotationValue
)
if
(
extenValue
&&
extenLen
>
0
)
{
case
3
:
rotation
=
270
;
break
;
case
2
:
rotation
=
180
;
break
;
case
1
:
rotation
=
90
;
break
;
default
:
rotation
=
0
;
rid
.
assign
(
reinterpret_cast
<
const
char
*>
(
extenValue
),
static_cast
<
size_t
>
(
extenLen
));
return
true
;
}
return
tru
e
;
return
fals
e
;
}
inline
bool
RtpPacket
::
ReadAbsSendTime
(
uint32_t
&
time
)
const
...
...
@@ -403,42 +391,54 @@ namespace RTC
return
true
;
}
inline
bool
RtpPacket
::
Read
Mid
(
std
::
string
&
mid
)
const
inline
bool
RtpPacket
::
Read
SsrcAudioLevel
(
uint8_t
&
volume
,
bool
&
voice
)
const
{
uint8_t
extenLen
;
uint8_t
*
extenValue
=
GetExtension
(
this
->
mid
ExtensionId
,
extenLen
);
uint8_t
*
extenValue
=
GetExtension
(
this
->
ssrcAudioLevel
ExtensionId
,
extenLen
);
if
(
!
extenValue
||
extenLen
==
0
)
if
(
!
extenValue
||
extenLen
!=
1
)
return
false
;
mid
.
assign
(
reinterpret_cast
<
const
char
*>
(
extenValue
),
static_cast
<
size_t
>
(
extenLen
));
volume
=
Utils
::
Byte
::
Get1Byte
(
extenValue
,
0
);
voice
=
(
volume
&
(
1
<<
7
))
?
true
:
false
;
volume
&=
~
(
1
<<
7
);
return
true
;
}
inline
bool
RtpPacket
::
Read
Rid
(
std
::
string
&
rid
)
const
inline
bool
RtpPacket
::
Read
VideoOrientation
(
bool
&
camera
,
bool
&
flip
,
uint16_t
&
rotation
)
const
{
// First try with the RID id then with the Repaired RID id.
uint8_t
extenLen
;
uint8_t
*
extenValue
=
GetExtension
(
this
->
rid
ExtensionId
,
extenLen
);
uint8_t
*
extenValue
=
GetExtension
(
this
->
videoOrientation
ExtensionId
,
extenLen
);
if
(
extenValue
&&
extenLen
>
0
)
{
rid
.
assign
(
reinterpret_cast
<
const
char
*>
(
extenValue
),
static_cast
<
size_t
>
(
extenLen
));
if
(
!
extenValue
||
extenLen
!=
1
)
return
false
;
return
true
;
}
uint8_t
cvoByte
=
Utils
::
Byte
::
Get1Byte
(
extenValue
,
0
);
uint8_t
cameraValue
=
((
cvoByte
&
0
b00001000
)
>>
3
);
uint8_t
flipValue
=
((
cvoByte
&
0
b00000100
)
>>
2
);
uint8_t
rotationValue
=
(
cvoByte
&
0
b00000011
);
extenValue
=
GetExtension
(
this
->
rridExtensionId
,
extenLen
);
camera
=
cameraValue
?
true
:
false
;
flip
=
flipValue
?
true
:
false
;
if
(
extenValue
&&
extenLen
>
0
)
// Using counter clockwise values.
switch
(
rotationValue
)
{
rid
.
assign
(
reinterpret_cast
<
const
char
*>
(
extenValue
),
static_cast
<
size_t
>
(
extenLen
));
return
true
;
case
3
:
rotation
=
270
;
break
;
case
2
:
rotation
=
180
;
break
;
case
1
:
rotation
=
90
;
break
;
default
:
rotation
=
0
;
}
return
fals
e
;
return
tru
e
;
}
inline
uint8_t
*
RtpPacket
::
GetExtension
(
uint8_t
id
,
uint8_t
&
len
)
const
...
...
worker/src/RTC/AudioLevelObserver.cpp
浏览文件 @
2a28bb32
...
...
@@ -90,7 +90,7 @@ namespace RTC
uint8_t
volume
;
bool
voice
;
if
(
!
packet
->
ReadAudioLevel
(
volume
,
voice
))
if
(
!
packet
->
Read
Ssrc
AudioLevel
(
volume
,
voice
))
return
;
auto
&
dBovs
=
this
->
mapProducerDBovs
.
at
(
producer
);
...
...
worker/src/RTC/PlainRtpTransport.cpp
浏览文件 @
2a28bb32
...
...
@@ -185,9 +185,6 @@ namespace RTC
jsonObject
[
"rtpHeaderExtensions"
]
=
json
::
object
();
auto
jsonRtpHeaderExtensionsIt
=
jsonObject
.
find
(
"rtpHeaderExtensions"
);
if
(
this
->
rtpHeaderExtensionIds
.
absSendTime
!=
0u
)
(
*
jsonRtpHeaderExtensionsIt
)[
"absSendTime"
]
=
this
->
rtpHeaderExtensionIds
.
absSendTime
;
if
(
this
->
rtpHeaderExtensionIds
.
mid
!=
0u
)
(
*
jsonRtpHeaderExtensionsIt
)[
"mid"
]
=
this
->
rtpHeaderExtensionIds
.
mid
;
...
...
@@ -197,6 +194,9 @@ namespace RTC
if
(
this
->
rtpHeaderExtensionIds
.
rrid
!=
0u
)
(
*
jsonRtpHeaderExtensionsIt
)[
"rrid"
]
=
this
->
rtpHeaderExtensionIds
.
rrid
;
if
(
this
->
rtpHeaderExtensionIds
.
absSendTime
!=
0u
)
(
*
jsonRtpHeaderExtensionsIt
)[
"absSendTime"
]
=
this
->
rtpHeaderExtensionIds
.
absSendTime
;
// Add rtpListener.
this
->
rtpListener
.
FillJson
(
jsonObject
[
"rtpListener"
]);
}
...
...
@@ -548,10 +548,10 @@ namespace RTC
}
// Apply the Transport RTP header extension ids so the RTP listener can use them.
packet
->
SetAbsSendTimeExtensionId
(
this
->
rtpHeaderExtensionIds
.
absSendTime
);
packet
->
SetMidExtensionId
(
this
->
rtpHeaderExtensionIds
.
mid
);
packet
->
SetRidExtensionId
(
this
->
rtpHeaderExtensionIds
.
rid
);
packet
->
SetRepairedRidExtensionId
(
this
->
rtpHeaderExtensionIds
.
rrid
);
packet
->
SetAbsSendTimeExtensionId
(
this
->
rtpHeaderExtensionIds
.
absSendTime
);
// Get the associated Producer.
RTC
::
Producer
*
producer
=
this
->
rtpListener
.
GetProducer
(
packet
);
...
...
worker/src/RTC/Producer.cpp
浏览文件 @
2a28bb32
差异被折叠。
点击展开。
worker/src/RTC/RtpDictionaries/RtpHeaderExtensionUri.cpp
浏览文件 @
2a28bb32
...
...
@@ -12,13 +12,13 @@ namespace RTC
// clang-format off
std
::
unordered_map
<
std
::
string
,
RtpHeaderExtensionUri
::
Type
>
RtpHeaderExtensionUri
::
string2Type
=
{
{
"urn:ietf:params:rtp-hdrext:ssrc-audio-level"
,
RtpHeaderExtensionUri
::
Type
::
SSRC_AUDIO_LEVEL
},
{
"urn:ietf:params:rtp-hdrext:toffset"
,
RtpHeaderExtensionUri
::
Type
::
TO_OFFSET
},
{
"http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time"
,
RtpHeaderExtensionUri
::
Type
::
ABS_SEND_TIME
},
{
"urn:3gpp:video-orientation"
,
RtpHeaderExtensionUri
::
Type
::
VIDEO_ORIENTATION
},
{
"urn:ietf:params:rtp-hdrext:sdes:mid"
,
RtpHeaderExtensionUri
::
Type
::
MID
},
{
"urn:ietf:params:rtp-hdrext:sdes:rtp-stream-id"
,
RtpHeaderExtensionUri
::
Type
::
RTP_STREAM_ID
},
{
"urn:ietf:params:rtp-hdrext:sdes:repaired-rtp-stream-id"
,
RtpHeaderExtensionUri
::
Type
::
REPAIRED_RTP_STREAM_ID
}
{
"urn:ietf:params:rtp-hdrext:sdes:repaired-rtp-stream-id"
,
RtpHeaderExtensionUri
::
Type
::
REPAIRED_RTP_STREAM_ID
},
{
"http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time"
,
RtpHeaderExtensionUri
::
Type
::
ABS_SEND_TIME
},
{
"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
}
};
// clang-format on
...
...
worker/src/RTC/RtpPacket.cpp
浏览文件 @
2a28bb32
...
...
@@ -203,36 +203,6 @@ namespace RTC
MS_DEBUG_DEV
(
" RFC5285 ext ids : %s"
,
extIdsStream
.
str
().
c_str
());
}
}
if
(
this
->
audioLevelExtensionId
!=
0u
)
{
uint8_t
volume
;
bool
voice
;
if
(
ReadAudioLevel
(
volume
,
voice
))
MS_DEBUG_DEV
(
" audioLevel : extId:%"
PRIu8
",volume:%"
PRIu8
",voice:%s"
,
this
->
audioLevelExtensionId
,
volume
,
voice
?
"true"
:
"false"
);
}
if
(
this
->
videoOrientationExtensionId
!=
0u
)
{
bool
camera
;
bool
flip
;
uint16_t
rotation
;
if
(
ReadVideoOrientation
(
camera
,
flip
,
rotation
))
MS_DEBUG_DEV
(
" videoOrientation : extId:%"
PRIu8
",camera:%s,flip:%s,rotation:%"
PRIu16
,
this
->
videoOrientationExtensionId
,
camera
?
"true"
:
"false"
,
flip
?
"true"
:
"false"
,
rotation
);
}
if
(
this
->
absSendTimeExtensionId
!=
0u
)
{
MS_DEBUG_DEV
(
" absSendTime : extId:%"
PRIu8
,
this
->
absSendTimeExtensionId
);
}
if
(
this
->
midExtensionId
!=
0u
)
{
std
::
string
mid
;
...
...
@@ -257,6 +227,36 @@ namespace RTC
MS_DEBUG_DEV
(
" rrid : extId:%"
PRIu8
",value:%s"
,
this
->
rridExtensionId
,
rid
.
c_str
());
}
if
(
this
->
absSendTimeExtensionId
!=
0u
)
{
MS_DEBUG_DEV
(
" absSendTime : extId:%"
PRIu8
,
this
->
absSendTimeExtensionId
);
}
if
(
this
->
ssrcAudioLevelExtensionId
!=
0u
)
{
uint8_t
volume
;
bool
voice
;
if
(
ReadSsrcAudioLevel
(
volume
,
voice
))
MS_DEBUG_DEV
(
" ssrcAudioLevel : extId:%"
PRIu8
",volume:%"
PRIu8
",voice:%s"
,
this
->
ssrcAudioLevelExtensionId
,
volume
,
voice
?
"true"
:
"false"
);
}
if
(
this
->
videoOrientationExtensionId
!=
0u
)
{
bool
camera
;
bool
flip
;
uint16_t
rotation
;
if
(
ReadVideoOrientation
(
camera
,
flip
,
rotation
))
MS_DEBUG_DEV
(
" videoOrientation : extId:%"
PRIu8
",camera:%s,flip:%s,rotation:%"
PRIu16
,
this
->
videoOrientationExtensionId
,
camera
?
"true"
:
"false"
,
flip
?
"true"
:
"false"
,
rotation
);
}
MS_DEBUG_DEV
(
" csrc count : %"
PRIu8
,
this
->
header
->
csrcCount
);
MS_DEBUG_DEV
(
" marker : %s"
,
HasMarker
()
?
"true"
:
"false"
);
MS_DEBUG_DEV
(
" payload type : %"
PRIu8
,
GetPayloadType
());
...
...
@@ -277,12 +277,12 @@ namespace RTC
MS_ASSERT
(
type
==
1u
||
type
==
2u
,
"type must be 1 or 2"
);
// Reset extension ids.
this
->
audioLevelExtensionId
=
0
;
this
->
videoOrientationExtensionId
=
0
;
this
->
absSendTimeExtensionId
=
0
;
this
->
midExtensionId
=
0
;
this
->
ridExtensionId
=
0
;
this
->
rridExtensionId
=
0
;
this
->
absSendTimeExtensionId
=
0
;
this
->
ssrcAudioLevelExtensionId
=
0
;
this
->
videoOrientationExtensionId
=
0
;
// Clear the One-Byte and Two-Bytes extension elements maps.
this
->
mapOneByteExtensions
.
clear
();
...
...
@@ -494,12 +494,12 @@ namespace RTC
newHeader
,
newHeaderExtension
,
newPayload
,
this
->
payloadLength
,
this
->
payloadPadding
,
this
->
size
);
// Keep already set extension ids.
packet
->
audioLevelExtensionId
=
this
->
audioLevelExtensionId
;
packet
->
videoOrientationExtensionId
=
this
->
videoOrientationExtensionId
;
packet
->
absSendTimeExtensionId
=
this
->
absSendTimeExtensionId
;
packet
->
midExtensionId
=
this
->
midExtensionId
;
packet
->
ridExtensionId
=
this
->
ridExtensionId
;
packet
->
rridExtensionId
=
this
->
rridExtensionId
;
packet
->
absSendTimeExtensionId
=
this
->
absSendTimeExtensionId
;
packet
->
ssrcAudioLevelExtensionId
=
this
->
ssrcAudioLevelExtensionId
;
packet
->
videoOrientationExtensionId
=
this
->
videoOrientationExtensionId
;
return
packet
;
}
...
...
worker/src/RTC/Transport.cpp
浏览文件 @
2a28bb32
...
...
@@ -211,9 +211,6 @@ namespace RTC
// header extension ids of the Producer (and not their mapped values).
auto
&
producerRtpHeaderExtensionIds
=
producer
->
GetRtpHeaderExtensionIds
();
if
(
producerRtpHeaderExtensionIds
.
absSendTime
!=
0u
)
this
->
rtpHeaderExtensionIds
.
absSendTime
=
producerRtpHeaderExtensionIds
.
absSendTime
;
if
(
producerRtpHeaderExtensionIds
.
mid
!=
0u
)
this
->
rtpHeaderExtensionIds
.
mid
=
producerRtpHeaderExtensionIds
.
mid
;
...
...
@@ -223,6 +220,9 @@ namespace RTC
if
(
producerRtpHeaderExtensionIds
.
rrid
!=
0u
)
this
->
rtpHeaderExtensionIds
.
rrid
=
producerRtpHeaderExtensionIds
.
rrid
;
if
(
producerRtpHeaderExtensionIds
.
absSendTime
!=
0u
)
this
->
rtpHeaderExtensionIds
.
absSendTime
=
producerRtpHeaderExtensionIds
.
absSendTime
;
// Create status response.
json
data
(
json
::
object
());
...
...
worker/src/RTC/WebRtcTransport.cpp
浏览文件 @
2a28bb32
...
...
@@ -375,9 +375,6 @@ namespace RTC
jsonObject
[
"rtpHeaderExtensions"
]
=
json
::
object
();
auto
jsonRtpHeaderExtensionsIt
=
jsonObject
.
find
(
"rtpHeaderExtensions"
);
if
(
this
->
rtpHeaderExtensionIds
.
absSendTime
!=
0u
)
(
*
jsonRtpHeaderExtensionsIt
)[
"absSendTime"
]
=
this
->
rtpHeaderExtensionIds
.
absSendTime
;
if
(
this
->
rtpHeaderExtensionIds
.
mid
!=
0u
)
(
*
jsonRtpHeaderExtensionsIt
)[
"mid"
]
=
this
->
rtpHeaderExtensionIds
.
mid
;
...
...
@@ -387,6 +384,9 @@ namespace RTC
if
(
this
->
rtpHeaderExtensionIds
.
rrid
!=
0u
)
(
*
jsonRtpHeaderExtensionsIt
)[
"rrid"
]
=
this
->
rtpHeaderExtensionIds
.
rrid
;
if
(
this
->
rtpHeaderExtensionIds
.
absSendTime
!=
0u
)
(
*
jsonRtpHeaderExtensionsIt
)[
"absSendTime"
]
=
this
->
rtpHeaderExtensionIds
.
absSendTime
;
// Add rtpListener.
this
->
rtpListener
.
FillJson
(
jsonObject
[
"rtpListener"
]);
}
...
...
@@ -972,10 +972,10 @@ namespace RTC
}
// Apply the Transport RTP header extension ids so the RTP listener can use them.
packet
->
SetAbsSendTimeExtensionId
(
this
->
rtpHeaderExtensionIds
.
absSendTime
);
packet
->
SetMidExtensionId
(
this
->
rtpHeaderExtensionIds
.
mid
);
packet
->
SetRidExtensionId
(
this
->
rtpHeaderExtensionIds
.
rid
);
packet
->
SetRepairedRidExtensionId
(
this
->
rtpHeaderExtensionIds
.
rrid
);
packet
->
SetAbsSendTimeExtensionId
(
this
->
rtpHeaderExtensionIds
.
absSendTime
);
// Feed the REMB server.
if
(
this
->
rembServer
)
...
...
worker/test/src/RTC/TestRtpPacket.cpp
浏览文件 @
2a28bb32
...
...
@@ -104,13 +104,13 @@ SCENARIO("parse RTP packets", "[parser][rtp]")
REQUIRE
(
packet
->
HasOneByteExtensions
());
REQUIRE
(
packet
->
HasTwoBytesExtensions
()
==
false
);
packet
->
SetAudioLevelExtensionId
(
1
);
packet
->
Set
Ssrc
AudioLevelExtensionId
(
1
);
extenValue
=
packet
->
GetExtension
(
1
,
extenLen
);
REQUIRE
(
extenLen
==
1
);
REQUIRE
(
extenValue
);
REQUIRE
(
extenValue
[
0
]
==
0xd0
);
REQUIRE
(
packet
->
ReadAudioLevel
(
volume
,
voice
)
==
true
);
REQUIRE
(
packet
->
Read
Ssrc
AudioLevel
(
volume
,
voice
)
==
true
);
REQUIRE
(
volume
==
0
b1010000
);
REQUIRE
(
voice
==
true
);
...
...
@@ -147,7 +147,7 @@ SCENARIO("parse RTP packets", "[parser][rtp]")
REQUIRE
(
extenLen
==
1
);
REQUIRE
(
extenValue
);
REQUIRE
(
extenValue
[
0
]
==
0xd0
);
REQUIRE
(
clonedPacket
->
ReadAudioLevel
(
volume
,
voice
)
==
true
);
REQUIRE
(
clonedPacket
->
Read
Ssrc
AudioLevel
(
volume
,
voice
)
==
true
);
REQUIRE
(
volume
==
0
b1010000
);
REQUIRE
(
voice
==
true
);
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论