| Index: services/video_capture/public/interfaces/video_capture_device_descriptor_struct_traits.h
|
| diff --git a/services/video_capture/public/interfaces/video_capture_device_descriptor_struct_traits.h b/services/video_capture/public/interfaces/video_capture_device_descriptor_struct_traits.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..86c74f0d8dc2d11c10ba11f50ff0e2c256f0c087
|
| --- /dev/null
|
| +++ b/services/video_capture/public/interfaces/video_capture_device_descriptor_struct_traits.h
|
| @@ -0,0 +1,66 @@
|
| +// Copyright 2016 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#ifndef SERVICES_VIDEO_CAPTURE_PUBLIC_INTERFACES_VIDEO_CAPTURE_DEVICE_DESCRIPTOR_STRUCT_TRAITS_H_
|
| +#define SERVICES_VIDEO_CAPTURE_PUBLIC_INTERFACES_VIDEO_CAPTURE_DEVICE_DESCRIPTOR_STRUCT_TRAITS_H_
|
| +
|
| +#include "media/capture/video/video_capture_device_descriptor.h"
|
| +#include "services/video_capture/public/interfaces/video_capture_device_descriptor.mojom.h"
|
| +
|
| +namespace mojo {
|
| +
|
| +template <>
|
| +struct EnumTraits<video_capture::mojom::VideoCaptureApi,
|
| + media::VideoCaptureApi> {
|
| + static video_capture::mojom::VideoCaptureApi ToMojom(
|
| + media::VideoCaptureApi input);
|
| + static bool FromMojom(video_capture::mojom::VideoCaptureApi input,
|
| + media::VideoCaptureApi* output);
|
| +};
|
| +
|
| +template <>
|
| +struct EnumTraits<video_capture::mojom::VideoCaptureTransportType,
|
| + media::VideoCaptureTransportType> {
|
| + static video_capture::mojom::VideoCaptureTransportType ToMojom(
|
| + media::VideoCaptureTransportType input);
|
| + static bool FromMojom(video_capture::mojom::VideoCaptureTransportType input,
|
| + media::VideoCaptureTransportType* output);
|
| +};
|
| +
|
| +template <>
|
| +struct StructTraits<video_capture::mojom::VideoCaptureDeviceDescriptorDataView,
|
| + media::VideoCaptureDeviceDescriptor> {
|
| + static const std::string& display_name(
|
| + const media::VideoCaptureDeviceDescriptor& input) {
|
| + return input.display_name;
|
| + }
|
| +
|
| + static const std::string& device_id(
|
| + const media::VideoCaptureDeviceDescriptor& input) {
|
| + return input.device_id;
|
| + }
|
| +
|
| + static const std::string& model_id(
|
| + const media::VideoCaptureDeviceDescriptor& input) {
|
| + return input.model_id;
|
| + }
|
| +
|
| + static media::VideoCaptureApi capture_api(
|
| + const media::VideoCaptureDeviceDescriptor& input) {
|
| + return input.capture_api;
|
| + }
|
| +
|
| + static media::VideoCaptureTransportType transport_type(
|
| + const media::VideoCaptureDeviceDescriptor& input) {
|
| + return input.transport_type;
|
| + }
|
| +
|
| + static bool Read(
|
| + video_capture::mojom::VideoCaptureDeviceDescriptorDataView data,
|
| + media::VideoCaptureDeviceDescriptor* output);
|
| +};
|
| +
|
| +} // namespace mojo
|
| +
|
| +#endif // SERVICES_VIDEO_CAPTURE_PUBLIC_INTERFACES_VIDEO_CAPTURE_DEVICE_DESCRIPTOR_STRUCT_TRAITS_H_
|
|
|