Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(236)

Side by Side Diff: webrtc/test/frame_generator_capturer.cc

Issue 2911193002: Implement timing frames. (Closed)
Patch Set: Implement Holmer@ comments Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « webrtc/test/fake_encoder.cc ('k') | webrtc/test/fuzzers/rtp_packet_fuzzer.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 new InsertFrameTask(this, 1000 / framerate_fps)), 152 new InsertFrameTask(this, 1000 / framerate_fps)),
153 1000 / framerate_fps); 153 1000 / framerate_fps);
154 154
155 return true; 155 return true;
156 } 156 }
157 157
158 void FrameGeneratorCapturer::InsertFrame() { 158 void FrameGeneratorCapturer::InsertFrame() {
159 rtc::CritScope cs(&lock_); 159 rtc::CritScope cs(&lock_);
160 if (sending_) { 160 if (sending_) {
161 VideoFrame* frame = frame_generator_->NextFrame(); 161 VideoFrame* frame = frame_generator_->NextFrame();
162 frame->set_timestamp_us(rtc::TimeMicros()); 162 frame->set_timestamp_us(clock_->TimeInMicroseconds());
163 frame->set_ntp_time_ms(clock_->CurrentNtpInMilliseconds()); 163 frame->set_ntp_time_ms(clock_->CurrentNtpInMilliseconds());
164 frame->set_rotation(fake_rotation_); 164 frame->set_rotation(fake_rotation_);
165 if (first_frame_capture_time_ == -1) { 165 if (first_frame_capture_time_ == -1) {
166 first_frame_capture_time_ = frame->ntp_time_ms(); 166 first_frame_capture_time_ = frame->ntp_time_ms();
167 } 167 }
168 168
169 if (sink_) { 169 if (sink_) {
170 rtc::Optional<VideoFrame> out_frame = AdaptFrame(*frame); 170 rtc::Optional<VideoFrame> out_frame = AdaptFrame(*frame);
171 if (out_frame) 171 if (out_frame)
172 sink_->OnFrame(*out_frame); 172 sink_->OnFrame(*out_frame);
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
234 234
235 int FrameGeneratorCapturer::GetCurrentConfiguredFramerate() { 235 int FrameGeneratorCapturer::GetCurrentConfiguredFramerate() {
236 rtc::CritScope cs(&lock_); 236 rtc::CritScope cs(&lock_);
237 if (wanted_fps_ && *wanted_fps_ < target_fps_) 237 if (wanted_fps_ && *wanted_fps_ < target_fps_)
238 return *wanted_fps_; 238 return *wanted_fps_;
239 return target_fps_; 239 return target_fps_;
240 } 240 }
241 241
242 } // namespace test 242 } // namespace test
243 } // namespace webrtc 243 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/test/fake_encoder.cc ('k') | webrtc/test/fuzzers/rtp_packet_fuzzer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698