Post stats updates in RtpSenderEgress to the worker.

On the way remove need for lock for
rtp_sequence_number_map_ and timestamp_offset_.

Change-Id: I21a5cbf6208620435a1a16fff68c33c0cb84f51d
Bug: webrtc:11581
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/177424
Commit-Queue: Tommi <tommi@webrtc.org>
Reviewed-by: Magnus Flodman <mflodman@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31581}
This commit is contained in:
Tomas Gunnarsson
2020-06-29 13:56:15 +02:00
committed by Commit Bot
parent 6fb7004f33
commit 096c0b0921
7 changed files with 148 additions and 93 deletions

View File

@ -26,6 +26,7 @@
#include "test/gtest.h"
#include "test/rtcp_packet_parser.h"
#include "test/rtp_header_parser.h"
#include "test/run_loop.h"
using ::testing::ElementsAre;
@ -198,6 +199,7 @@ class RtpRtcpImpl2Test : public ::testing::Test {
receiver_.transport_.SetRtpRtcpModule(sender_.impl_.get());
}
test::RunLoop loop_;
SimulatedClock clock_;
RtpRtcpModule sender_;
std::unique_ptr<RTPSenderVideo> sender_video_;
@ -586,6 +588,7 @@ TEST_F(RtpRtcpImpl2Test, StoresPacketInfoForSentPackets) {
packet.set_first_packet_of_frame(true);
packet.SetMarker(true);
sender_.impl_->TrySendPacket(&packet, pacing_info);
loop_.Flush();
std::vector<RtpSequenceNumberMap::Info> seqno_info =
sender_.impl_->GetSentRtpPacketInfos(std::vector<uint16_t>{1});
@ -610,6 +613,8 @@ TEST_F(RtpRtcpImpl2Test, StoresPacketInfoForSentPackets) {
packet.SetMarker(true);
sender_.impl_->TrySendPacket(&packet, pacing_info);
loop_.Flush();
seqno_info =
sender_.impl_->GetSentRtpPacketInfos(std::vector<uint16_t>{2, 3, 4});