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

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

Issue 2471613005: [Mojo Video Capture] Use actual factory instances implementing media::VideoCaptureDeviceFactory (Closed)
Patch Set: rebase Created 4 years, 1 month 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
(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_
OLDNEW
« no previous file with comments | « services/video_capture/device_mock_to_media_adapter.cc ('k') | services/video_capture/mock_device_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698