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 #include "webrtc/test/frame_generator.h" | 10 #include "webrtc/test/frame_generator.h" |
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
251 rtc::scoped_refptr<I420BufferInterface> i420_buffer = | 251 rtc::scoped_refptr<I420BufferInterface> i420_buffer = |
252 current_source_frame_->video_frame_buffer()->ToI420(); | 252 current_source_frame_->video_frame_buffer()->ToI420(); |
253 int offset_y = | 253 int offset_y = |
254 (i420_buffer->StrideY() * pixels_scrolled_y) + pixels_scrolled_x; | 254 (i420_buffer->StrideY() * pixels_scrolled_y) + pixels_scrolled_x; |
255 int offset_u = (i420_buffer->StrideU() * (pixels_scrolled_y / 2)) + | 255 int offset_u = (i420_buffer->StrideU() * (pixels_scrolled_y / 2)) + |
256 (pixels_scrolled_x / 2); | 256 (pixels_scrolled_x / 2); |
257 int offset_v = (i420_buffer->StrideV() * (pixels_scrolled_y / 2)) + | 257 int offset_v = (i420_buffer->StrideV() * (pixels_scrolled_y / 2)) + |
258 (pixels_scrolled_x / 2); | 258 (pixels_scrolled_x / 2); |
259 | 259 |
260 current_frame_ = rtc::Optional<webrtc::VideoFrame>(webrtc::VideoFrame( | 260 current_frame_ = rtc::Optional<webrtc::VideoFrame>(webrtc::VideoFrame( |
261 new rtc::RefCountedObject<webrtc::WrappedI420Buffer>( | 261 WrapI420Buffer(target_width_, target_height_, |
262 target_width_, target_height_, &i420_buffer->DataY()[offset_y], | 262 &i420_buffer->DataY()[offset_y], i420_buffer->StrideY(), |
263 i420_buffer->StrideY(), &i420_buffer->DataU()[offset_u], | 263 &i420_buffer->DataU()[offset_u], i420_buffer->StrideU(), |
264 i420_buffer->StrideU(), &i420_buffer->DataV()[offset_v], | 264 &i420_buffer->DataV()[offset_v], i420_buffer->StrideV(), |
265 i420_buffer->StrideV(), KeepRefUntilDone(i420_buffer)), | 265 KeepRefUntilDone(i420_buffer)), |
266 kVideoRotation_0, 0)); | 266 kVideoRotation_0, 0)); |
267 } | 267 } |
268 | 268 |
269 Clock* const clock_; | 269 Clock* const clock_; |
270 const int64_t start_time_; | 270 const int64_t start_time_; |
271 const int64_t scroll_time_; | 271 const int64_t scroll_time_; |
272 const int64_t pause_time_; | 272 const int64_t pause_time_; |
273 const size_t num_frames_; | 273 const size_t num_frames_; |
274 const int target_width_; | 274 const int target_width_; |
275 const int target_height_; | 275 const int target_height_; |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
356 files.push_back(file); | 356 files.push_back(file); |
357 } | 357 } |
358 | 358 |
359 return std::unique_ptr<FrameGenerator>(new ScrollingImageFrameGenerator( | 359 return std::unique_ptr<FrameGenerator>(new ScrollingImageFrameGenerator( |
360 clock, files, source_width, source_height, target_width, target_height, | 360 clock, files, source_width, source_height, target_width, target_height, |
361 scroll_time_ms, pause_time_ms)); | 361 scroll_time_ms, pause_time_ms)); |
362 } | 362 } |
363 | 363 |
364 } // namespace test | 364 } // namespace test |
365 } // namespace webrtc | 365 } // namespace webrtc |
OLD | NEW |