Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 /* | |
| 2 * Copyright (c) 2017 The WebRTC project authors. All Rights Reserved. | |
| 3 * | |
| 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 | |
| 6 * tree. An additional intellectual property rights grant can be found | |
| 7 * in the file PATENTS. All contributing project authors may | |
| 8 * be found in the AUTHORS file in the root of the source tree. | |
| 9 */ | |
| 10 | |
| 11 #ifndef WEBRTC_API_VIDEO_VIDEO_TIMING_CC_ | |
| 12 #define WEBRTC_API_VIDEO_VIDEO_TIMING_CC_ | |
|
hbos
2017/06/27 14:08:30
No need for #ifndef in a .cc file.
ilnik
2017/06/27 15:23:56
Ooops. Copy-paste failed me.
| |
| 13 | |
| 14 #include "webrtc/api/video/video_timing.h" | |
| 15 | |
| 16 #include <sstream> | |
| 17 | |
| 18 namespace webrtc { | |
| 19 | |
| 20 TimingFrameInfo::TimingFrameInfo() | |
| 21 : rtp_timestamp(0), | |
| 22 capture_time_ms(-1), | |
| 23 encode_start_ms(-1), | |
| 24 encode_finish_ms(-1), | |
| 25 packetization_finish_ms(-1), | |
| 26 pacer_exit_ms(-1), | |
| 27 network_timestamp_ms(-1), | |
| 28 network2_timestamp_ms(-1), | |
| 29 receive_start_ms(-1), | |
| 30 receive_finish_ms(-1), | |
| 31 decode_start_ms(-1), | |
| 32 decode_finish_ms(-1), | |
| 33 render_time_ms(-1) {} | |
|
hbos
2017/06/27 14:08:30
If a value is optional please prefer rtc::Optional
ilnik
2017/06/27 15:23:56
Done.
| |
| 34 | |
| 35 int64_t TimingFrameInfo::EndToEndDelay() const { | |
| 36 return capture_time_ms >= 0 ? decode_finish_ms - capture_time_ms : -1; | |
| 37 } | |
| 38 | |
| 39 bool TimingFrameInfo::IsLongerThan(const TimingFrameInfo& other) const { | |
| 40 int64_t other_delay = other.EndToEndDelay(); | |
| 41 return other_delay == -1 || EndToEndDelay() > other_delay; | |
| 42 } | |
| 43 | |
| 44 std::string TimingFrameInfo::ToString() const { | |
| 45 std::stringstream out; | |
| 46 out << rtp_timestamp << ',' << capture_time_ms << ',' << encode_start_ms | |
| 47 << ',' << encode_finish_ms << ',' << packetization_finish_ms << ',' | |
| 48 << pacer_exit_ms << ',' << network_timestamp_ms << ',' | |
| 49 << network2_timestamp_ms << ',' << receive_start_ms << ',' | |
| 50 << receive_finish_ms << ',' << decode_start_ms << ',' | |
| 51 << decode_finish_ms << ',' << render_time_ms; | |
| 52 return out.str(); | |
|
hbos
2017/06/27 14:08:30
Not sure if to DCHECK that all values are set or u
ilnik
2017/06/27 15:23:56
Now, as TimingFrameInfo is wrapped in rtc::Optiona
| |
| 53 } | |
| 54 | |
| 55 } // namespace webrtc | |
| 56 | |
| 57 #endif // WEBRTC_API_VIDEO_VIDEO_TIMING_CC_ | |
| 58 | |
| OLD | NEW |