Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(445)

Side by Side Diff: services/video_capture/mock_device_factory.h

Issue 2386183002: Replace manual conversions with Mojo type mappings
Patch Set: Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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_MOCK_DEVICE_FACTORY_H_ 5 #ifndef SERVICES_VIDEO_CAPTURE_MOCK_DEVICE_FACTORY_H_
6 #define SERVICES_VIDEO_CAPTURE_MOCK_DEVICE_FACTORY_H_ 6 #define SERVICES_VIDEO_CAPTURE_MOCK_DEVICE_FACTORY_H_
7 7
8 #include <map> 8 #include <map>
9 9
10 #include "mojo/public/cpp/bindings/binding.h" 10 #include "mojo/public/cpp/bindings/binding.h"
11 #include "media/capture/video/video_capture_device_factory.h" 11 #include "media/capture/video/video_capture_device_factory.h"
12 #include "services/video_capture/public/interfaces/mock_video_capture_device.moj om.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" 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" 14 #include "services/video_capture/video_capture_device_proxy_impl.h"
15 15
16 namespace video_capture { 16 namespace video_capture {
17 17
18 // Implementation of media::VideoCaptureDeviceFactory that allows clients to 18 // Implementation of media::VideoCaptureDeviceFactory that allows clients to
19 // add mock devices of type mojom::VideoCaptureDeviceDescriptorPtr. 19 // add mock devices of type mojom::VideoCaptureDeviceDescriptorPtr.
20 class MockDeviceFactory : public media::VideoCaptureDeviceFactory { 20 class MockDeviceFactory : public media::VideoCaptureDeviceFactory {
21 public: 21 public:
22 MockDeviceFactory(); 22 MockDeviceFactory();
23 ~MockDeviceFactory() override; 23 ~MockDeviceFactory() override;
24 24
25 void AddMockDevice(mojom::MockVideoCaptureDevicePtr device, 25 void AddMockDevice(mojom::MockVideoCaptureDevicePtr device,
26 mojom::VideoCaptureDeviceDescriptorPtr descriptor); 26 const media::VideoCaptureDeviceDescriptor& descriptor);
27 27
28 // media::VideoCaptureDeviceFactory: 28 // media::VideoCaptureDeviceFactory:
29 std::unique_ptr<media::VideoCaptureDevice> CreateDevice( 29 std::unique_ptr<media::VideoCaptureDevice> CreateDevice(
30 const media::VideoCaptureDeviceDescriptor& device_descriptor) override; 30 const media::VideoCaptureDeviceDescriptor& device_descriptor) override;
31 void GetDeviceDescriptors( 31 void GetDeviceDescriptors(
32 media::VideoCaptureDeviceDescriptors* device_descriptors) override; 32 media::VideoCaptureDeviceDescriptors* device_descriptors) override;
33 void GetSupportedFormats( 33 void GetSupportedFormats(
34 const media::VideoCaptureDeviceDescriptor& device_descriptor, 34 const media::VideoCaptureDeviceDescriptor& device_descriptor,
35 media::VideoCaptureFormats* supported_formats) override; 35 media::VideoCaptureFormats* supported_formats) override;
36 36
37 private: 37 private:
38 std::map<media::VideoCaptureDeviceDescriptor, 38 std::map<media::VideoCaptureDeviceDescriptor,
39 mojom::MockVideoCaptureDevicePtr> 39 mojom::MockVideoCaptureDevicePtr>
40 devices_; 40 devices_;
41 }; 41 };
42 42
43 } // namespace video_capture 43 } // namespace video_capture
44 44
45 #endif // SERVICES_VIDEO_CAPTURE_MOCK_DEVICE_FACTORY_H_ 45 #endif // SERVICES_VIDEO_CAPTURE_MOCK_DEVICE_FACTORY_H_
OLDNEW
« no previous file with comments | « services/video_capture/mock_device_descriptor_receiver.cc ('k') | services/video_capture/mock_device_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698