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

Side by Side Diff: webrtc/modules/remote_bitrate_estimator/tools/bwe_rtp_play.cc

Issue 1188823007: Only use paced packets for estimating bitrate probes. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Added unittest Created 5 years, 6 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 if (header.extension.hasTransmissionTimeOffset) 83 if (header.extension.hasTransmissionTimeOffset)
84 ++ts_offset_count; 84 ++ts_offset_count;
85 size_t packet_length = packet.length; 85 size_t packet_length = packet.length;
86 // Some RTP dumps only include the header, in which case packet.length 86 // Some RTP dumps only include the header, in which case packet.length
87 // is equal to the header length. In those cases packet.original_length 87 // is equal to the header length. In those cases packet.original_length
88 // usually contains the original packet length. 88 // usually contains the original packet length.
89 if (packet.original_length > 0) { 89 if (packet.original_length > 0) {
90 packet_length = packet.original_length; 90 packet_length = packet.original_length;
91 } 91 }
92 rbe->IncomingPacket(clock.TimeInMilliseconds(), 92 rbe->IncomingPacket(clock.TimeInMilliseconds(),
93 packet_length - header.headerLength, 93 packet_length - header.headerLength, header, true);
94 header);
95 ++packet_counter; 94 ++packet_counter;
96 if (!rtp_reader->NextPacket(&packet)) { 95 if (!rtp_reader->NextPacket(&packet)) {
97 break; 96 break;
98 } 97 }
99 packet.time_ms = packet.time_ms - first_rtp_time_ms; 98 packet.time_ms = packet.time_ms - first_rtp_time_ms;
100 next_rtp_time_ms = packet.time_ms; 99 next_rtp_time_ms = packet.time_ms;
101 } 100 }
102 int64_t time_until_process_ms = rbe->TimeUntilNextProcess(); 101 int64_t time_until_process_ms = rbe->TimeUntilNextProcess();
103 if (time_until_process_ms <= 0) { 102 if (time_until_process_ms <= 0) {
104 rbe->Process(); 103 rbe->Process();
105 } 104 }
106 int64_t time_until_next_event = 105 int64_t time_until_next_event =
107 std::min(rbe->TimeUntilNextProcess(), 106 std::min(rbe->TimeUntilNextProcess(),
108 next_rtp_time_ms - clock.TimeInMilliseconds()); 107 next_rtp_time_ms - clock.TimeInMilliseconds());
109 clock.AdvanceTimeMilliseconds(std::max<int64_t>(time_until_next_event, 0)); 108 clock.AdvanceTimeMilliseconds(std::max<int64_t>(time_until_next_event, 0));
110 } 109 }
111 printf("Parsed %d packets\nTime passed: %" PRId64 " ms\n", packet_counter, 110 printf("Parsed %d packets\nTime passed: %" PRId64 " ms\n", packet_counter,
112 clock.TimeInMilliseconds()); 111 clock.TimeInMilliseconds());
113 printf("Estimator used: %s\n", estimator_used.c_str()); 112 printf("Estimator used: %s\n", estimator_used.c_str());
114 printf("Packets with absolute send time: %d\n", 113 printf("Packets with absolute send time: %d\n",
115 abs_send_time_count); 114 abs_send_time_count);
116 printf("Packets with timestamp offset: %d\n", 115 printf("Packets with timestamp offset: %d\n",
117 ts_offset_count); 116 ts_offset_count);
118 printf("Packets with no extension: %d\n", 117 printf("Packets with no extension: %d\n",
119 packet_counter - ts_offset_count - abs_send_time_count); 118 packet_counter - ts_offset_count - abs_send_time_count);
120 return 0; 119 return 0;
121 } 120 }
OLDNEW
« no previous file with comments | « webrtc/modules/remote_bitrate_estimator/test/estimators/send_side.cc ('k') | webrtc/video/audio_receive_stream.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698