Remove unnecessary copy of suspended_ssrcs.
Also removing pass-by-value in ctor. Bug: none Change-Id: I09e36fd955c8f306c4a347d8befc6eea38384cb9 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/239183 Auto-Submit: Tommi <tommi@webrtc.org> Reviewed-by: Niels Moller <nisse@webrtc.org> Commit-Queue: Tommi <tommi@webrtc.org> Cr-Commit-Position: refs/heads/main@{#35427}
This commit is contained in:
@ -156,7 +156,7 @@ RtpTransportControllerSend::~RtpTransportControllerSend() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
RtpVideoSenderInterface* RtpTransportControllerSend::CreateRtpVideoSender(
|
RtpVideoSenderInterface* RtpTransportControllerSend::CreateRtpVideoSender(
|
||||||
std::map<uint32_t, RtpState> suspended_ssrcs,
|
const std::map<uint32_t, RtpState>& suspended_ssrcs,
|
||||||
const std::map<uint32_t, RtpPayloadState>& states,
|
const std::map<uint32_t, RtpPayloadState>& states,
|
||||||
const RtpConfig& rtp_config,
|
const RtpConfig& rtp_config,
|
||||||
int rtcp_report_interval_ms,
|
int rtcp_report_interval_ms,
|
||||||
|
@ -65,7 +65,7 @@ class RtpTransportControllerSend final
|
|||||||
|
|
||||||
// TODO(tommi): Change to std::unique_ptr<>.
|
// TODO(tommi): Change to std::unique_ptr<>.
|
||||||
RtpVideoSenderInterface* CreateRtpVideoSender(
|
RtpVideoSenderInterface* CreateRtpVideoSender(
|
||||||
std::map<uint32_t, RtpState> suspended_ssrcs,
|
const std::map<uint32_t, RtpState>& suspended_ssrcs,
|
||||||
const std::map<uint32_t, RtpPayloadState>&
|
const std::map<uint32_t, RtpPayloadState>&
|
||||||
states, // move states into RtpTransportControllerSend
|
states, // move states into RtpTransportControllerSend
|
||||||
const RtpConfig& rtp_config,
|
const RtpConfig& rtp_config,
|
||||||
|
@ -96,7 +96,7 @@ class RtpTransportControllerSendInterface {
|
|||||||
virtual PacketRouter* packet_router() = 0;
|
virtual PacketRouter* packet_router() = 0;
|
||||||
|
|
||||||
virtual RtpVideoSenderInterface* CreateRtpVideoSender(
|
virtual RtpVideoSenderInterface* CreateRtpVideoSender(
|
||||||
std::map<uint32_t, RtpState> suspended_ssrcs,
|
const std::map<uint32_t, RtpState>& suspended_ssrcs,
|
||||||
// TODO(holmer): Move states into RtpTransportControllerSend.
|
// TODO(holmer): Move states into RtpTransportControllerSend.
|
||||||
const std::map<uint32_t, RtpPayloadState>& states,
|
const std::map<uint32_t, RtpPayloadState>& states,
|
||||||
const RtpConfig& rtp_config,
|
const RtpConfig& rtp_config,
|
||||||
|
@ -347,7 +347,7 @@ bool IsFirstFrameOfACodedVideoSequence(
|
|||||||
|
|
||||||
RtpVideoSender::RtpVideoSender(
|
RtpVideoSender::RtpVideoSender(
|
||||||
Clock* clock,
|
Clock* clock,
|
||||||
std::map<uint32_t, RtpState> suspended_ssrcs,
|
const std::map<uint32_t, RtpState>& suspended_ssrcs,
|
||||||
const std::map<uint32_t, RtpPayloadState>& states,
|
const std::map<uint32_t, RtpPayloadState>& states,
|
||||||
const RtpConfig& rtp_config,
|
const RtpConfig& rtp_config,
|
||||||
int rtcp_report_interval_ms,
|
int rtcp_report_interval_ms,
|
||||||
@ -371,7 +371,6 @@ RtpVideoSender::RtpVideoSender(
|
|||||||
field_trials_.Lookup("WebRTC-GenericCodecDependencyDescriptor"),
|
field_trials_.Lookup("WebRTC-GenericCodecDependencyDescriptor"),
|
||||||
"Enabled")),
|
"Enabled")),
|
||||||
active_(false),
|
active_(false),
|
||||||
suspended_ssrcs_(std::move(suspended_ssrcs)),
|
|
||||||
fec_controller_(std::move(fec_controller)),
|
fec_controller_(std::move(fec_controller)),
|
||||||
fec_allowed_(true),
|
fec_allowed_(true),
|
||||||
rtp_streams_(CreateRtpStreamSenders(clock,
|
rtp_streams_(CreateRtpStreamSenders(clock,
|
||||||
@ -381,7 +380,7 @@ RtpVideoSender::RtpVideoSender(
|
|||||||
send_transport,
|
send_transport,
|
||||||
transport->GetBandwidthObserver(),
|
transport->GetBandwidthObserver(),
|
||||||
transport,
|
transport,
|
||||||
suspended_ssrcs_,
|
suspended_ssrcs,
|
||||||
event_log,
|
event_log,
|
||||||
retransmission_limiter,
|
retransmission_limiter,
|
||||||
frame_encryptor,
|
frame_encryptor,
|
||||||
@ -421,7 +420,7 @@ RtpVideoSender::RtpVideoSender(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ConfigureSsrcs();
|
ConfigureSsrcs(suspended_ssrcs);
|
||||||
ConfigureRids();
|
ConfigureRids();
|
||||||
|
|
||||||
if (!rtp_config_.mid.empty()) {
|
if (!rtp_config_.mid.empty()) {
|
||||||
@ -683,7 +682,8 @@ void RtpVideoSender::DeliverRtcp(const uint8_t* packet, size_t length) {
|
|||||||
stream.rtp_rtcp->IncomingRtcpPacket(packet, length);
|
stream.rtp_rtcp->IncomingRtcpPacket(packet, length);
|
||||||
}
|
}
|
||||||
|
|
||||||
void RtpVideoSender::ConfigureSsrcs() {
|
void RtpVideoSender::ConfigureSsrcs(
|
||||||
|
const std::map<uint32_t, RtpState>& suspended_ssrcs) {
|
||||||
// Configure regular SSRCs.
|
// Configure regular SSRCs.
|
||||||
RTC_CHECK(ssrc_to_rtp_module_.empty());
|
RTC_CHECK(ssrc_to_rtp_module_.empty());
|
||||||
for (size_t i = 0; i < rtp_config_.ssrcs.size(); ++i) {
|
for (size_t i = 0; i < rtp_config_.ssrcs.size(); ++i) {
|
||||||
@ -691,8 +691,8 @@ void RtpVideoSender::ConfigureSsrcs() {
|
|||||||
RtpRtcpInterface* const rtp_rtcp = rtp_streams_[i].rtp_rtcp.get();
|
RtpRtcpInterface* const rtp_rtcp = rtp_streams_[i].rtp_rtcp.get();
|
||||||
|
|
||||||
// Restore RTP state if previous existed.
|
// Restore RTP state if previous existed.
|
||||||
auto it = suspended_ssrcs_.find(ssrc);
|
auto it = suspended_ssrcs.find(ssrc);
|
||||||
if (it != suspended_ssrcs_.end())
|
if (it != suspended_ssrcs.end())
|
||||||
rtp_rtcp->SetRtpState(it->second);
|
rtp_rtcp->SetRtpState(it->second);
|
||||||
|
|
||||||
ssrc_to_rtp_module_[ssrc] = rtp_rtcp;
|
ssrc_to_rtp_module_[ssrc] = rtp_rtcp;
|
||||||
@ -706,8 +706,8 @@ void RtpVideoSender::ConfigureSsrcs() {
|
|||||||
for (size_t i = 0; i < rtp_config_.rtx.ssrcs.size(); ++i) {
|
for (size_t i = 0; i < rtp_config_.rtx.ssrcs.size(); ++i) {
|
||||||
uint32_t ssrc = rtp_config_.rtx.ssrcs[i];
|
uint32_t ssrc = rtp_config_.rtx.ssrcs[i];
|
||||||
RtpRtcpInterface* const rtp_rtcp = rtp_streams_[i].rtp_rtcp.get();
|
RtpRtcpInterface* const rtp_rtcp = rtp_streams_[i].rtp_rtcp.get();
|
||||||
auto it = suspended_ssrcs_.find(ssrc);
|
auto it = suspended_ssrcs.find(ssrc);
|
||||||
if (it != suspended_ssrcs_.end())
|
if (it != suspended_ssrcs.end())
|
||||||
rtp_rtcp->SetRtxState(it->second);
|
rtp_rtcp->SetRtxState(it->second);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -74,7 +74,7 @@ class RtpVideoSender : public RtpVideoSenderInterface,
|
|||||||
// Rtp modules are assumed to be sorted in simulcast index order.
|
// Rtp modules are assumed to be sorted in simulcast index order.
|
||||||
RtpVideoSender(
|
RtpVideoSender(
|
||||||
Clock* clock,
|
Clock* clock,
|
||||||
std::map<uint32_t, RtpState> suspended_ssrcs,
|
const std::map<uint32_t, RtpState>& suspended_ssrcs,
|
||||||
const std::map<uint32_t, RtpPayloadState>& states,
|
const std::map<uint32_t, RtpPayloadState>& states,
|
||||||
const RtpConfig& rtp_config,
|
const RtpConfig& rtp_config,
|
||||||
int rtcp_report_interval_ms,
|
int rtcp_report_interval_ms,
|
||||||
@ -155,7 +155,7 @@ class RtpVideoSender : public RtpVideoSenderInterface,
|
|||||||
RTC_EXCLUSIVE_LOCKS_REQUIRED(mutex_);
|
RTC_EXCLUSIVE_LOCKS_REQUIRED(mutex_);
|
||||||
void UpdateModuleSendingState() RTC_EXCLUSIVE_LOCKS_REQUIRED(mutex_);
|
void UpdateModuleSendingState() RTC_EXCLUSIVE_LOCKS_REQUIRED(mutex_);
|
||||||
void ConfigureProtection();
|
void ConfigureProtection();
|
||||||
void ConfigureSsrcs();
|
void ConfigureSsrcs(const std::map<uint32_t, RtpState>& suspended_ssrcs);
|
||||||
void ConfigureRids();
|
void ConfigureRids();
|
||||||
bool NackEnabled() const;
|
bool NackEnabled() const;
|
||||||
uint32_t GetPacketizationOverheadRate() const;
|
uint32_t GetPacketizationOverheadRate() const;
|
||||||
@ -175,8 +175,6 @@ class RtpVideoSender : public RtpVideoSenderInterface,
|
|||||||
mutable Mutex mutex_;
|
mutable Mutex mutex_;
|
||||||
bool active_ RTC_GUARDED_BY(mutex_);
|
bool active_ RTC_GUARDED_BY(mutex_);
|
||||||
|
|
||||||
std::map<uint32_t, RtpState> suspended_ssrcs_;
|
|
||||||
|
|
||||||
const std::unique_ptr<FecController> fec_controller_;
|
const std::unique_ptr<FecController> fec_controller_;
|
||||||
bool fec_allowed_ RTC_GUARDED_BY(mutex_);
|
bool fec_allowed_ RTC_GUARDED_BY(mutex_);
|
||||||
|
|
||||||
|
@ -34,7 +34,7 @@ class MockRtpTransportControllerSend
|
|||||||
public:
|
public:
|
||||||
MOCK_METHOD(RtpVideoSenderInterface*,
|
MOCK_METHOD(RtpVideoSenderInterface*,
|
||||||
CreateRtpVideoSender,
|
CreateRtpVideoSender,
|
||||||
((std::map<uint32_t, RtpState>),
|
((const std::map<uint32_t, RtpState>&),
|
||||||
(const std::map<uint32_t, RtpPayloadState>&),
|
(const std::map<uint32_t, RtpPayloadState>&),
|
||||||
const RtpConfig&,
|
const RtpConfig&,
|
||||||
int rtcp_report_interval_ms,
|
int rtcp_report_interval_ms,
|
||||||
|
Reference in New Issue
Block a user