Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(33)

Unified Diff: webrtc/modules/audio_coding/neteq/neteq_impl.cc

Issue 2342443005: Moved Opus-specific payload splitting into AudioDecoderOpus. (Closed)
Patch Set: Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: webrtc/modules/audio_coding/neteq/neteq_impl.cc
diff --git a/webrtc/modules/audio_coding/neteq/neteq_impl.cc b/webrtc/modules/audio_coding/neteq/neteq_impl.cc
index de2a4f4661d804bb3b6766d9b249533cb393fd44..5ad79df4345a59ea4445a9863d201d11d6375222 100644
--- a/webrtc/modules/audio_coding/neteq/neteq_impl.cc
+++ b/webrtc/modules/audio_coding/neteq/neteq_impl.cc
@@ -528,7 +528,6 @@ int NetEqImpl::InsertPacketInternal(const WebRtcRTPHeader& rtp_header,
packet->header.ssrc = rtp_header.header.ssrc;
packet->header.numCSRCs = 0;
packet->payload.SetData(payload.data(), payload.size());
- packet->primary = true;
// Waiting time will be set upon inserting the packet in the buffer.
RTC_DCHECK(!packet->waiting_time);
// Insert packet in a packet list.
@@ -619,18 +618,6 @@ int NetEqImpl::InsertPacketInternal(const WebRtcRTPHeader& rtp_header,
}
}
- // Check for FEC in packets, and separate payloads into several packets.
- int ret = payload_splitter_->SplitFec(&packet_list, decoder_database_.get());
- if (ret != PayloadSplitter::kOK) {
- PacketBuffer::DeleteAllPackets(&packet_list);
- switch (ret) {
- case PayloadSplitter::kUnknownPayloadType:
- return kUnknownRtpPayloadType;
- default:
- return kOtherError;
- }
- }
-
// Update bandwidth estimate, if the packet is not comfort noise.
if (!packet_list.empty() &&
!decoder_database_->IsComfortNoise(main_header.payloadType)) {
@@ -662,15 +649,15 @@ int NetEqImpl::InsertPacketInternal(const WebRtcRTPHeader& rtp_header,
parsed_packet_list.push_back(packet.release());
} else {
std::vector<AudioDecoder::ParseResult> results =
- info->GetDecoder()->ParsePayload(
- &packet->payload, packet->header.timestamp, packet->primary);
+ info->GetDecoder()->ParsePayload(&packet->payload,
+ packet->header.timestamp);
// Reuse the packet if possible
if (results.size() == 1) {
auto& result = results[0];
RTC_DCHECK(result.frame);
packet->header.timestamp = result.timestamp;
- packet->primary = result.primary;
+ packet->priority.codec_level = result.priority;
packet->frame = std::move(result.frame);
parsed_packet_list.push_back(packet.release());
} else {
@@ -680,8 +667,8 @@ int NetEqImpl::InsertPacketInternal(const WebRtcRTPHeader& rtp_header,
std::unique_ptr<Packet> parsed_packet(new Packet);
parsed_packet->header = packet->header;
parsed_packet->header.timestamp = result.timestamp;
- // TODO(ossu): Move from primary to some sort of priority level.
- parsed_packet->primary = result.primary;
+ parsed_packet->priority.codec_level = result.priority;
+ parsed_packet->priority.red_level = packet->priority.red_level;
parsed_packet->frame = std::move(result.frame);
parsed_packet_list.push_back(parsed_packet.release());
}
@@ -702,7 +689,7 @@ int NetEqImpl::InsertPacketInternal(const WebRtcRTPHeader& rtp_header,
// Insert packets in buffer.
const size_t buffer_length_before_insert =
packet_buffer_->NumPacketsInBuffer();
- ret = packet_buffer_->InsertPacketList(
+ int ret = packet_buffer_->InsertPacketList(
kwiberg-webrtc 2016/09/19 11:07:49 const?
ossu 2016/09/19 11:41:01 Acknowledged.
&parsed_packet_list, *decoder_database_, &current_rtp_payload_type_,
&current_cng_rtp_payload_type_);
if (ret == PacketBuffer::kFlushed) {
@@ -1949,7 +1936,7 @@ int NetEqImpl::ExtractPackets(size_t required_samples,
packet_duration = packet->frame->Duration();
// TODO(ossu): Is this the correct way to track samples decoded from a
// redundant packet?
- if (packet_duration > 0 && !packet->primary) {
+ if (packet->priority != Packet::kHighestPriority) {
stats_.SecondaryDecodedSamples(packet_duration);
}
} else if (!decoder_database_->IsComfortNoise(packet->header.payloadType)) {

Powered by Google App Engine
This is Rietveld 408576698