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

Unified Diff: webrtc/modules/remote_bitrate_estimator/tools/bwe_rtp_play.cc

Issue 1235433005: Add pcap support to bwe tools. Allow filtering on SSRCs. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: . Created 5 years, 5 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/remote_bitrate_estimator/tools/bwe_rtp_play.cc
diff --git a/webrtc/modules/remote_bitrate_estimator/tools/bwe_rtp_play.cc b/webrtc/modules/remote_bitrate_estimator/tools/bwe_rtp_play.cc
index 965586757de6e956fcd8bb2ea5f319f16856c2e7..19e4a07b4d367e6cf0af74821e7d48c96de91660 100644
--- a/webrtc/modules/remote_bitrate_estimator/tools/bwe_rtp_play.cc
+++ b/webrtc/modules/remote_bitrate_estimator/tools/bwe_rtp_play.cc
@@ -38,15 +38,6 @@ class Observer : public webrtc::RemoteBitrateObserver {
};
int main(int argc, char** argv) {
- if (argc < 4) {
- printf("Usage: bwe_rtp_play <extension type> <extension id> "
- "<input_file.rtp>\n");
- printf("<extension type> can either be:\n"
- " abs for absolute send time or\n"
- " tsoffset for timestamp offset.\n"
- "<extension id> is the id associated with the extension.\n");
- return -1;
- }
webrtc::test::RtpFileReader* reader;
webrtc::RemoteBitrateEstimator* estimator;
webrtc::RtpHeaderParser* parser;
@@ -76,22 +67,24 @@ int main(int argc, char** argv) {
packet.time_ms = packet.time_ms - first_rtp_time_ms;
while (true) {
if (next_rtp_time_ms <= clock.TimeInMilliseconds()) {
- webrtc::RTPHeader header;
- parser->Parse(packet.data, packet.length, &header);
- if (header.extension.hasAbsoluteSendTime)
- ++abs_send_time_count;
- if (header.extension.hasTransmissionTimeOffset)
- ++ts_offset_count;
- size_t packet_length = packet.length;
- // Some RTP dumps only include the header, in which case packet.length
- // is equal to the header length. In those cases packet.original_length
- // usually contains the original packet length.
- if (packet.original_length > 0) {
- packet_length = packet.original_length;
+ if (!parser->IsRtcp(packet.data, packet.length)) {
+ webrtc::RTPHeader header;
+ parser->Parse(packet.data, packet.length, &header);
+ if (header.extension.hasAbsoluteSendTime)
+ ++abs_send_time_count;
+ if (header.extension.hasTransmissionTimeOffset)
+ ++ts_offset_count;
+ size_t packet_length = packet.length;
+ // Some RTP dumps only include the header, in which case packet.length
+ // is equal to the header length. In those cases packet.original_length
+ // usually contains the original packet length.
+ if (packet.original_length > 0) {
+ packet_length = packet.original_length;
+ }
+ rbe->IncomingPacket(clock.TimeInMilliseconds(),
+ packet_length - header.headerLength, header, true);
+ ++packet_counter;
}
- rbe->IncomingPacket(clock.TimeInMilliseconds(),
- packet_length - header.headerLength, header, true);
- ++packet_counter;
if (!rtp_reader->NextPacket(&packet)) {
break;
}
« no previous file with comments | « webrtc/modules/remote_bitrate_estimator/tools/bwe_rtp.cc ('k') | webrtc/modules/remote_bitrate_estimator/tools/rtp_to_text.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698