| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |