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

Side by Side Diff: services/video_capture/device_factory_media_to_mojo_adapter.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_DEVICE_FACTORY_MEDIA_TO_MOJO_ADAPTER_H_ 5 #ifndef SERVICES_VIDEO_CAPTURE_DEVICE_FACTORY_MEDIA_TO_MOJO_ADAPTER_H_
6 #define SERVICES_VIDEO_CAPTURE_DEVICE_FACTORY_MEDIA_TO_MOJO_ADAPTER_H_ 6 #define SERVICES_VIDEO_CAPTURE_DEVICE_FACTORY_MEDIA_TO_MOJO_ADAPTER_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"
(...skipping 15 matching lines...) Expand all
26 DeviceFactoryMediaToMojoAdapter( 26 DeviceFactoryMediaToMojoAdapter(
27 std::unique_ptr<media::VideoCaptureDeviceFactory> device_factory, 27 std::unique_ptr<media::VideoCaptureDeviceFactory> device_factory,
28 const media::VideoCaptureJpegDecoderFactoryCB& 28 const media::VideoCaptureJpegDecoderFactoryCB&
29 jpeg_decoder_factory_callback); 29 jpeg_decoder_factory_callback);
30 ~DeviceFactoryMediaToMojoAdapter() override; 30 ~DeviceFactoryMediaToMojoAdapter() override;
31 31
32 // mojom::VideoCaptureDeviceFactory: 32 // mojom::VideoCaptureDeviceFactory:
33 void EnumerateDeviceDescriptors( 33 void EnumerateDeviceDescriptors(
34 const EnumerateDeviceDescriptorsCallback& callback) override; 34 const EnumerateDeviceDescriptorsCallback& callback) override;
35 void GetSupportedFormats( 35 void GetSupportedFormats(
36 mojom::VideoCaptureDeviceDescriptorPtr device_descriptor, 36 const media::VideoCaptureDeviceDescriptor& descriptor,
37 const GetSupportedFormatsCallback& callback) override; 37 const GetSupportedFormatsCallback& callback) override;
38 void CreateDeviceProxy( 38 void CreateDeviceProxy(
39 mojom::VideoCaptureDeviceDescriptorPtr device_descriptor, 39 const media::VideoCaptureDeviceDescriptor& descriptor,
40 mojom::VideoCaptureDeviceProxyRequest proxy_request, 40 mojom::VideoCaptureDeviceProxyRequest proxy_request,
41 const CreateDeviceProxyCallback& callback) override; 41 const CreateDeviceProxyCallback& callback) override;
42 42
43 private: 43 private:
44 struct ActiveDeviceEntry { 44 struct ActiveDeviceEntry {
45 ActiveDeviceEntry(); 45 ActiveDeviceEntry();
46 ~ActiveDeviceEntry(); 46 ~ActiveDeviceEntry();
47 ActiveDeviceEntry(ActiveDeviceEntry&& other); 47 ActiveDeviceEntry(ActiveDeviceEntry&& other);
48 ActiveDeviceEntry& operator=(ActiveDeviceEntry&& other); 48 ActiveDeviceEntry& operator=(ActiveDeviceEntry&& other);
49 49
50 std::unique_ptr<VideoCaptureDeviceProxyImpl> device_proxy; 50 std::unique_ptr<VideoCaptureDeviceProxyImpl> device_proxy;
51 // TODO(chfremer) Use mojo::Binding<> directly instead of unique_ptr<> when 51 // TODO(chfremer) Use mojo::Binding<> directly instead of unique_ptr<> when
52 // mojo::Binding<> supports move operators. 52 // mojo::Binding<> supports move operators.
53 // https://crbug.com/644314 53 // https://crbug.com/644314
54 std::unique_ptr<mojo::Binding<mojom::VideoCaptureDeviceProxy>> binding; 54 std::unique_ptr<mojo::Binding<mojom::VideoCaptureDeviceProxy>> binding;
55 }; 55 };
56 56
57 void OnClientConnectionErrorOrClose(media::VideoCaptureDeviceDescriptor descri ptor); 57 void OnClientConnectionErrorOrClose(media::VideoCaptureDeviceDescriptor descri ptor);
58 58
59 std::unique_ptr<media::VideoCaptureDeviceFactory> device_factory_; 59 std::unique_ptr<media::VideoCaptureDeviceFactory> device_factory_;
60 std::map<media::VideoCaptureDeviceDescriptor, ActiveDeviceEntry> 60 std::map<media::VideoCaptureDeviceDescriptor, ActiveDeviceEntry>
61 active_devices_; 61 active_devices_;
62 media::VideoCaptureJpegDecoderFactoryCB jpeg_decoder_factory_callback_; 62 media::VideoCaptureJpegDecoderFactoryCB jpeg_decoder_factory_callback_;
63 }; 63 };
64 64
65 65
66 } // namespace video_capture 66 } // namespace video_capture
67 67
68 #endif // SERVICES_VIDEO_CAPTURE_DEVICE_FACTORY_MEDIA_TO_MOJO_ADAPTER_H_ 68 #endif // SERVICES_VIDEO_CAPTURE_DEVICE_FACTORY_MEDIA_TO_MOJO_ADAPTER_H_
OLDNEW
« no previous file with comments | « services/video_capture/DEPS ('k') | services/video_capture/device_factory_media_to_mojo_adapter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698