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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 delete &capture_event_; | 71 delete &capture_event_; |
72 delete &deliver_event_; | 72 delete &deliver_event_; |
73 } | 73 } |
74 | 74 |
75 void VideoCaptureInput::IncomingCapturedFrame(const VideoFrame& video_frame) { | 75 void VideoCaptureInput::IncomingCapturedFrame(const VideoFrame& video_frame) { |
76 // TODO(pbos): Remove local rendering, it should be handled by the client code | 76 // TODO(pbos): Remove local rendering, it should be handled by the client code |
77 // if required. | 77 // if required. |
78 if (local_renderer_) | 78 if (local_renderer_) |
79 local_renderer_->RenderFrame(video_frame, 0); | 79 local_renderer_->RenderFrame(video_frame, 0); |
80 | 80 |
81 stats_proxy_->OnIncomingFrame(); | 81 stats_proxy_->OnIncomingFrame(video_frame.width(), video_frame.height()); |
82 | 82 |
83 VideoFrame incoming_frame = video_frame; | 83 VideoFrame incoming_frame = video_frame; |
84 | 84 |
85 if (incoming_frame.ntp_time_ms() != 0) { | 85 if (incoming_frame.ntp_time_ms() != 0) { |
86 // If a NTP time stamp is set, this is the time stamp we will use. | 86 // If a NTP time stamp is set, this is the time stamp we will use. |
87 incoming_frame.set_render_time_ms(incoming_frame.ntp_time_ms() - | 87 incoming_frame.set_render_time_ms(incoming_frame.ntp_time_ms() - |
88 delta_ntp_internal_ms_); | 88 delta_ntp_internal_ms_); |
89 } else { // NTP time stamp not set. | 89 } else { // NTP time stamp not set. |
90 int64_t render_time = incoming_frame.render_time_ms() != 0 | 90 int64_t render_time = incoming_frame.render_time_ms() != 0 |
91 ? incoming_frame.render_time_ms() | 91 ? incoming_frame.render_time_ms() |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
153 } | 153 } |
154 // We're done! | 154 // We're done! |
155 if (capture_time != -1) { | 155 if (capture_time != -1) { |
156 overuse_detector_->FrameSent(capture_time); | 156 overuse_detector_->FrameSent(capture_time); |
157 } | 157 } |
158 return true; | 158 return true; |
159 } | 159 } |
160 | 160 |
161 } // namespace internal | 161 } // namespace internal |
162 } // namespace webrtc | 162 } // namespace webrtc |
OLD | NEW |