OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef SERVICES_VIDEO_CAPTURE_MOCK_DEVICE_FACTORY_H_ |
| 6 #define SERVICES_VIDEO_CAPTURE_MOCK_DEVICE_FACTORY_H_ |
| 7 |
| 8 #include <map> |
| 9 |
| 10 #include "media/capture/video/video_capture_device_factory.h" |
| 11 #include "mojo/public/cpp/bindings/binding.h" |
| 12 #include "services/video_capture/public/interfaces/mock_video_capture_device.moj
om.h" |
| 13 #include "services/video_capture/public/interfaces/video_capture_device_descript
or.mojom.h" |
| 14 #include "services/video_capture/video_capture_device_proxy_impl.h" |
| 15 |
| 16 namespace video_capture { |
| 17 |
| 18 // Implementation of media::VideoCaptureDeviceFactory that allows clients to |
| 19 // add mock devices of type mojom::VideoCaptureDeviceDescriptorPtr. |
| 20 class MockDeviceFactory : public media::VideoCaptureDeviceFactory { |
| 21 public: |
| 22 MockDeviceFactory(); |
| 23 ~MockDeviceFactory() override; |
| 24 |
| 25 void AddMockDevice(mojom::MockVideoCaptureDevicePtr device, |
| 26 const media::VideoCaptureDeviceDescriptor& descriptor); |
| 27 |
| 28 // media::VideoCaptureDeviceFactory: |
| 29 std::unique_ptr<media::VideoCaptureDevice> CreateDevice( |
| 30 const media::VideoCaptureDeviceDescriptor& device_descriptor) override; |
| 31 void GetDeviceDescriptors( |
| 32 media::VideoCaptureDeviceDescriptors* device_descriptors) override; |
| 33 void GetSupportedFormats( |
| 34 const media::VideoCaptureDeviceDescriptor& device_descriptor, |
| 35 media::VideoCaptureFormats* supported_formats) override; |
| 36 |
| 37 private: |
| 38 std::map<media::VideoCaptureDeviceDescriptor, |
| 39 mojom::MockVideoCaptureDevicePtr> |
| 40 devices_; |
| 41 }; |
| 42 |
| 43 } // namespace video_capture |
| 44 |
| 45 #endif // SERVICES_VIDEO_CAPTURE_MOCK_DEVICE_FACTORY_H_ |
OLD | NEW |