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_MEDIA_TO_MOJO_ADAPTER_H_ | 5 #ifndef SERVICES_VIDEO_CAPTURE_DEVICE_MEDIA_TO_MOJO_ADAPTER_H_ |
6 #define SERVICES_VIDEO_CAPTURE_DEVICE_MEDIA_TO_MOJO_ADAPTER_H_ | 6 #define SERVICES_VIDEO_CAPTURE_DEVICE_MEDIA_TO_MOJO_ADAPTER_H_ |
7 | 7 |
8 #include "media/capture/video/video_capture_device.h" | 8 #include "media/capture/video/video_capture_device.h" |
9 #include "media/capture/video/video_capture_device_client.h" | 9 #include "media/capture/video/video_capture_device_client.h" |
10 #include "media/capture/video_capture_types.h" | 10 #include "media/capture/video_capture_types.h" |
11 #include "services/video_capture/public/interfaces/device.mojom.h" | 11 #include "services/video_capture/public/interfaces/device.mojom.h" |
12 | 12 |
13 namespace video_capture { | 13 namespace video_capture { |
14 | 14 |
15 // Implementation of mojom::Device backed by a given instance of | 15 // Implementation of mojom::Device backed by a given instance of |
16 // media::VideoCaptureDevice. | 16 // media::VideoCaptureDevice. |
17 class DeviceMediaToMojoAdapter : public mojom::Device { | 17 class DeviceMediaToMojoAdapter : public mojom::Device { |
18 public: | 18 public: |
19 DeviceMediaToMojoAdapter(std::unique_ptr<media::VideoCaptureDevice> device, | 19 DeviceMediaToMojoAdapter(std::unique_ptr<media::VideoCaptureDevice> device, |
20 const media::VideoCaptureJpegDecoderFactoryCB& | 20 const media::VideoCaptureJpegDecoderFactoryCB& |
21 jpeg_decoder_factory_callback); | 21 jpeg_decoder_factory_callback); |
22 ~DeviceMediaToMojoAdapter() override; | 22 ~DeviceMediaToMojoAdapter() override; |
23 | 23 |
24 // mojom::Device: | 24 // mojom::Device: |
25 void Start(const CaptureSettings& requested_settings, | 25 void Start(const media::VideoCaptureParams& requested_settings, |
26 mojom::ReceiverPtr receiver) override; | 26 mojom::ReceiverPtr receiver) override; |
27 | 27 |
28 void Stop(); | 28 void Stop(); |
29 | 29 |
30 void OnClientConnectionErrorOrClose(); | 30 void OnClientConnectionErrorOrClose(); |
31 | 31 |
32 private: | 32 private: |
33 const std::unique_ptr<media::VideoCaptureDevice> device_; | 33 const std::unique_ptr<media::VideoCaptureDevice> device_; |
34 media::VideoCaptureJpegDecoderFactoryCB jpeg_decoder_factory_callback_; | 34 media::VideoCaptureJpegDecoderFactoryCB jpeg_decoder_factory_callback_; |
35 bool device_running_; | 35 bool device_running_; |
36 }; | 36 }; |
37 | 37 |
38 } // namespace video_capture | 38 } // namespace video_capture |
39 | 39 |
40 #endif // SERVICES_VIDEO_CAPTURE_DEVICE_MEDIA_TO_MOJO_ADAPTER_H_ | 40 #endif // SERVICES_VIDEO_CAPTURE_DEVICE_MEDIA_TO_MOJO_ADAPTER_H_ |
OLD | NEW |