Chromium Code Reviews| 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 { I420, Y16, MJPEG }; | |
| 21 enum class DeliveryMode { | 22 enum class DeliveryMode { |
| 22 USE_DEVICE_INTERNAL_BUFFERS, | 23 USE_DEVICE_INTERNAL_BUFFERS, |
| 23 USE_CLIENT_PROVIDED_BUFFERS | 24 USE_CLIENT_PROVIDED_BUFFERS |
| 24 }; | 25 }; |
| 25 | 26 |
| 26 static void GetSupportedSizes(std::vector<gfx::Size>* supported_sizes); | 27 static void GetSupportedSizes(std::vector<gfx::Size>* supported_sizes); |
| 27 | 28 |
| 29 static media::VideoPixelFormat TranslateToMediaVideoPixelFormat( | |
| 30 PixelFormat format); | |
|
mcasas
2017/02/22 20:26:33
We already have a |VideoPixelFormat|. I think you
chfremer
2017/02/23 01:14:28
You are right. The reason I added these enum class
| |
| 31 | |
| 28 static std::unique_ptr<VideoCaptureDevice> MakeInstance( | 32 static std::unique_ptr<VideoCaptureDevice> MakeInstance( |
| 29 VideoPixelFormat pixel_format, | 33 PixelFormat pixel_format, |
| 30 DeliveryMode delivery_mode, | 34 DeliveryMode delivery_mode, |
| 31 float frame_rate); | 35 float frame_rate); |
| 32 }; | 36 }; |
| 33 | 37 |
| 34 } // namespace media | 38 } // namespace media |
| 35 | 39 |
| 36 #endif // MEDIA_CAPTURE_VIDEO_FAKE_VIDEO_CAPTURE_DEVICE_H_ | 40 #endif // MEDIA_CAPTURE_VIDEO_FAKE_VIDEO_CAPTURE_DEVICE_H_ |
| OLD | NEW |