OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 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 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 } | 140 } |
141 if (!deliver_frame.IsZeroSize()) { | 141 if (!deliver_frame.IsZeroSize()) { |
142 capture_time = deliver_frame.render_time_ms(); | 142 capture_time = deliver_frame.render_time_ms(); |
143 encode_start_time = Clock::GetRealTimeClock()->TimeInMilliseconds(); | 143 encode_start_time = Clock::GetRealTimeClock()->TimeInMilliseconds(); |
144 frame_callback_->DeliverFrame(deliver_frame); | 144 frame_callback_->DeliverFrame(deliver_frame); |
145 } | 145 } |
146 // Update the overuse detector with the duration. | 146 // Update the overuse detector with the duration. |
147 if (encode_start_time != -1) { | 147 if (encode_start_time != -1) { |
148 int encode_time_ms = static_cast<int>( | 148 int encode_time_ms = static_cast<int>( |
149 Clock::GetRealTimeClock()->TimeInMilliseconds() - encode_start_time); | 149 Clock::GetRealTimeClock()->TimeInMilliseconds() - encode_start_time); |
150 overuse_detector_->FrameEncoded(encode_time_ms); | |
151 stats_proxy_->OnEncodedFrame(encode_time_ms); | 150 stats_proxy_->OnEncodedFrame(encode_time_ms); |
152 if (encoding_time_observer_) { | 151 if (encoding_time_observer_) { |
153 encoding_time_observer_->OnReportEncodedTime( | 152 encoding_time_observer_->OnReportEncodedTime( |
154 deliver_frame.ntp_time_ms(), encode_time_ms); | 153 deliver_frame.ntp_time_ms(), encode_time_ms); |
155 } | 154 } |
156 } | 155 } |
157 } | 156 } |
158 // We're done! | 157 // We're done! |
159 if (capture_time != -1) { | 158 if (capture_time != -1) { |
160 overuse_detector_->FrameSent(capture_time); | 159 overuse_detector_->FrameSent(capture_time); |
161 } | 160 } |
162 return true; | 161 return true; |
163 } | 162 } |
164 | 163 |
165 } // namespace internal | 164 } // namespace internal |
166 } // namespace webrtc | 165 } // namespace webrtc |
OLD | NEW |