OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #ifndef MEDIA_CAPTURE_VIDEO_FAKE_VIDEO_CAPTURE_DEVICE_H_ | 5 #ifndef MEDIA_CAPTURE_VIDEO_FAKE_VIDEO_CAPTURE_DEVICE_H_ |
6 #define MEDIA_CAPTURE_VIDEO_FAKE_VIDEO_CAPTURE_DEVICE_H_ | 6 #define MEDIA_CAPTURE_VIDEO_FAKE_VIDEO_CAPTURE_DEVICE_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
11 #include <string> | 11 #include <string> |
12 | 12 |
13 #include "media/capture/video/video_capture_device.h" | 13 #include "media/capture/video/video_capture_device.h" |
14 | 14 |
15 namespace media { | 15 namespace media { |
16 | 16 |
17 // Encapsulates factory logic to make a working FakeVideoCaptureDevice based | 17 // Encapsulates factory logic to make a working FakeVideoCaptureDevice based |
18 // on a given target OutputMode and frame rate. | 18 // on a given target OutputMode and frame rate. |
19 class CAPTURE_EXPORT FakeVideoCaptureDeviceMaker { | 19 class CAPTURE_EXPORT FakeVideoCaptureDeviceMaker { |
20 public: | 20 public: |
| 21 enum class PixelFormat { |
| 22 I420 = media::PIXEL_FORMAT_I420, |
| 23 Y16 = media::PIXEL_FORMAT_Y16, |
| 24 MJPEG = media::PIXEL_FORMAT_MJPEG |
| 25 }; |
21 enum class DeliveryMode { | 26 enum class DeliveryMode { |
22 USE_DEVICE_INTERNAL_BUFFERS, | 27 USE_DEVICE_INTERNAL_BUFFERS, |
23 USE_CLIENT_PROVIDED_BUFFERS | 28 USE_CLIENT_PROVIDED_BUFFERS |
24 }; | 29 }; |
25 | 30 |
26 static void GetSupportedSizes(std::vector<gfx::Size>* supported_sizes); | 31 static void GetSupportedSizes(std::vector<gfx::Size>* supported_sizes); |
27 | 32 |
28 static std::unique_ptr<VideoCaptureDevice> MakeInstance( | 33 static std::unique_ptr<VideoCaptureDevice> MakeInstance( |
29 VideoPixelFormat pixel_format, | 34 PixelFormat pixel_format, |
30 DeliveryMode delivery_mode, | 35 DeliveryMode delivery_mode, |
31 float frame_rate); | 36 float frame_rate); |
32 }; | 37 }; |
33 | 38 |
34 } // namespace media | 39 } // namespace media |
35 | 40 |
36 #endif // MEDIA_CAPTURE_VIDEO_FAKE_VIDEO_CAPTURE_DEVICE_H_ | 41 #endif // MEDIA_CAPTURE_VIDEO_FAKE_VIDEO_CAPTURE_DEVICE_H_ |
OLD | NEW |