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 }; | |
26 enum class DeliveryMode { | 21 enum class DeliveryMode { |
27 USE_DEVICE_INTERNAL_BUFFERS, | 22 USE_DEVICE_INTERNAL_BUFFERS, |
28 USE_CLIENT_PROVIDED_BUFFERS | 23 USE_CLIENT_PROVIDED_BUFFERS |
29 }; | 24 }; |
30 | 25 |
31 static void GetSupportedSizes(std::vector<gfx::Size>* supported_sizes); | 26 static void GetSupportedSizes(std::vector<gfx::Size>* supported_sizes); |
32 | 27 |
33 static std::unique_ptr<VideoCaptureDevice> MakeInstance( | 28 static std::unique_ptr<VideoCaptureDevice> MakeInstance( |
34 PixelFormat pixel_format, | 29 VideoPixelFormat pixel_format, |
35 DeliveryMode delivery_mode, | 30 DeliveryMode delivery_mode, |
36 float frame_rate); | 31 float frame_rate); |
37 }; | 32 }; |
38 | 33 |
39 } // namespace media | 34 } // namespace media |
40 | 35 |
41 #endif // MEDIA_CAPTURE_VIDEO_FAKE_VIDEO_CAPTURE_DEVICE_H_ | 36 #endif // MEDIA_CAPTURE_VIDEO_FAKE_VIDEO_CAPTURE_DEVICE_H_ |
OLD | NEW |