OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2016 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 24 matching lines...) Expand all Loading... |
35 #include "webrtc/modules/rtp_rtcp/source/rtp_header_extensions.h" | 35 #include "webrtc/modules/rtp_rtcp/source/rtp_header_extensions.h" |
36 #include "webrtc/modules/rtp_rtcp/source/rtp_utility.h" | 36 #include "webrtc/modules/rtp_rtcp/source/rtp_utility.h" |
37 #include "webrtc/video_receive_stream.h" | 37 #include "webrtc/video_receive_stream.h" |
38 #include "webrtc/video_send_stream.h" | 38 #include "webrtc/video_send_stream.h" |
39 | 39 |
40 namespace webrtc { | 40 namespace webrtc { |
41 namespace plotting { | 41 namespace plotting { |
42 | 42 |
43 namespace { | 43 namespace { |
44 | 44 |
| 45 class PacketFeedbackComparator { |
| 46 public: |
| 47 inline bool operator()(const webrtc::PacketFeedback& lhs, |
| 48 const webrtc::PacketFeedback& rhs) { |
| 49 if (lhs.arrival_time_ms != rhs.arrival_time_ms) |
| 50 return lhs.arrival_time_ms < rhs.arrival_time_ms; |
| 51 if (lhs.send_time_ms != rhs.send_time_ms) |
| 52 return lhs.send_time_ms < rhs.send_time_ms; |
| 53 return lhs.sequence_number < rhs.sequence_number; |
| 54 } |
| 55 }; |
| 56 |
45 void SortPacketFeedbackVector(std::vector<PacketFeedback>* vec) { | 57 void SortPacketFeedbackVector(std::vector<PacketFeedback>* vec) { |
46 auto pred = [](const PacketFeedback& packet_feedback) { | 58 auto pred = [](const PacketFeedback& packet_feedback) { |
47 return packet_feedback.arrival_time_ms == PacketFeedback::kNotReceived; | 59 return packet_feedback.arrival_time_ms == PacketFeedback::kNotReceived; |
48 }; | 60 }; |
49 vec->erase(std::remove_if(vec->begin(), vec->end(), pred), vec->end()); | 61 vec->erase(std::remove_if(vec->begin(), vec->end(), pred), vec->end()); |
50 std::sort(vec->begin(), vec->end(), PacketFeedbackComparator()); | 62 std::sort(vec->begin(), vec->end(), PacketFeedbackComparator()); |
51 } | 63 } |
52 | 64 |
53 std::string SsrcToString(uint32_t ssrc) { | 65 std::string SsrcToString(uint32_t ssrc) { |
54 std::stringstream ss; | 66 std::stringstream ss; |
(...skipping 1324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1379 }, | 1391 }, |
1380 audio_network_adaptation_events_, begin_time_, &time_series); | 1392 audio_network_adaptation_events_, begin_time_, &time_series); |
1381 plot->AppendTimeSeries(std::move(time_series)); | 1393 plot->AppendTimeSeries(std::move(time_series)); |
1382 plot->SetXAxis(0, call_duration_s_, "Time (s)", kLeftMargin, kRightMargin); | 1394 plot->SetXAxis(0, call_duration_s_, "Time (s)", kLeftMargin, kRightMargin); |
1383 plot->SetSuggestedYAxis(0, 1, "Number of channels (1 (mono)/2 (stereo))", | 1395 plot->SetSuggestedYAxis(0, 1, "Number of channels (1 (mono)/2 (stereo))", |
1384 kBottomMargin, kTopMargin); | 1396 kBottomMargin, kTopMargin); |
1385 plot->SetTitle("Reported audio encoder number of channels"); | 1397 plot->SetTitle("Reported audio encoder number of channels"); |
1386 } | 1398 } |
1387 } // namespace plotting | 1399 } // namespace plotting |
1388 } // namespace webrtc | 1400 } // namespace webrtc |
OLD | NEW |