| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 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 | 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 SERVICES_VIDEO_CAPTURE_TEST_MOCK_DEVICE_FACTORY_H_ | 5 #ifndef SERVICES_VIDEO_CAPTURE_TEST_MOCK_DEVICE_FACTORY_H_ |
| 6 #define SERVICES_VIDEO_CAPTURE_TEST_MOCK_DEVICE_FACTORY_H_ | 6 #define SERVICES_VIDEO_CAPTURE_TEST_MOCK_DEVICE_FACTORY_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 | 9 |
| 10 #include "media/capture/video/video_capture_device_factory.h" | 10 #include "media/capture/video/video_capture_device_factory.h" |
| 11 #include "mojo/public/cpp/bindings/binding.h" | 11 #include "mojo/public/cpp/bindings/binding.h" |
| 12 #include "services/video_capture/device_media_to_mojo_adapter.h" | 12 #include "services/video_capture/device_media_to_mojo_adapter.h" |
| 13 | 13 |
| 14 namespace video_capture { | 14 namespace video_capture { |
| 15 | 15 |
| 16 // Implementation of media::VideoCaptureDeviceFactory that allows clients to | 16 // Implementation of media::VideoCaptureDeviceFactory that allows clients to |
| 17 // add mock devices. | 17 // add mock devices. |
| 18 class MockDeviceFactory : public media::VideoCaptureDeviceFactory { | 18 class MockDeviceFactory : public media::VideoCaptureDeviceFactory { |
| 19 public: | 19 public: |
| 20 MockDeviceFactory(); | 20 MockDeviceFactory(); |
| 21 ~MockDeviceFactory() override; | 21 ~MockDeviceFactory() override; |
| 22 | 22 |
| 23 void AddMockDevice(media::VideoCaptureDevice* device, | 23 void AddMockDevice(media::VideoCaptureDevice* device, |
| 24 const media::VideoCaptureDeviceDescriptor& descriptor); | 24 const media::VideoCaptureDeviceDescriptor& descriptor); |
| 25 | 25 |
| 26 // media::VideoCaptureDeviceFactory: | 26 // media::VideoCaptureDeviceFactory implementation. |
| 27 std::unique_ptr<media::VideoCaptureDevice> CreateDevice( | 27 std::unique_ptr<media::VideoCaptureDevice> CreateDevice( |
| 28 const media::VideoCaptureDeviceDescriptor& device_descriptor) override; | 28 const media::VideoCaptureDeviceDescriptor& device_descriptor) override; |
| 29 void GetDeviceDescriptors( | 29 void GetDeviceDescriptors( |
| 30 media::VideoCaptureDeviceDescriptors* device_descriptors) override; | 30 media::VideoCaptureDeviceDescriptors* device_descriptors) override; |
| 31 void GetSupportedFormats( | 31 void GetSupportedFormats( |
| 32 const media::VideoCaptureDeviceDescriptor& device_descriptor, | 32 const media::VideoCaptureDeviceDescriptor& device_descriptor, |
| 33 media::VideoCaptureFormats* supported_formats) override; | 33 media::VideoCaptureFormats* supported_formats) override; |
| 34 | 34 |
| 35 private: | 35 private: |
| 36 std::map<media::VideoCaptureDeviceDescriptor, media::VideoCaptureDevice*> | 36 std::map<media::VideoCaptureDeviceDescriptor, media::VideoCaptureDevice*> |
| 37 devices_; | 37 devices_; |
| 38 }; | 38 }; |
| 39 | 39 |
| 40 } // namespace video_capture | 40 } // namespace video_capture |
| 41 | 41 |
| 42 #endif // SERVICES_VIDEO_CAPTURE_TEST_MOCK_DEVICE_FACTORY_H_ | 42 #endif // SERVICES_VIDEO_CAPTURE_TEST_MOCK_DEVICE_FACTORY_H_ |
| OLD | NEW |