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

Unified Diff: webrtc/modules/audio_coding/neteq/tools/rtc_event_log_source.cc

Issue 2855143002: Removed RtcEventLog deps to call:call_interfaces. (Closed)
Patch Set: Made GetSend/ReceiveConfig private. Created 3 years, 7 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/tools/rtc_event_log_source.cc
diff --git a/webrtc/modules/audio_coding/neteq/tools/rtc_event_log_source.cc b/webrtc/modules/audio_coding/neteq/tools/rtc_event_log_source.cc
index fd3c1302b4fd5fe266c1af15d6703e211ba23d3c..e0b54cb4d1b571ccef807fa98a433c0e97e5cee5 100644
--- a/webrtc/modules/audio_coding/neteq/tools/rtc_event_log_source.cc
+++ b/webrtc/modules/audio_coding/neteq/tools/rtc_event_log_source.cc
@@ -39,38 +39,45 @@ bool RtcEventLogSource::RegisterRtpHeaderExtension(RTPExtensionType type,
}
std::unique_ptr<Packet> RtcEventLogSource::NextPacket() {
- while (rtp_packet_index_ < parsed_stream_.GetNumberOfEvents()) {
+ for (; rtp_packet_index_ < parsed_stream_.GetNumberOfEvents();
+ rtp_packet_index_++) {
if (parsed_stream_.GetEventType(rtp_packet_index_) ==
ParsedRtcEventLog::RTP_EVENT) {
PacketDirection direction;
- MediaType media_type;
size_t header_length;
size_t packet_length;
uint64_t timestamp_us = parsed_stream_.GetTimestamp(rtp_packet_index_);
- parsed_stream_.GetRtpHeader(rtp_packet_index_, &direction, &media_type,
- nullptr, &header_length, &packet_length);
- if (direction == kIncomingPacket && media_type == MediaType::AUDIO) {
- uint8_t* packet_header = new uint8_t[header_length];
- parsed_stream_.GetRtpHeader(rtp_packet_index_, nullptr, nullptr,
- packet_header, nullptr, nullptr);
- std::unique_ptr<Packet> packet(new Packet(
- packet_header, header_length, packet_length,
- static_cast<double>(timestamp_us) / 1000, *parser_.get()));
- if (packet->valid_header()) {
- // Check if the packet should not be filtered out.
- if (!filter_.test(packet->header().payloadType) &&
- !(use_ssrc_filter_ && packet->header().ssrc != ssrc_)) {
- rtp_packet_index_++;
- return packet;
- }
- } else {
- std::cout << "Warning: Packet with index " << rtp_packet_index_
- << " has an invalid header and will be ignored."
- << std::endl;
- }
+ parsed_stream_.GetRtpHeader(rtp_packet_index_, &direction, nullptr,
+ &header_length, &packet_length);
+
+ if (direction != kIncomingPacket) {
+ continue;
+ }
+
+ uint8_t* packet_header = new uint8_t[header_length];
+ parsed_stream_.GetRtpHeader(rtp_packet_index_, nullptr, packet_header,
+ nullptr, nullptr);
+ std::unique_ptr<Packet> packet(
+ new Packet(packet_header, header_length, packet_length,
+ static_cast<double>(timestamp_us) / 1000, *parser_.get()));
+
+ if (!packet->valid_header()) {
+ std::cout << "Warning: Packet with index " << rtp_packet_index_
+ << " has an invalid header and will be ignored." << std::endl;
+ continue;
+ }
+
+ if (parsed_stream_.GetMediaType(packet->header().ssrc, direction) !=
+ webrtc::ParsedRtcEventLog::MediaType::AUDIO) {
+ continue;
+ }
+
+ // Check if the packet should not be filtered out.
+ if (!filter_.test(packet->header().payloadType) &&
+ !(use_ssrc_filter_ && packet->header().ssrc != ssrc_)) {
+ return packet;
}
}
- rtp_packet_index_++;
}
return nullptr;
}
« no previous file with comments | « webrtc/logging/rtc_event_log/rtc_event_log_unittest_helper.cc ('k') | webrtc/modules/congestion_controller/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698