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

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

Issue 2763023002: Propagate input capture time in ViEEncoder::OnFrame. (Closed)
Patch Set: Undo change to FrameGenerators, only FrameGeneratorCapturer need to set timestamp. 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/modules/video_coding/generic_encoder.cc ('k') | webrtc/video/vie_encoder.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 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
OLDNEW
« no previous file with comments | « webrtc/modules/video_coding/generic_encoder.cc ('k') | webrtc/video/vie_encoder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698