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

Side by Side Diff: media/capture/video/fake_video_capture_device_unittest.cc

Issue 2045813003: Decouple capture timestamp and reference time (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Nit fixes Created 4 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "media/capture/video/fake_video_capture_device.h" 5 #include "media/capture/video/fake_video_capture_device.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <memory> 10 #include <memory>
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 new MockBuffer(0, frame_format.ImageAllocationSize())); 94 new MockBuffer(0, frame_format.ImageAllocationSize()));
95 } 95 }
96 void OnIncomingCapturedBuffer(std::unique_ptr<Buffer> buffer, 96 void OnIncomingCapturedBuffer(std::unique_ptr<Buffer> buffer,
97 const VideoCaptureFormat& frame_format, 97 const VideoCaptureFormat& frame_format,
98 base::TimeTicks reference_time, 98 base::TimeTicks reference_time,
99 base::TimeDelta timestamp) { 99 base::TimeDelta timestamp) {
100 frame_cb_.Run(frame_format); 100 frame_cb_.Run(frame_format);
101 } 101 }
102 void OnIncomingCapturedVideoFrame( 102 void OnIncomingCapturedVideoFrame(
103 std::unique_ptr<Buffer> buffer, 103 std::unique_ptr<Buffer> buffer,
104 const scoped_refptr<media::VideoFrame>& frame, 104 const scoped_refptr<media::VideoFrame>& frame) {
105 base::TimeTicks reference_time) {
106 VideoCaptureFormat format(frame->natural_size(), 30.0, 105 VideoCaptureFormat format(frame->natural_size(), 30.0,
107 PIXEL_FORMAT_I420); 106 PIXEL_FORMAT_I420);
108 frame_cb_.Run(format); 107 frame_cb_.Run(format);
109 } 108 }
110 std::unique_ptr<Buffer> ResurrectLastOutputBuffer( 109 std::unique_ptr<Buffer> ResurrectLastOutputBuffer(
111 const gfx::Size& dimensions, 110 const gfx::Size& dimensions,
112 media::VideoPixelFormat format, 111 media::VideoPixelFormat format,
113 media::VideoPixelStorage storage) { 112 media::VideoPixelStorage storage) {
114 return std::unique_ptr<Buffer>(); 113 return std::unique_ptr<Buffer>();
115 } 114 }
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
327 } 326 }
328 } 327 }
329 328
330 INSTANTIATE_TEST_CASE_P(, 329 INSTANTIATE_TEST_CASE_P(,
331 FakeVideoCaptureDeviceCommandLineTest, 330 FakeVideoCaptureDeviceCommandLineTest,
332 Values(CommandLineTestData{"fps=-1", 5}, 331 Values(CommandLineTestData{"fps=-1", 5},
333 CommandLineTestData{"fps=29.97", 29.97f}, 332 CommandLineTestData{"fps=29.97", 29.97f},
334 CommandLineTestData{"fps=60", 60}, 333 CommandLineTestData{"fps=60", 60},
335 CommandLineTestData{"fps=1000", 60})); 334 CommandLineTestData{"fps=1000", 60}));
336 }; // namespace media 335 }; // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698