Revert of Change NetEq::InsertPacket to take an RTPHeader (patchset #2 id:20001 of https://codereview.webrtc.org/2807273004/ )

Reason for revert:
Broke downstream dependencies.

Original issue's description:
> Change NetEq::InsertPacket to take an RTPHeader
>
> It used to take a WebRtcRTPHeader as input, which has an RTPHeader as
> a member. None of the other member in WebRtcRTPHeader where used in
> NetEq.
>
> This CL adapts the production code; tests and tools will be converted
> in a follow-up CL.
>
> BUG=webrtc:7467
>
> Review-Url: https://codereview.webrtc.org/2807273004
> Cr-Commit-Position: refs/heads/master@{#17652}
> Committed: 4d027576a6

TBR=ivoc@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:7467

Review-Url: https://codereview.webrtc.org/2812933002
Cr-Commit-Position: refs/heads/master@{#17657}
This commit is contained in:
henrik.lundin
2017-04-11 07:47:59 -07:00
committed by Commit bot
parent 80ff00cd2b
commit 10d095d4f7
12 changed files with 97 additions and 99 deletions

View File

@ -131,7 +131,7 @@ NetEqImpl::NetEqImpl(const NetEq::Config& config,
NetEqImpl::~NetEqImpl() = default;
int NetEqImpl::InsertPacket(const RTPHeader& rtp_header,
int NetEqImpl::InsertPacket(const WebRtcRTPHeader& rtp_header,
rtc::ArrayView<const uint8_t> payload,
uint32_t receive_timestamp) {
rtc::MsanCheckInitialized(payload);
@ -581,7 +581,7 @@ Operations NetEqImpl::last_operation_for_test() const {
// Methods below this line are private.
int NetEqImpl::InsertPacketInternal(const RTPHeader& rtp_header,
int NetEqImpl::InsertPacketInternal(const WebRtcRTPHeader& rtp_header,
rtc::ArrayView<const uint8_t> payload,
uint32_t receive_timestamp) {
if (payload.empty()) {
@ -594,24 +594,24 @@ int NetEqImpl::InsertPacketInternal(const RTPHeader& rtp_header,
packet_list.push_back([&rtp_header, &payload] {
// Convert to Packet.
Packet packet;
packet.payload_type = rtp_header.payloadType;
packet.sequence_number = rtp_header.sequenceNumber;
packet.timestamp = rtp_header.timestamp;
packet.payload_type = rtp_header.header.payloadType;
packet.sequence_number = rtp_header.header.sequenceNumber;
packet.timestamp = rtp_header.header.timestamp;
packet.payload.SetData(payload.data(), payload.size());
// Waiting time will be set upon inserting the packet in the buffer.
RTC_DCHECK(!packet.waiting_time);
return packet;
}());
bool update_sample_rate_and_channels =
first_packet_ || (rtp_header.ssrc != ssrc_);
bool update_sample_rate_and_channels = first_packet_ ||
(rtp_header.header.ssrc != ssrc_);
if (update_sample_rate_and_channels) {
// Reset timestamp scaling.
timestamp_scaler_->Reset();
}
if (!decoder_database_->IsRed(rtp_header.payloadType)) {
if (!decoder_database_->IsRed(rtp_header.header.payloadType)) {
// Scale timestamp to internal domain (only for some codecs).
timestamp_scaler_->ToInternal(&packet_list);
}
@ -627,14 +627,14 @@ int NetEqImpl::InsertPacketInternal(const RTPHeader& rtp_header,
// Note: |first_packet_| will be cleared further down in this method, once
// the packet has been successfully inserted into the packet buffer.
rtcp_.Init(rtp_header.sequenceNumber);
rtcp_.Init(rtp_header.header.sequenceNumber);
// Flush the packet buffer and DTMF buffer.
packet_buffer_->Flush();
dtmf_buffer_->Flush();
// Store new SSRC.
ssrc_ = rtp_header.ssrc;
ssrc_ = rtp_header.header.ssrc;
// Update audio buffer timestamp.
sync_buffer_->IncreaseEndTimestamp(main_timestamp - timestamp_);
@ -644,19 +644,19 @@ int NetEqImpl::InsertPacketInternal(const RTPHeader& rtp_header,
}
// Update RTCP statistics, only for regular packets.
rtcp_.Update(rtp_header, receive_timestamp);
rtcp_.Update(rtp_header.header, receive_timestamp);
if (nack_enabled_) {
RTC_DCHECK(nack_);
if (update_sample_rate_and_channels) {
nack_->Reset();
}
nack_->UpdateLastReceivedPacket(rtp_header.sequenceNumber,
rtp_header.timestamp);
nack_->UpdateLastReceivedPacket(rtp_header.header.sequenceNumber,
rtp_header.header.timestamp);
}
// Check for RED payload type, and separate payloads into several packets.
if (decoder_database_->IsRed(rtp_header.payloadType)) {
if (decoder_database_->IsRed(rtp_header.header.payloadType)) {
if (!red_payload_splitter_->SplitRed(&packet_list)) {
return kRedundancySplitError;
}
@ -675,7 +675,7 @@ int NetEqImpl::InsertPacketInternal(const RTPHeader& rtp_header,
// Update main_timestamp, if new packets appear in the list
// after RED splitting.
if (decoder_database_->IsRed(rtp_header.payloadType)) {
if (decoder_database_->IsRed(rtp_header.header.payloadType)) {
timestamp_scaler_->ToInternal(&packet_list);
main_timestamp = packet_list.front().timestamp;
main_payload_type = packet_list.front().payload_type;