Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
M
mediasoup
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
聂卓夫
mediasoup
Commits
b9f7a216
提交
b9f7a216
authored
5月 03, 2019
作者:
Iñaki Baz Castillo
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
RtpStreamSend: Testing new buffer design
上级
14dad1a1
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
190 行增加
和
158 行删除
+190
-158
RtpStreamSend.hpp
worker/include/RTC/RtpStreamSend.hpp
+15
-3
RtpStreamSend.cpp
worker/src/RTC/RtpStreamSend.cpp
+171
-153
TestRtpStreamSend.cpp
worker/test/src/RTC/TestRtpStreamSend.cpp
+4
-2
没有找到文件。
worker/include/RTC/RtpStreamSend.hpp
浏览文件 @
b9f7a216
...
@@ -4,7 +4,6 @@
...
@@ -4,7 +4,6 @@
#include "Utils.hpp"
#include "Utils.hpp"
#include "RTC/RtpDataCounter.hpp"
#include "RTC/RtpDataCounter.hpp"
#include "RTC/RtpStream.hpp"
#include "RTC/RtpStream.hpp"
#include <list>
#include <vector>
#include <vector>
namespace
RTC
namespace
RTC
...
@@ -22,7 +21,6 @@ namespace RTC
...
@@ -22,7 +21,6 @@ namespace RTC
public
:
public
:
struct
BufferItem
struct
BufferItem
{
{
uint16_t
seq
{
0
};
// RTP seq.
RTC
::
RtpPacket
*
packet
{
nullptr
};
RTC
::
RtpPacket
*
packet
{
nullptr
};
uint64_t
resentAtTime
{
0
};
// Last time this packet was resent.
uint64_t
resentAtTime
{
0
};
// Last time this packet was resent.
uint8_t
sentTimes
{
0
};
// Number of times this packet was resent.
uint8_t
sentTimes
{
0
};
// Number of times this packet was resent.
...
@@ -57,6 +55,8 @@ namespace RTC
...
@@ -57,6 +55,8 @@ namespace RTC
private
:
private
:
void
StorePacket
(
RTC
::
RtpPacket
*
packet
);
void
StorePacket
(
RTC
::
RtpPacket
*
packet
);
void
ResetBufferItem
(
BufferItem
&
bufferItem
);
void
UpdateBufferStartIdx
();
void
ClearRetransmissionBuffer
();
void
ClearRetransmissionBuffer
();
void
FillRetransmissionContainer
(
uint16_t
seq
,
uint16_t
bitmask
);
void
FillRetransmissionContainer
(
uint16_t
seq
,
uint16_t
bitmask
);
void
UpdateScore
(
RTC
::
RTCP
::
ReceiverReport
*
report
);
void
UpdateScore
(
RTC
::
RTCP
::
ReceiverReport
*
report
);
...
@@ -64,8 +64,10 @@ namespace RTC
...
@@ -64,8 +64,10 @@ namespace RTC
private
:
private
:
uint32_t
lostPrior
{
0
};
// Packets lost at last interval.
uint32_t
lostPrior
{
0
};
// Packets lost at last interval.
uint32_t
sentPrior
{
0
};
// Packets sent at last interval.
uint32_t
sentPrior
{
0
};
// Packets sent at last interval.
std
::
vector
<
BufferItem
>
buffer
;
uint16_t
bufferStartIdx
{
0
};
size_t
bufferSize
{
0
};
std
::
vector
<
StorageItem
>
storage
;
std
::
vector
<
StorageItem
>
storage
;
std
::
list
<
BufferItem
>
buffer
;
float
rtt
{
0
};
float
rtt
{
0
};
uint16_t
rtxSeq
{
0
};
uint16_t
rtxSeq
{
0
};
RTC
::
RtpDataCounter
transmissionCounter
;
RTC
::
RtpDataCounter
transmissionCounter
;
...
@@ -84,6 +86,16 @@ namespace RTC
...
@@ -84,6 +86,16 @@ namespace RTC
{
{
return
this
->
transmissionCounter
.
GetBitrate
(
now
);
return
this
->
transmissionCounter
.
GetBitrate
(
now
);
}
}
inline
void
RtpStreamSend
::
ResetBufferItem
(
BufferItem
&
bufferItem
)
{
delete
bufferItem
.
packet
;
bufferItem
.
packet
=
nullptr
;
bufferItem
.
resentAtTime
=
0
;
bufferItem
.
sentTimes
=
0
;
bufferItem
.
rtxEncoded
=
false
;
}
}
// namespace RTC
}
// namespace RTC
#endif
#endif
worker/src/RTC/RtpStreamSend.cpp
浏览文件 @
b9f7a216
...
@@ -22,7 +22,7 @@ namespace RTC
...
@@ -22,7 +22,7 @@ namespace RTC
RtpStreamSend
::
RtpStreamSend
(
RtpStreamSend
::
RtpStreamSend
(
RTC
::
RtpStreamSend
::
Listener
*
listener
,
RTC
::
RtpStream
::
Params
&
params
,
size_t
bufferSize
)
RTC
::
RtpStreamSend
::
Listener
*
listener
,
RTC
::
RtpStream
::
Params
&
params
,
size_t
bufferSize
)
:
RTC
::
RtpStream
::
RtpStream
(
listener
,
params
,
10
),
storage
(
bufferSize
)
:
RTC
::
RtpStream
::
RtpStream
(
listener
,
params
,
10
),
buffer
(
bufferSize
>
0
?
65536
:
0
),
storage
(
bufferSize
)
{
{
MS_TRACE
();
MS_TRACE
();
}
}
...
@@ -79,6 +79,8 @@ namespace RTC
...
@@ -79,6 +79,8 @@ namespace RTC
{
{
MS_TRACE
();
MS_TRACE
();
MS_ERROR
(
"--begin--"
);
this
->
nackCount
++
;
this
->
nackCount
++
;
for
(
auto
it
=
nackPacket
->
Begin
();
it
!=
nackPacket
->
End
();
++
it
)
for
(
auto
it
=
nackPacket
->
Begin
();
it
!=
nackPacket
->
End
();
++
it
)
...
@@ -91,6 +93,8 @@ namespace RTC
...
@@ -91,6 +93,8 @@ namespace RTC
for
(
auto
*
bufferItem
:
RetransmissionContainer
)
for
(
auto
*
bufferItem
:
RetransmissionContainer
)
{
{
MS_ERROR
(
"-- . --"
);
if
(
bufferItem
==
nullptr
)
if
(
bufferItem
==
nullptr
)
break
;
break
;
...
@@ -98,6 +102,8 @@ namespace RTC
...
@@ -98,6 +102,8 @@ namespace RTC
// (FillRetransmissionContainer() did it).
// (FillRetransmissionContainer() did it).
auto
*
packet
=
bufferItem
->
packet
;
auto
*
packet
=
bufferItem
->
packet
;
MS_ERROR
(
"----- RETRANSMITTING PACKET seq:%"
PRIu16
,
packet
->
GetSequenceNumber
());
// Retransmit the packet.
// Retransmit the packet.
static_cast
<
RTC
::
RtpStreamSend
::
Listener
*>
(
this
->
listener
)
static_cast
<
RTC
::
RtpStreamSend
::
Listener
*>
(
this
->
listener
)
->
OnRtpStreamRetransmitRtpPacket
(
this
,
packet
);
->
OnRtpStreamRetransmitRtpPacket
(
this
,
packet
);
...
@@ -110,6 +116,8 @@ namespace RTC
...
@@ -110,6 +116,8 @@ namespace RTC
RTC
::
RtpStream
::
PacketRepaired
(
packet
);
RTC
::
RtpStream
::
PacketRepaired
(
packet
);
}
}
}
}
MS_ERROR
(
"--end--"
);
}
}
void
RtpStreamSend
::
ReceiveKeyFrameRequest
(
RTC
::
RTCP
::
FeedbackPs
::
MessageType
messageType
)
void
RtpStreamSend
::
ReceiveKeyFrameRequest
(
RTC
::
RTCP
::
FeedbackPs
::
MessageType
messageType
)
...
@@ -224,24 +232,54 @@ namespace RTC
...
@@ -224,24 +232,54 @@ namespace RTC
MS_ABORT
(
"Invalid method call"
);
MS_ABORT
(
"Invalid method call"
);
}
}
/**
* Iterates the buffer starting from the current start idx + 1 until it finds
* a buffer item with a packet. It takes into account that the buffer is circular.
*/
inline
void
RtpStreamSend
::
UpdateBufferStartIdx
()
{
MS_ERROR
(
"------- start ------"
);
uint16_t
seq
=
this
->
bufferStartIdx
+
1
;
for
(
uint32_t
idx
{
0
};
idx
<
65536
;
++
idx
,
++
seq
)
{
auto
&
bufferItem
=
this
->
buffer
[
seq
];
if
(
bufferItem
.
packet
)
{
MS_ERROR
(
"new bufferStartIdx: %"
PRIu16
,
seq
);
this
->
bufferStartIdx
=
seq
;
break
;
}
}
MS_ERROR
(
"------- end ------"
);
}
void
RtpStreamSend
::
ClearRetransmissionBuffer
()
void
RtpStreamSend
::
ClearRetransmissionBuffer
()
{
{
MS_TRACE
();
MS_TRACE
();
// Delete cloned packets.
// Delete cloned packets
and creat buffer items
.
for
(
auto
&
bufferItem
:
this
->
buffer
)
for
(
auto
&
bufferItem
:
this
->
buffer
)
{
{
delete
bufferItem
.
packet
;
ResetBufferItem
(
bufferItem
)
;
}
}
// Clear list.
// Reset buffer.
this
->
buffer
.
clear
();
this
->
bufferStartIdx
=
0
;
this
->
bufferSize
=
0
;
}
}
void
RtpStreamSend
::
StorePacket
(
RTC
::
RtpPacket
*
packet
)
void
RtpStreamSend
::
StorePacket
(
RTC
::
RtpPacket
*
packet
)
{
{
MS_TRACE
();
MS_TRACE
();
MS_ERROR
(
"--begin-- seq:%"
PRIu16
,
packet
->
GetSequenceNumber
());
if
(
packet
->
GetSize
()
>
RTC
::
MtuSize
)
if
(
packet
->
GetSize
()
>
RTC
::
MtuSize
)
{
{
MS_WARN_TAG
(
MS_WARN_TAG
(
...
@@ -254,75 +292,80 @@ namespace RTC
...
@@ -254,75 +292,80 @@ namespace RTC
return
;
return
;
}
}
// Sum the packet seq number and the number of 16 bits cycles.
auto
packetSeq
=
packet
->
GetSequenceNumber
();
auto
packetSeq
=
packet
->
GetSequenceNumber
();
auto
&
bufferItem
=
this
->
buffer
[
packetSeq
];
BufferItem
bufferItem
;
uint8_t
*
store
{
nullptr
};
bufferItem
.
seq
=
packetSeq
;
//
If empty do it eas
y.
//
Buffer is empt
y.
if
(
this
->
buffer
.
empty
()
)
if
(
this
->
buffer
Size
==
0
)
{
{
auto
store
=
this
->
storage
[
0
].
store
;
MS_ERROR
(
"--1-- seq:%"
PRIu16
", buffer empty, first item"
,
packet
->
GetSequenceNumber
())
;
bufferItem
.
packet
=
packet
->
Clone
(
store
);
// Take the first storage position.
this
->
buffer
.
push_back
(
bufferItem
)
;
store
=
this
->
storage
[
0
].
store
;
return
;
this
->
bufferSize
++
;
this
->
bufferStartIdx
=
packetSeq
;
}
}
// The buffer item is already used. Check whether we should replace it with
// Otherwise, do the stuff.
// the new packet or just ignore it (if duplicated packet).
std
::
list
<
BufferItem
>::
iterator
newBufferIt
;
else
if
(
bufferItem
.
packet
)
uint8_t
*
store
{
nullptr
};
// Iterate the buffer in reverse order and find the proper place to store the
// packet.
auto
bufferItReverse
=
this
->
buffer
.
rbegin
();
for
(;
bufferItReverse
!=
this
->
buffer
.
rend
();
++
bufferItReverse
)
{
{
auto
currentSeq
=
(
*
bufferItReverse
).
seq
;
MS_ERROR
(
"--2-- seq:%"
PRIu16
", bufferItem used"
,
packet
->
GetSequenceNumber
())
;
if
(
RTC
::
SeqManager
<
uint16_t
>::
IsSeqHigherThan
(
packetSeq
,
currentSeq
))
if
(
packet
->
GetTimestamp
()
==
bufferItem
.
packet
->
GetTimestamp
(
))
{
{
// Get a forward iterator pointing to the same element.
MS_ERROR
(
"--2.1-- seq:%"
PRIu16
", duplicated packet, ignore"
,
packet
->
GetSequenceNumber
());
auto
it
=
bufferItReverse
.
base
();
newBufferIt
=
this
->
buffer
.
insert
(
it
,
bufferItem
);
return
;
break
;
}
}
// Packet is already stored.
MS_ERROR
(
"--2.2-- seq:%"
PRIu16
", replacing stored packet"
,
packet
->
GetSequenceNumber
());
if
(
packetSeq
==
currentSeq
)
return
;
// Reuse the store used by the buffer item.
}
store
=
const_cast
<
uint8_t
*>
(
bufferItem
.
packet
->
GetData
());
// The packet was older than anything in the buffer, store it at the beginning.
// Reset the item.
if
(
bufferItReverse
==
this
->
buffer
.
rend
())
ResetBufferItem
(
bufferItem
);
newBufferIt
=
this
->
buffer
.
insert
(
this
->
buffer
.
begin
(),
bufferItem
);
// If the buffer is not full use the next free storage item.
// If this was the item referenced by the buffer start index, move it to
if
(
this
->
buffer
.
size
()
-
1
<
this
->
storage
.
size
())
// the next one.
if
(
this
->
bufferStartIdx
==
packetSeq
)
UpdateBufferStartIdx
();
}
// Buffer not yet full, add an entry.
else
if
(
this
->
bufferSize
<
this
->
storage
.
size
()
-
1
)
{
{
store
=
this
->
storage
[
this
->
buffer
.
size
()
-
1
].
store
;
MS_ERROR
(
"--3-- seq:%"
PRIu16
", buffer not full yet"
,
packet
->
GetSequenceNumber
());
// Take the next storage position.
store
=
this
->
storage
[
this
->
bufferSize
].
store
;
this
->
bufferSize
++
;
}
}
//
Otherwise remove the first packet of the buffer and replace its storage area
.
//
Buffer full, remove oldest entry and add new one
.
else
else
{
{
auto
&
firstBufferItem
=
*
(
this
->
buffer
.
begin
());
MS_ERROR
(
"--4-- seq:%"
PRIu16
", buffer full, removing oldest entry"
,
packet
->
GetSequenceNumber
());
auto
*
firstPacket
=
firstBufferItem
.
packet
;
auto
&
firstBufferItem
=
this
->
buffer
[
this
->
bufferStartIdx
];
// Store points to the store used by the first packet.
store
=
const_cast
<
uint8_t
*>
(
firstPacket
->
GetData
());
// Reuse the store used by the first buffer item.
// Free the first packet.
store
=
const_cast
<
uint8_t
*>
(
firstBufferItem
.
packet
->
GetData
());
delete
firstPacket
;
// Remove the first element in the list.
// Move the buffer start index.
this
->
buffer
.
pop_front
();
UpdateBufferStartIdx
();
// Reset the first item.
ResetBufferItem
(
firstBufferItem
);
}
}
// Close the packet into the calculated store and reference it in the
// corresponding buffer item.
// Update the new buffer item so it points to the cloned packed.
// Update the new buffer item so it points to the cloned packed.
(
*
newBufferIt
).
packet
=
packet
->
Clone
(
store
);
bufferItem
.
packet
=
packet
->
Clone
(
store
);
MS_ERROR
(
"--end-- seq:%"
PRIu16
,
packet
->
GetSequenceNumber
());
}
}
// This method looks for the requested RTP packets and inserts them into the
// This method looks for the requested RTP packets and inserts them into the
...
@@ -334,6 +377,8 @@ namespace RTC
...
@@ -334,6 +377,8 @@ namespace RTC
{
{
MS_TRACE
();
MS_TRACE
();
MS_ERROR
(
"--begin-- seq:%"
PRIu16
,
seq
);
// Ensure the container's first element is 0.
// Ensure the container's first element is 0.
RetransmissionContainer
[
0
]
=
nullptr
;
RetransmissionContainer
[
0
]
=
nullptr
;
...
@@ -345,33 +390,6 @@ namespace RTC
...
@@ -345,33 +390,6 @@ namespace RTC
return
;
return
;
}
}
// If the buffer is empty just return.
if
(
this
->
buffer
.
empty
())
return
;
uint16_t
firstSeq
=
seq
;
uint16_t
lastSeq
=
firstSeq
+
MaxRequestedPackets
-
1
;
auto
bufferIt
=
this
->
buffer
.
begin
();
auto
bufferItReverse
=
this
->
buffer
.
rbegin
();
uint16_t
bufferFirstSeq
=
(
*
bufferIt
).
seq
;
uint16_t
bufferLastSeq
=
(
*
bufferItReverse
).
seq
;
// Requested packet range not found.
if
(
RTC
::
SeqManager
<
uint16_t
>::
IsSeqHigherThan
(
firstSeq
,
bufferLastSeq
)
||
RTC
::
SeqManager
<
uint16_t
>::
IsSeqLowerThan
(
lastSeq
,
bufferFirstSeq
))
{
MS_WARN_TAG
(
rtx
,
"requested packet range not in the buffer [seq:%"
PRIu16
", bufferFirstseq:%"
PRIu16
", bufferLastseq:%"
PRIu16
"]"
,
seq
,
bufferFirstSeq
,
bufferLastSeq
);
return
;
}
// Look for each requested packet.
// Look for each requested packet.
uint64_t
now
=
DepLibUV
::
GetTime
();
uint64_t
now
=
DepLibUV
::
GetTime
();
uint16_t
rtt
=
(
this
->
rtt
!=
0u
?
this
->
rtt
:
DefaultRtt
);
uint16_t
rtt
=
(
this
->
rtt
!=
0u
?
this
->
rtt
:
DefaultRtt
);
...
@@ -392,83 +410,81 @@ namespace RTC
...
@@ -392,83 +410,81 @@ namespace RTC
if
(
requested
)
if
(
requested
)
{
{
for
(;
bufferIt
!=
this
->
buffer
.
end
();
++
bufferIt
)
auto
&
bufferItem
=
this
->
buffer
[
seq
];
auto
*
packet
=
bufferItem
.
packet
;
uint32_t
diffTs
;
uint32_t
diffMs
;
// Calculate how the elapsed time between the max timestampt seen and
// the requested packet's timestampt (in ms).
if
(
packet
)
{
{
auto
currentSeq
=
(
*
bufferIt
).
seq
;
diffTs
=
this
->
maxPacketTs
-
packet
->
GetTimestamp
();
diffMs
=
diffTs
*
1000
/
this
->
params
.
clockRate
;
}
// Found.
// Packet not found.
if
(
currentSeq
==
seq
)
if
(
!
packet
)
{
// Do nothing.
}
// Don't resend the packet if older than MaxRetransmissionDelay ms.
else
if
(
diffMs
>
MaxRetransmissionDelay
)
{
if
(
!
tooOldPacketFound
)
{
MS_WARN_TAG
(
rtx
,
"ignoring retransmission for too old packet "
"[seq:%"
PRIu16
", max age:%"
PRIu32
"ms, packet age:%"
PRIu32
"ms]"
,
packet
->
GetSequenceNumber
(),
MaxRetransmissionDelay
,
diffMs
);
tooOldPacketFound
=
true
;
}
}
// Don't resent the packet if it was resent in the last RTT ms.
// clang-format off
else
if
(
(
bufferItem
.
resentAtTime
!=
0u
)
&&
now
-
bufferItem
.
resentAtTime
<=
static_cast
<
uint64_t
>
(
rtt
)
)
// clang-format on
{
MS_DEBUG_TAG
(
rtx
,
"ignoring retransmission for a packet already resent in the last RTT ms "
"[seq:%"
PRIu16
", rtt:%"
PRIu32
"]"
,
packet
->
GetSequenceNumber
(),
rtt
);
}
// Yes, resend it.
else
{
// If we use RTX and the packet has not yet been resent, encode it
// now.
if
(
HasRtx
()
&&
!
bufferItem
.
rtxEncoded
)
{
{
auto
*
currentPacket
=
(
*
bufferIt
).
packet
;
packet
->
RtxEncode
(
// Calculate how the elapsed time between the max timestampt seen and
this
->
params
.
rtxPayloadType
,
this
->
params
.
rtxSsrc
,
++
this
->
rtxSeq
);
// the requested packet's timestampt (in ms).
uint32_t
diffTs
=
this
->
maxPacketTs
-
currentPacket
->
GetTimestamp
();
bufferItem
.
rtxEncoded
=
true
;
uint32_t
diffMs
=
diffTs
*
1000
/
this
->
params
.
clockRate
;
// Just provide the packet if no older than MaxRetransmissionDelay ms.
if
(
diffMs
>
MaxRetransmissionDelay
)
{
if
(
!
tooOldPacketFound
)
{
MS_WARN_TAG
(
rtx
,
"ignoring retransmission for too old packet "
"[seq:%"
PRIu16
", max age:%"
PRIu32
"ms, packet age:%"
PRIu32
"ms]"
,
currentPacket
->
GetSequenceNumber
(),
MaxRetransmissionDelay
,
diffMs
);
tooOldPacketFound
=
true
;
}
break
;
}
// Don't resent the packet if it was resent in the last RTT ms.
auto
resentAtTime
=
(
*
bufferIt
).
resentAtTime
;
if
((
resentAtTime
!=
0u
)
&&
now
-
resentAtTime
<=
static_cast
<
uint64_t
>
(
rtt
))
{
MS_DEBUG_TAG
(
rtx
,
"ignoring retransmission for a packet already resent in the last RTT ms "
"[seq:%"
PRIu16
", rtt:%"
PRIu32
"]"
,
currentPacket
->
GetSequenceNumber
(),
rtt
);
break
;
}
// If we use RTX and the packet has not yet been resent, encode it
// now.
if
(
HasRtx
()
&&
!
(
*
bufferIt
).
rtxEncoded
)
{
currentPacket
->
RtxEncode
(
this
->
params
.
rtxPayloadType
,
this
->
params
.
rtxSsrc
,
++
this
->
rtxSeq
);
(
*
bufferIt
).
rtxEncoded
=
true
;
}
// Store the buffer item in the container and then increment its index.
RetransmissionContainer
[
containerIdx
++
]
=
std
::
addressof
(
*
bufferIt
);
// Save when this packet was resent.
(
*
bufferIt
).
resentAtTime
=
now
;
// Increase the number of times this packet was sent.
(
*
bufferIt
).
sentTimes
++
;
sent
=
true
;
if
(
isFirstPacket
)
firstPacketSent
=
true
;
break
;
}
}
// It can not be after this packet.
// Store the buffer item in the container and then increment its index.
if
(
RTC
::
SeqManager
<
uint16_t
>::
IsSeqHigherThan
(
currentSeq
,
seq
))
RetransmissionContainer
[
containerIdx
++
]
=
std
::
addressof
(
bufferItem
);
break
;
// Save when this packet was resent.
bufferItem
.
resentAtTime
=
now
;
// Increase the number of times this packet was sent.
bufferItem
.
sentTimes
++
;
sent
=
true
;
if
(
isFirstPacket
)
firstPacketSent
=
true
;
}
}
}
}
...
@@ -511,6 +527,8 @@ namespace RTC
...
@@ -511,6 +527,8 @@ namespace RTC
// Set the next container element to null.
// Set the next container element to null.
RetransmissionContainer
[
containerIdx
]
=
nullptr
;
RetransmissionContainer
[
containerIdx
]
=
nullptr
;
MS_ERROR
(
"--end-- seq:%"
PRIu16
,
seq
);
}
}
void
RtpStreamSend
::
UpdateScore
(
RTC
::
RTCP
::
ReceiverReport
*
report
)
void
RtpStreamSend
::
UpdateScore
(
RTC
::
RTCP
::
ReceiverReport
*
report
)
...
...
worker/test/src/RTC/TestRtpStreamSend.cpp
浏览文件 @
b9f7a216
...
@@ -94,13 +94,15 @@ SCENARIO("NACK and RTP packets retransmission", "[rtp][rtcp]")
...
@@ -94,13 +94,15 @@ SCENARIO("NACK and RTP packets retransmission", "[rtp][rtcp]")
params
.
useNack
=
true
;
params
.
useNack
=
true
;
// Create a RtpStreamSend.
// Create a RtpStreamSend.
RtpStreamSend
*
stream
=
new
RtpStreamSend
(
&
testRtpStreamListener
,
params
,
200
);
RtpStreamSend
*
stream
=
new
RtpStreamSend
(
&
testRtpStreamListener
,
params
,
3
);
// Receive all the packets
in order into the stream
.
// Receive all the packets
(some of them not in order and/or duplicated)
.
stream
->
ReceivePacket
(
packet1
);
stream
->
ReceivePacket
(
packet1
);
stream
->
ReceivePacket
(
packet3
);
stream
->
ReceivePacket
(
packet2
);
stream
->
ReceivePacket
(
packet2
);
stream
->
ReceivePacket
(
packet3
);
stream
->
ReceivePacket
(
packet3
);
stream
->
ReceivePacket
(
packet4
);
stream
->
ReceivePacket
(
packet4
);
stream
->
ReceivePacket
(
packet4
);
stream
->
ReceivePacket
(
packet5
);
stream
->
ReceivePacket
(
packet5
);
// Create a NACK item that request for all the packets.
// Create a NACK item that request for all the packets.
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论