Delete use of RtpPayloadRegistry.

Use in voe::Channel replaced by a std::map storing payload type frequencies.
This is a followup to
https://webrtc-review.googlesource.com/c/src/+/93820.

Bug: webrtc:7135
Change-Id: I874b706aee19fdc2d841db42a540e4f7aa2725f1
Reviewed-on: https://webrtc-review.googlesource.com/94508
Reviewed-by: Oskar Sundbom <ossu@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24315}
This commit is contained in:
Niels Möller 2018-08-16 13:47:49 +02:00 committed by Commit Bot
parent e23b8a9899
commit fa2b2d62d7
2 changed files with 15 additions and 18 deletions

View File

@ -29,7 +29,6 @@
#include "modules/audio_processing/include/audio_processing.h"
#include "modules/pacing/packet_router.h"
#include "modules/rtp_rtcp/include/receive_statistics.h"
#include "modules/rtp_rtcp/include/rtp_payload_registry.h"
#include "modules/rtp_rtcp/source/rtp_packet_received.h"
#include "modules/rtp_rtcp/source/rtp_receiver_strategy.h"
#include "modules/utility/include/process_thread.h"
@ -495,7 +494,6 @@ Channel::Channel(ProcessThread* module_process_thread,
rtc::scoped_refptr<AudioDecoderFactory> decoder_factory,
absl::optional<AudioCodecPairId> codec_pair_id)
: event_log_(rtc_event_log),
rtp_payload_registry_(new RTPPayloadRegistry()),
rtp_receive_statistics_(
ReceiveStatistics::Create(Clock::GetRealTimeClock())),
remote_ssrc_(remote_ssrc),
@ -809,7 +807,10 @@ void Channel::OnUplinkPacketLossRate(float packet_loss_rate) {
}
void Channel::SetReceiveCodecs(const std::map<int, SdpAudioFormat>& codecs) {
rtp_payload_registry_->SetAudioReceivePayloads(codecs);
for (const auto& kv : codecs) {
RTC_DCHECK_GE(kv.second.clockrate_hz, 1000);
payload_type_frequencies_[kv.first] = kv.second.clockrate_hz;
}
audio_coding_->SetReceiveCodecs(codecs);
}
@ -870,14 +871,15 @@ void Channel::OnRtpPacket(const RtpPacketReceived& packet) {
// Store playout timestamp for the received RTP packet
UpdatePlayoutTimestamp(false);
header.payload_type_frequency =
rtp_payload_registry_->GetPayloadTypeFrequency(header.payloadType);
if (header.payload_type_frequency >= 0) {
rtp_receive_statistics_->IncomingPacket(header, packet.size(),
IsPacketRetransmitted(header));
const auto& it = payload_type_frequencies_.find(header.payloadType);
if (it == payload_type_frequencies_.end())
return;
header.payload_type_frequency = it->second;
ReceivePacket(packet.data(), packet.size(), header);
}
rtp_receive_statistics_->IncomingPacket(header, packet.size(),
IsPacketRetransmitted(header));
ReceivePacket(packet.data(), packet.size(), header);
}
bool Channel::ReceivePacket(const uint8_t* packet,
@ -886,11 +888,6 @@ bool Channel::ReceivePacket(const uint8_t* packet,
const uint8_t* payload = packet + header.headerLength;
assert(packet_length >= header.headerLength);
size_t payload_length = packet_length - header.headerLength;
const auto pl =
rtp_payload_registry_->PayloadTypeToPayload(header.payloadType);
if (!pl) {
return false;
}
WebRtcRTPHeader webrtc_rtp_header = {};
webrtc_rtp_header.header = header;

View File

@ -53,8 +53,6 @@ class RateLimiter;
class ReceiveStatistics;
class RemoteNtpTimeEstimator;
class RtcEventLog;
class RTPPayloadRegistry;
class RTPReceiverAudio;
class RtpPacketReceived;
class RtpRtcp;
class RtpTransportControllerSendInterface;
@ -340,7 +338,9 @@ class Channel
RtcEventLog* const event_log_;
std::unique_ptr<RTPPayloadRegistry> rtp_payload_registry_;
// Indexed by payload type.
std::map<uint8_t, int> payload_type_frequencies_;
std::unique_ptr<ReceiveStatistics> rtp_receive_statistics_;
std::unique_ptr<RtpRtcp> _rtpRtcpModule;
const uint32_t remote_ssrc_;