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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 EXPECT_GT(dimensions.GetArea(), 0); | 89 EXPECT_GT(dimensions.GetArea(), 0); |
90 const VideoCaptureFormat frame_format(dimensions, 0.0, format); | 90 const VideoCaptureFormat frame_format(dimensions, 0.0, format); |
91 return base::MakeUnique<MockBuffer>(0, frame_format.ImageAllocationSize()); | 91 return base::MakeUnique<MockBuffer>(0, frame_format.ImageAllocationSize()); |
92 } | 92 } |
93 void OnIncomingCapturedBuffer(std::unique_ptr<Buffer> buffer, | 93 void OnIncomingCapturedBuffer(std::unique_ptr<Buffer> buffer, |
94 const VideoCaptureFormat& frame_format, | 94 const VideoCaptureFormat& frame_format, |
95 base::TimeTicks reference_time, | 95 base::TimeTicks reference_time, |
96 base::TimeDelta timestamp) { | 96 base::TimeDelta timestamp) { |
97 frame_cb_.Run(frame_format); | 97 frame_cb_.Run(frame_format); |
98 } | 98 } |
99 void OnIncomingCapturedVideoFrame( | 99 void OnIncomingCapturedVideoFrame(std::unique_ptr<Buffer> buffer, |
100 std::unique_ptr<Buffer> buffer, | 100 scoped_refptr<media::VideoFrame> frame) { |
101 const scoped_refptr<media::VideoFrame>& frame) { | |
102 VideoCaptureFormat format(frame->natural_size(), 30.0, | 101 VideoCaptureFormat format(frame->natural_size(), 30.0, |
103 PIXEL_FORMAT_I420); | 102 PIXEL_FORMAT_I420); |
104 frame_cb_.Run(format); | 103 frame_cb_.Run(format); |
105 } | 104 } |
106 std::unique_ptr<Buffer> ResurrectLastOutputBuffer( | 105 std::unique_ptr<Buffer> ResurrectLastOutputBuffer( |
107 const gfx::Size& dimensions, | 106 const gfx::Size& dimensions, |
108 media::VideoPixelFormat format, | 107 media::VideoPixelFormat format, |
109 media::VideoPixelStorage storage) { | 108 media::VideoPixelStorage storage) { |
110 return std::unique_ptr<Buffer>(); | 109 return std::unique_ptr<Buffer>(); |
111 } | 110 } |
(...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
468 INSTANTIATE_TEST_CASE_P( | 467 INSTANTIATE_TEST_CASE_P( |
469 , | 468 , |
470 FakeVideoCaptureDeviceCommandLineTest, | 469 FakeVideoCaptureDeviceCommandLineTest, |
471 Values(CommandLineTestData{"fps=-1", 5, 1u}, | 470 Values(CommandLineTestData{"fps=-1", 5, 1u}, |
472 CommandLineTestData{"fps=29.97, device-count=1", 29.97f, 1u}, | 471 CommandLineTestData{"fps=29.97, device-count=1", 29.97f, 1u}, |
473 CommandLineTestData{"fps=60, device-count=2", 60, 2u}, | 472 CommandLineTestData{"fps=60, device-count=2", 60, 2u}, |
474 CommandLineTestData{"fps=1000, device-count=-1", 60, 1u}, | 473 CommandLineTestData{"fps=1000, device-count=-1", 60, 1u}, |
475 CommandLineTestData{"device-count=2", 20, 2u}, | 474 CommandLineTestData{"device-count=2", 20, 2u}, |
476 CommandLineTestData{"device-count=0", 20, 1u})); | 475 CommandLineTestData{"device-count=0", 20, 1u})); |
477 }; // namespace media | 476 }; // namespace media |
OLD | NEW |