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 const VideoCaptureFormat frame_format(dimensions, 0.0, format); | 94 const VideoCaptureFormat frame_format(dimensions, 0.0, format); |
95 return base::MakeUnique<MockBuffer>(0, frame_feedback_id, | 95 return base::MakeUnique<MockBuffer>(0, frame_feedback_id, |
96 frame_format.ImageAllocationSize()); | 96 frame_format.ImageAllocationSize()); |
97 } | 97 } |
98 void OnIncomingCapturedBuffer(std::unique_ptr<Buffer> buffer, | 98 void OnIncomingCapturedBuffer(std::unique_ptr<Buffer> buffer, |
99 const VideoCaptureFormat& format, | 99 const VideoCaptureFormat& format, |
100 base::TimeTicks reference_time, | 100 base::TimeTicks reference_time, |
101 base::TimeDelta timestamp) override { | 101 base::TimeDelta timestamp) override { |
102 frame_cb_.Run(format); | 102 frame_cb_.Run(format); |
103 } | 103 } |
104 void OnIncomingCapturedVideoFrame( | 104 void OnIncomingCapturedBufferExt( |
105 std::unique_ptr<Buffer> buffer, | 105 std::unique_ptr<Buffer> buffer, |
106 scoped_refptr<media::VideoFrame> frame) override { | 106 const VideoCaptureFormat& format, |
107 VideoCaptureFormat format(frame->natural_size(), 30.0, | 107 gfx::Rect visible_rect, |
108 PIXEL_FORMAT_I420); | 108 base::TimeTicks reference_time, |
| 109 base::TimeDelta timestamp, |
| 110 const VideoFrameMetadata& additional_metadata) override { |
109 frame_cb_.Run(format); | 111 frame_cb_.Run(format); |
110 } | 112 } |
111 std::unique_ptr<Buffer> ResurrectLastOutputBuffer( | 113 std::unique_ptr<Buffer> ResurrectLastOutputBuffer( |
112 const gfx::Size& dimensions, | 114 const gfx::Size& dimensions, |
113 media::VideoPixelFormat format, | 115 media::VideoPixelFormat format, |
114 media::VideoPixelStorage storage, | 116 media::VideoPixelStorage storage, |
115 int frame_feedback_id) override { | 117 int frame_feedback_id) override { |
116 return std::unique_ptr<Buffer>(); | 118 return std::unique_ptr<Buffer>(); |
117 } | 119 } |
118 double GetBufferPoolUtilization() const override { return 0.0; } | 120 double GetBufferPoolUtilization() const override { return 0.0; } |
(...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
474 INSTANTIATE_TEST_CASE_P( | 476 INSTANTIATE_TEST_CASE_P( |
475 , | 477 , |
476 FakeVideoCaptureDeviceCommandLineTest, | 478 FakeVideoCaptureDeviceCommandLineTest, |
477 Values(CommandLineTestData{"fps=-1", 5, 1u}, | 479 Values(CommandLineTestData{"fps=-1", 5, 1u}, |
478 CommandLineTestData{"fps=29.97, device-count=1", 29.97f, 1u}, | 480 CommandLineTestData{"fps=29.97, device-count=1", 29.97f, 1u}, |
479 CommandLineTestData{"fps=60, device-count=2", 60, 2u}, | 481 CommandLineTestData{"fps=60, device-count=2", 60, 2u}, |
480 CommandLineTestData{"fps=1000, device-count=-1", 60, 1u}, | 482 CommandLineTestData{"fps=1000, device-count=-1", 60, 1u}, |
481 CommandLineTestData{"device-count=2", 20, 2u}, | 483 CommandLineTestData{"device-count=2", 20, 2u}, |
482 CommandLineTestData{"device-count=0", 20, 1u})); | 484 CommandLineTestData{"device-count=0", 20, 1u})); |
483 }; // namespace media | 485 }; // namespace media |
OLD | NEW |