OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2013 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 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
153 new InsertFrameTask(this, 1000 / framerate_fps)), | 153 new InsertFrameTask(this, 1000 / framerate_fps)), |
154 1000 / framerate_fps); | 154 1000 / framerate_fps); |
155 | 155 |
156 return true; | 156 return true; |
157 } | 157 } |
158 | 158 |
159 void FrameGeneratorCapturer::InsertFrame() { | 159 void FrameGeneratorCapturer::InsertFrame() { |
160 rtc::CritScope cs(&lock_); | 160 rtc::CritScope cs(&lock_); |
161 if (sending_) { | 161 if (sending_) { |
162 VideoFrame* frame = frame_generator_->NextFrame(); | 162 VideoFrame* frame = frame_generator_->NextFrame(); |
| 163 frame->set_timestamp_us(rtc::TimeMicros()); |
163 frame->set_ntp_time_ms(clock_->CurrentNtpInMilliseconds()); | 164 frame->set_ntp_time_ms(clock_->CurrentNtpInMilliseconds()); |
164 frame->set_rotation(fake_rotation_); | 165 frame->set_rotation(fake_rotation_); |
165 if (first_frame_capture_time_ == -1) { | 166 if (first_frame_capture_time_ == -1) { |
166 first_frame_capture_time_ = frame->ntp_time_ms(); | 167 first_frame_capture_time_ = frame->ntp_time_ms(); |
167 } | 168 } |
168 | 169 |
169 if (sink_) { | 170 if (sink_) { |
170 rtc::Optional<VideoFrame> out_frame = AdaptFrame(*frame); | 171 rtc::Optional<VideoFrame> out_frame = AdaptFrame(*frame); |
171 if (out_frame) | 172 if (out_frame) |
172 sink_->OnFrame(*out_frame); | 173 sink_->OnFrame(*out_frame); |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
234 | 235 |
235 int FrameGeneratorCapturer::GetCurrentConfiguredFramerate() { | 236 int FrameGeneratorCapturer::GetCurrentConfiguredFramerate() { |
236 rtc::CritScope cs(&lock_); | 237 rtc::CritScope cs(&lock_); |
237 if (wanted_fps_ && *wanted_fps_ < target_fps_) | 238 if (wanted_fps_ && *wanted_fps_ < target_fps_) |
238 return *wanted_fps_; | 239 return *wanted_fps_; |
239 return target_fps_; | 240 return target_fps_; |
240 } | 241 } |
241 | 242 |
242 } // namespace test | 243 } // namespace test |
243 } // namespace webrtc | 244 } // namespace webrtc |
OLD | NEW |