Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
M
mediasoup
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
聂卓夫
mediasoup
Commits
c842e425
提交
c842e425
authored
2月 19, 2017
作者:
Iñaki Baz Castillo
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Code cleanup
上级
e7f5d409
隐藏空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
32 行增加
和
11 行删除
+32
-11
RtpDataCounter.h
worker/include/RTC/RtpDataCounter.h
+1
-0
RtpDictionaries.h
worker/include/RTC/RtpDictionaries.h
+2
-1
RtpDataCounter.cpp
worker/src/RTC/RtpDataCounter.cpp
+3
-4
RtpParameters.cpp
worker/src/RTC/RtpDictionaries/RtpParameters.cpp
+11
-1
RtpReceiver.cpp
worker/src/RTC/RtpReceiver.cpp
+1
-1
RtpSender.cpp
worker/src/RTC/RtpSender.cpp
+14
-4
没有找到文件。
worker/include/RTC/RtpDataCounter.h
浏览文件 @
c842e425
...
...
@@ -68,6 +68,7 @@ namespace RTC
scale
(
scale
)
{
uint64_t
now
=
DepLibUV
::
GetTime
();
this
->
Reset
(
now
-
windowSize
);
}
...
...
worker/include/RTC/RtpDictionaries.h
浏览文件 @
c842e425
...
...
@@ -282,7 +282,8 @@ namespace RTC
Json
::
Value
toJson
();
void
ReduceCodecsAndEncodings
(
RtpCapabilities
&
capabilities
);
void
ReduceHeaderExtensions
(
std
::
vector
<
RtpHeaderExtension
>&
supportedHeaderExtensions
);
uint32_t
GetClockRateForEncoding
(
size_t
encodingIdx
);
uint32_t
GetEncodingClockRate
(
size_t
encodingIdx
);
uint32_t
GetEncodingMediaSsrc
(
size_t
encodingIdx
);
private
:
void
ValidateCodecs
();
...
...
worker/src/RTC/RtpDataCounter.cpp
浏览文件 @
c842e425
...
...
@@ -19,6 +19,7 @@ namespace RTC
// Set data in the index before the oldest index.
uint32_t
offset
=
this
->
windowSize
-
1
;
uint32_t
index
=
this
->
oldestIndex
+
offset
;
if
(
index
>=
this
->
windowSize
)
index
-=
this
->
windowSize
;
...
...
@@ -46,15 +47,11 @@ namespace RTC
// Should never happen.
if
(
newOldestTime
<
this
->
oldestTime
)
{
return
;
}
// We are in the same time unit (ms) as the last entry.
if
(
newOldestTime
==
this
->
oldestTime
)
{
return
;
}
// A whole window size time has elapsed since last entry. Reset the buffer.
if
(
newOldestTime
>
this
->
oldestTime
+
this
->
windowSize
)
...
...
@@ -66,8 +63,10 @@ namespace RTC
while
(
this
->
oldestTime
<
newOldestTime
)
{
const
BufferItem
&
oldestItem
=
buffer
[
this
->
oldestIndex
];
this
->
totalCount
-=
oldestItem
.
count
;
this
->
buffer
[
this
->
oldestIndex
]
=
BufferItem
();
if
(
++
this
->
oldestIndex
>=
this
->
windowSize
)
this
->
oldestIndex
=
0
;
++
this
->
oldestTime
;
...
...
worker/src/RTC/RtpDictionaries/RtpParameters.cpp
浏览文件 @
c842e425
...
...
@@ -246,7 +246,7 @@ namespace RTC
this
->
headerExtensions
=
updatedHeaderExtensions
;
}
uint32_t
RtpParameters
::
Get
ClockRateForEncoding
(
size_t
encodingIdx
)
uint32_t
RtpParameters
::
Get
EncodingClockRate
(
size_t
encodingIdx
)
{
MS_TRACE
();
...
...
@@ -278,6 +278,16 @@ namespace RTC
return
clockRate
;
}
uint32_t
RtpParameters
::
GetEncodingMediaSsrc
(
size_t
encodingIdx
)
{
MS_TRACE
();
if
(
this
->
encodings
.
size
()
<
encodingIdx
+
1
)
MS_ABORT
(
"no such a encoding [encodingIdx:%zu]"
,
encodingIdx
);
return
this
->
encodings
[
encodingIdx
].
ssrc
;
}
inline
void
RtpParameters
::
ValidateCodecs
()
{
...
...
worker/src/RTC/RtpReceiver.cpp
浏览文件 @
c842e425
...
...
@@ -167,7 +167,7 @@ namespace RTC
// Set the RtpStreamRecv.
// TODO: This assumes a single receiving stream for now.
uint32_t
streamClockRate
=
this
->
rtpParameters
->
Get
ClockRateForEncoding
(
0
);
uint32_t
streamClockRate
=
this
->
rtpParameters
->
Get
EncodingClockRate
(
0
);
// Create a RtpStreamRecv for receiving a media stream.
this
->
rtpStream
=
new
RTC
::
RtpStreamRecv
(
streamClockRate
);
...
...
worker/src/RTC/RtpSender.cpp
浏览文件 @
c842e425
...
...
@@ -139,12 +139,16 @@ namespace RTC
MS_ASSERT
(
rtpParameters
,
"no RTP parameters given"
);
auto
previousRtpParameters
=
this
->
rtpParameters
;
auto
hadParameters
=
this
->
rtpParameters
?
true
:
false
;
// Free the previous rtpParameters.
if
(
previousRtp
Parameters
)
if
(
had
Parameters
)
delete
this
->
rtpParameters
;
// Delete previous RtpStreamSend (if any).
if
(
this
->
rtpStream
)
delete
this
->
rtpStream
;
// Clone given RTP parameters so we manage our own sender parameters.
this
->
rtpParameters
=
new
RTC
::
RtpParameters
(
rtpParameters
);
...
...
@@ -200,20 +204,26 @@ namespace RTC
// Set the RtpStreamSend.
// NOTE: We assume a single stream when sending to remote peers.
uint32_t
streamClockRate
=
this
->
rtpParameters
->
Get
ClockRateForEncoding
(
0
);
uint32_t
streamClockRate
=
this
->
rtpParameters
->
Get
EncodingClockRate
(
0
);
// Create a RtpStreamSend for sending a single media stream.
switch
(
this
->
kind
)
{
case
RTC
:
:
Media
::
Kind
::
VIDEO
:
case
RTC
:
:
Media
::
Kind
::
DEPTH
:
{
// Buffer up to 200 packets.
this
->
rtpStream
=
new
RTC
::
RtpStreamSend
(
streamClockRate
,
200
);
break
;
}
case
RTC
:
:
Media
::
Kind
::
AUDIO
:
{
// No buffer for audio streams.
this
->
rtpStream
=
new
RTC
::
RtpStreamSend
(
streamClockRate
,
0
);
break
;
}
default
:
;
}
...
...
@@ -224,7 +234,7 @@ namespace RTC
}
// Emit "parameterschange" if these are updated parameters.
if
(
previousRtp
Parameters
)
if
(
had
Parameters
)
{
Json
::
Value
event_data
(
Json
::
objectValue
);
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论