Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (c) 2017 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2017 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 21 matching lines...) Expand all Loading... | |
| 32 | 32 |
| 33 int64_t TimingFrameInfo::EndToEndDelay() const { | 33 int64_t TimingFrameInfo::EndToEndDelay() const { |
| 34 return capture_time_ms >= 0 ? decode_finish_ms - capture_time_ms : -1; | 34 return capture_time_ms >= 0 ? decode_finish_ms - capture_time_ms : -1; |
| 35 } | 35 } |
| 36 | 36 |
| 37 bool TimingFrameInfo::IsLongerThan(const TimingFrameInfo& other) const { | 37 bool TimingFrameInfo::IsLongerThan(const TimingFrameInfo& other) const { |
| 38 int64_t other_delay = other.EndToEndDelay(); | 38 int64_t other_delay = other.EndToEndDelay(); |
| 39 return other_delay == -1 || EndToEndDelay() > other_delay; | 39 return other_delay == -1 || EndToEndDelay() > other_delay; |
| 40 } | 40 } |
| 41 | 41 |
| 42 bool TimingFrameInfo::operator<(const TimingFrameInfo& other) { | |
| 43 return other.IsLongerThan(*this); | |
| 44 } | |
| 45 | |
| 46 bool TimingFrameInfo::operator<=(const TimingFrameInfo& other) { | |
| 47 return !IsLongerThan(other); | |
| 48 } | |
| 49 | |
|
tommi
2017/09/04 09:09:21
nit: fix whitespace
ilnik
2017/09/04 09:18:55
Done.
| |
| 50 | |
| 42 bool TimingFrameInfo::IsOutlier() const { | 51 bool TimingFrameInfo::IsOutlier() const { |
| 43 return !IsInvalid() && (flags & TimingFrameFlags::kTriggeredBySize); | 52 return !IsInvalid() && (flags & TimingFrameFlags::kTriggeredBySize); |
| 44 } | 53 } |
| 45 | 54 |
| 46 bool TimingFrameInfo::IsTimerTriggered() const { | 55 bool TimingFrameInfo::IsTimerTriggered() const { |
| 47 return !IsInvalid() && (flags & TimingFrameFlags::kTriggeredByTimer); | 56 return !IsInvalid() && (flags & TimingFrameFlags::kTriggeredByTimer); |
| 48 } | 57 } |
| 49 | 58 |
| 50 bool TimingFrameInfo::IsInvalid() const { | 59 bool TimingFrameInfo::IsInvalid() const { |
| 51 return flags == TimingFrameFlags::kInvalid; | 60 return flags == TimingFrameFlags::kInvalid; |
| 52 } | 61 } |
| 53 | 62 |
| 54 std::string TimingFrameInfo::ToString() const { | 63 std::string TimingFrameInfo::ToString() const { |
| 55 std::stringstream out; | 64 std::stringstream out; |
| 56 if (IsInvalid()) { | 65 if (IsInvalid()) { |
| 57 out << "[Invalid]"; | 66 out << ""; |
| 58 } else { | 67 } else { |
| 59 out << rtp_timestamp << ',' << capture_time_ms << ',' << encode_start_ms | 68 out << rtp_timestamp << ',' << capture_time_ms << ',' << encode_start_ms |
| 60 << ',' << encode_finish_ms << ',' << packetization_finish_ms << ',' | 69 << ',' << encode_finish_ms << ',' << packetization_finish_ms << ',' |
| 61 << pacer_exit_ms << ',' << network_timestamp_ms << ',' | 70 << pacer_exit_ms << ',' << network_timestamp_ms << ',' |
| 62 << network2_timestamp_ms << ',' << receive_start_ms << ',' | 71 << network2_timestamp_ms << ',' << receive_start_ms << ',' |
| 63 << receive_finish_ms << ',' << decode_start_ms << ',' | 72 << receive_finish_ms << ',' << decode_start_ms << ',' |
| 64 << decode_finish_ms << ',' << render_time_ms << ", outlier_triggered " | 73 << decode_finish_ms << ',' << render_time_ms << ',' |
| 65 << IsOutlier() << ", timer_triggered " << IsTimerTriggered(); | 74 << IsOutlier() << ',' << IsTimerTriggered(); |
| 66 } | 75 } |
| 67 return out.str(); | 76 return out.str(); |
| 68 } | 77 } |
| 69 | 78 |
| 70 } // namespace webrtc | 79 } // namespace webrtc |
| OLD | NEW |