Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
M
mediasoup
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
聂卓夫
mediasoup
Commits
02b489cc
提交
02b489cc
authored
9月 11, 2017
作者:
Iñaki Baz Castillo
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Code cleanup
上级
4f52d2b8
隐藏空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
79 行增加
和
54 行删除
+79
-54
TODO_V2.md
TODO_V2.md
+2
-0
Consumer.hpp
worker/include/RTC/Consumer.hpp
+1
-14
RtpStreamSend.hpp
worker/include/RTC/RtpStreamSend.hpp
+1
-2
Consumer.cpp
worker/src/RTC/Consumer.cpp
+49
-11
RtpPacket.cpp
worker/src/RTC/RtpPacket.cpp
+3
-0
RtpStreamSend.cpp
worker/src/RTC/RtpStreamSend.cpp
+22
-26
Transport.cpp
worker/src/RTC/Transport.cpp
+1
-1
没有找到文件。
TODO_V2.md
浏览文件 @
02b489cc
# TODO in mediasoup v2 (server-side)
*
`Producer`
: Clearn RTX mapping when streams are updated/modified.
*
`RtpListener`
: Remove
`ptTable`
(period) and add
`ridTable`
.
*
Remove
`producer.on('rtprawpacket')`
and, instead, create a special
`RtpConsumer`
or something like that.
...
...
worker/include/RTC/Consumer.hpp
浏览文件 @
02b489cc
...
...
@@ -43,6 +43,7 @@ namespace RTC
void
SourcePause
();
void
SourceResume
();
void
SourceRtpParametersUpdated
();
void
SetPreferredProfile
(
const
RTC
::
RtpEncodingParameters
::
Profile
profile
);
void
Disable
();
bool
IsEnabled
()
const
;
const
RTC
::
RtpParameters
&
GetParameters
()
const
;
...
...
@@ -53,7 +54,6 @@ namespace RTC
void
ReceiveRtcpReceiverReport
(
RTC
::
RTCP
::
ReceiverReport
*
report
);
uint32_t
GetTransmissionRate
(
uint64_t
now
);
void
RequestFullFrame
();
void
SetPreferredProfile
(
const
RTC
::
RtpEncodingParameters
::
Profile
profile
);
private
:
void
FillSupportedCodecPayloadTypes
();
...
...
@@ -126,19 +126,6 @@ namespace RTC
{
return
this
->
transmittedCounter
.
GetRate
(
now
)
+
this
->
retransmittedCounter
.
GetRate
(
now
);
}
inline
void
Consumer
::
SetPreferredProfile
(
const
RTC
::
RtpEncodingParameters
::
Profile
profile
)
{
if
(
this
->
preferredProfile
==
profile
)
return
;
this
->
preferredProfile
=
profile
;
// TODO: Set it dynamically dynamic.
this
->
effectiveProfile
=
profile
;
this
->
syncRequired
=
true
;
RequestFullFrame
();
}
}
// namespace RTC
#endif
worker/include/RTC/RtpStreamSend.hpp
浏览文件 @
02b489cc
...
...
@@ -39,10 +39,9 @@ namespace RTC
void
SetRtx
(
uint8_t
payloadType
,
uint32_t
ssrc
);
bool
HasRtx
()
const
;
void
RtxEncode
(
RtpPacket
*
packet
);
void
Reset
();
void
ClearRetransmissionBuffer
();
private
:
void
ClearBuffer
();
void
StorePacket
(
RTC
::
RtpPacket
*
packet
);
/* Pure virtual methods inherited from RtpStream. */
...
...
worker/src/RTC/Consumer.cpp
浏览文件 @
02b489cc
...
...
@@ -159,9 +159,7 @@ namespace RTC
MS_DEBUG_DEV
(
"Consumer paused [consumerId:%"
PRIu32
"]"
,
this
->
consumerId
);
if
(
IsEnabled
()
&&
!
this
->
sourcePaused
)
{
this
->
rtpStream
->
Reset
();
}
this
->
rtpStream
->
ClearRetransmissionBuffer
();
}
void
Consumer
::
Resume
()
...
...
@@ -195,9 +193,7 @@ namespace RTC
this
->
notifier
->
Emit
(
this
->
consumerId
,
"sourcepaused"
);
if
(
IsEnabled
()
&&
!
this
->
paused
)
{
this
->
rtpStream
->
Reset
();
}
this
->
rtpStream
->
ClearRetransmissionBuffer
();
}
void
Consumer
::
SourceResume
()
...
...
@@ -214,9 +210,7 @@ namespace RTC
this
->
notifier
->
Emit
(
this
->
consumerId
,
"sourceresumed"
);
if
(
IsEnabled
()
&&
!
this
->
paused
)
{
RequestFullFrame
();
}
}
void
Consumer
::
SourceRtpParametersUpdated
()
...
...
@@ -227,6 +221,28 @@ namespace RTC
return
;
this
->
syncRequired
=
true
;
this
->
rtpStream
->
ClearRetransmissionBuffer
();
}
void
Consumer
::
SetPreferredProfile
(
const
RTC
::
RtpEncodingParameters
::
Profile
profile
)
{
MS_TRACE
();
if
(
this
->
preferredProfile
==
profile
)
return
;
this
->
preferredProfile
=
profile
;
// TODO: Set it dynamically.
this
->
effectiveProfile
=
profile
;
if
(
IsEnabled
()
&&
!
IsPaused
())
{
this
->
syncRequired
=
true
;
this
->
rtpStream
->
ClearRetransmissionBuffer
();
RequestFullFrame
();
}
}
/**
...
...
@@ -284,6 +300,17 @@ namespace RTC
// Check whether sequence number and timestamp sync is required.
if
(
this
->
syncRequired
)
{
// TODO
MS_ERROR
(
"------------ syncRequired IS TRUE !!!!!"
);
// TODO
MS_ERROR
(
"--- [profile:%s, effectiveProfile:%s, ssrc:%"
PRIu32
", packet->seq:%"
PRIu16
"]"
,
RTC
::
RtpEncodingParameters
::
profile2String
[
profile
].
c_str
(),
RTC
::
RtpEncodingParameters
::
profile2String
[
this
->
effectiveProfile
].
c_str
(),
packet
->
GetSsrc
(),
packet
->
GetSequenceNumber
());
this
->
seqNum
+=
1
;
auto
now
=
static_cast
<
uint32_t
>
(
DepLibUV
::
GetTime
());
...
...
@@ -326,6 +353,17 @@ namespace RTC
// Update transmitted RTP data counter.
this
->
transmittedCounter
.
Update
(
packet
);
}
else
{
// TODO
MS_ERROR
(
"--- rtpStream->ReceivePacket() failed [profile:%s, effectiveProfile:%s, ssrc:%"
PRIu32
", packet->seq:%"
PRIu16
"]"
,
RTC
::
RtpEncodingParameters
::
profile2String
[
profile
].
c_str
(),
RTC
::
RtpEncodingParameters
::
profile2String
[
this
->
effectiveProfile
].
c_str
(),
ssrc
,
this
->
lastRecvSeqNum
);
}
// Restore packet SSRC.
packet
->
SetSsrc
(
ssrc
);
...
...
@@ -494,8 +532,8 @@ namespace RTC
MS_DEBUG_TAG
(
rtx
,
"sending rtx packet [ssrc: %"
PRIu32
"
seqnr
: %"
PRIu16
"] recovering original [ssrc: %"
PRIu32
"
seqnr
: %"
PRIu16
"]"
,
"sending rtx packet [ssrc: %"
PRIu32
"
, seq
: %"
PRIu16
"] recovering original [ssrc: %"
PRIu32
"
, seq
: %"
PRIu16
"]"
,
rtxPacket
->
GetSsrc
(),
rtxPacket
->
GetSequenceNumber
(),
packet
->
GetSsrc
(),
...
...
@@ -506,7 +544,7 @@ namespace RTC
rtxPacket
=
packet
;
MS_DEBUG_TAG
(
rtx
,
"retransmitting packet [ssrc: %"
PRIu32
"
seqnr
: %"
PRIu16
"]"
,
"retransmitting packet [ssrc: %"
PRIu32
"
, seq
: %"
PRIu16
"]"
,
rtxPacket
->
GetSsrc
(),
rtxPacket
->
GetSequenceNumber
());
}
...
...
worker/src/RTC/RtpPacket.cpp
浏览文件 @
02b489cc
...
...
@@ -364,6 +364,9 @@ namespace RTC
auto
packet
=
new
RtpPacket
(
header
,
extensionHeader
,
payload
,
this
->
payloadLength
,
this
->
payloadPadding
,
this
->
size
);
// Clone seq32.
packet
->
seq32
=
this
->
seq32
;
// Parse RFC 5285 extension header.
packet
->
ParseExtensions
();
...
...
worker/src/RTC/RtpStreamSend.cpp
浏览文件 @
02b489cc
...
...
@@ -28,7 +28,7 @@ namespace RTC
MS_TRACE
();
// Clear the RTP buffer.
ClearBuffer
();
Clear
Retransmission
Buffer
();
}
Json
::
Value
RtpStreamSend
::
ToJson
()
const
...
...
@@ -137,6 +137,7 @@ namespace RTC
auto
bufferItReverse
=
this
->
buffer
.
rbegin
();
uint32_t
bufferFirstSeq32
=
(
*
bufferIt
).
seq32
;
uint32_t
bufferLastSeq32
=
(
*
bufferItReverse
).
seq32
;
bool
inRange
=
true
;
// Requested packet range not found.
if
(
firstSeq32
>
bufferLastSeq32
||
lastSeq32
<
bufferFirstSeq32
)
...
...
@@ -150,20 +151,32 @@ namespace RTC
// Try again.
if
(
firstSeq32
>
bufferLastSeq32
||
lastSeq32
<
bufferFirstSeq32
)
{
MS_WARN_TAG
(
rtx
,
"requested packet range not in the buffer"
)
;
return
;
firstSeq32
+=
RtpSeqMod
;
lastSeq32
+=
RtpSeqMod
;
inRange
=
false
;
}
}
// Otherwise just return.
else
{
MS_WARN_TAG
(
rtx
,
"requested packet range not in the buffer"
);
return
;
inRange
=
false
;
}
}
if
(
!
inRange
)
{
MS_WARN_TAG
(
rtx
,
"requested packet range not in the buffer [seq:%"
PRIu16
", seq32:%"
PRIu32
", bufferFirstSeq32:%"
PRIu32
", bufferLastSeq32:%"
PRIu32
"]"
,
seq
,
firstSeq32
,
bufferFirstSeq32
,
bufferLastSeq32
);
return
;
}
// Look for each requested packet.
uint64_t
now
=
DepLibUV
::
GetTime
();
uint32_t
rtt
=
(
this
->
rtt
!=
0u
?
this
->
rtt
:
DefaultRtt
);
...
...
@@ -316,24 +329,7 @@ namespace RTC
return
report
;
}
void
RtpStreamSend
::
Reset
()
{
MS_TRACE
();
// By setting started to 0, on next packet the RtpStream will call
// InitSeq(seq).
this
->
started
=
false
;
// Also reset RtpStreamSend own members.
this
->
receivedBytes
=
0
;
this
->
lastPacketTimeMs
=
0
;
this
->
lastPacketRtpTimestamp
=
0
;
// Clear the buffer.
ClearBuffer
();
}
void
RtpStreamSend
::
ClearBuffer
()
void
RtpStreamSend
::
ClearRetransmissionBuffer
()
{
MS_TRACE
();
...
...
@@ -444,7 +440,7 @@ namespace RTC
MS_TRACE
();
// Clear the RTP buffer.
ClearBuffer
();
Clear
Retransmission
Buffer
();
}
void
RtpStreamSend
::
SetRtx
(
uint8_t
payloadType
,
uint32_t
ssrc
)
...
...
worker/src/RTC/Transport.cpp
浏览文件 @
02b489cc
...
...
@@ -772,7 +772,7 @@ namespace RTC
{
MS_WARN_TAG
(
rtcp
,
"no Consumer found for received
NACK
Feedback packet "
"no Consumer found for received Feedback packet "
"[sender ssrc:%"
PRIu32
", media ssrc:%"
PRIu32
"]"
,
feedback
->
GetMediaSsrc
(),
feedback
->
GetMediaSsrc
());
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论