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_DEVICE_CLIENT_MEDIA_TO_MOJO_ADAPTER_H_ | 5 #ifndef SERVICES_VIDEO_CAPTURE_DEVICE_CLIENT_MEDIA_TO_MOJO_MOCK_ADAPTER_H_ |
6 #define SERVICES_VIDEO_CAPTURE_DEVICE_CLIENT_MEDIA_TO_MOJO_ADAPTER_H_ | 6 #define SERVICES_VIDEO_CAPTURE_DEVICE_CLIENT_MEDIA_TO_MOJO_MOCK_ADAPTER_H_ |
7 | 7 |
8 #include "media/capture/video/video_capture_device.h" | 8 #include "media/capture/video/video_capture_device.h" |
9 #include "mojo/public/cpp/bindings/strong_binding.h" | 9 #include "mojo/public/cpp/bindings/strong_binding.h" |
10 #include "services/video_capture/public/interfaces/mock_video_capture_device.moj
om.h" | 10 #include "services/video_capture/public/interfaces/mock_device.mojom.h" |
11 | 11 |
12 namespace video_capture { | 12 namespace video_capture { |
13 | 13 |
14 // Adapter that allows a media::VideoCaptureDevice::Client to be used in place | 14 // Adapter that allows a media::VideoCaptureDevice::Client to be used in place |
15 // of a mojom::MockDeviceClient. Since the implemented interface | 15 // of a mojom::MockDeviceClient. Since the implemented interface |
16 // MockDeviceClient is empty, its purpose is mostly to own the wrapped | 16 // MockDeviceClient is empty, its purpose is mostly to own the wrapped |
17 // instance of media::VideoCaptureDevice::Client and keep it alive until the | 17 // instance of media::VideoCaptureDevice::Client and keep it alive until the |
18 // connection is closed. | 18 // connection is closed. |
19 class DeviceClientMediaToMojoAdapter : public mojom::MockDeviceClient { | 19 class DeviceClientMediaToMojoMockAdapter : public mojom::MockDeviceClient { |
20 public: | 20 public: |
21 ~DeviceClientMediaToMojoAdapter() override; | 21 ~DeviceClientMediaToMojoMockAdapter() override; |
22 | 22 |
23 DeviceClientMediaToMojoAdapter( | 23 DeviceClientMediaToMojoMockAdapter( |
24 std::unique_ptr<media::VideoCaptureDevice::Client> client); | 24 std::unique_ptr<media::VideoCaptureDevice::Client> client); |
25 | 25 |
26 private: | 26 private: |
27 std::unique_ptr<media::VideoCaptureDevice::Client> client_; | 27 std::unique_ptr<media::VideoCaptureDevice::Client> client_; |
28 }; | 28 }; |
29 | 29 |
30 } // namespace video_capture | 30 } // namespace video_capture |
31 | 31 |
32 #endif // SERVICES_VIDEO_CAPTURE_DEVICE_CLIENT_MEDIA_TO_MOJO_ADAPTER_H_ | 32 #endif // SERVICES_VIDEO_CAPTURE_DEVICE_CLIENT_MEDIA_TO_MOJO_MOCK_ADAPTER_H_ |
OLD | NEW |