| 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 module video_capture.mojom; | 5 module video_capture.mojom; |
| 6 | 6 |
| 7 import "media/capture/mojo/video_capture_types.mojom"; | 7 import "media/capture/mojo/video_capture_types.mojom"; |
| 8 import "services/video_capture/public/interfaces/video_capture_device_descriptor
.mojom"; |
| 8 import "services/video_capture/public/interfaces/video_capture_device_proxy.mojo
m"; | 9 import "services/video_capture/public/interfaces/video_capture_device_proxy.mojo
m"; |
| 9 | 10 import "services/video_capture/public/interfaces/video_capture_settings.mojom"; |
| 10 enum VideoCaptureApi { | |
| 11 LINUX_V4L2_SINGLE_PLANE, | |
| 12 WIN_MEDIA_FOUNDATION, | |
| 13 WIN_DIRECT_SHOW, | |
| 14 MACOSX_AVFOUNDATION, | |
| 15 MACOSX_DECKLINK, | |
| 16 ANDROID_API1, | |
| 17 ANDROID_API2_LEGACY, | |
| 18 ANDROID_API2_FULL, | |
| 19 ANDROID_API2_LIMITED, | |
| 20 ANDROID_TANGO, | |
| 21 UNKNOWN | |
| 22 }; | |
| 23 | |
| 24 enum VideoCaptureTransportType { | |
| 25 // For MACOSX_AVFOUNDATION Api, identifies devices that are built-in or USB. | |
| 26 MACOSX_USB_OR_BUILT_IN, | |
| 27 OTHER_TRANSPORT | |
| 28 }; | |
| 29 | 11 |
| 30 enum DeviceAccessResultCode { | 12 enum DeviceAccessResultCode { |
| 31 NOT_INITIALIZED, | 13 NOT_INITIALIZED, |
| 32 SUCCESS, | 14 SUCCESS, |
| 33 ERROR_DEVICE_NOT_FOUND | 15 ERROR_DEVICE_NOT_FOUND |
| 34 }; | 16 }; |
| 35 | 17 |
| 36 struct VideoCaptureDeviceDescriptor { | 18 // Enables access to a set of video capture devices. |
| 37 string display_name; | |
| 38 string device_id; | |
| 39 string model_id; | |
| 40 VideoCaptureApi capture_api; | |
| 41 VideoCaptureTransportType transport_type; | |
| 42 }; | |
| 43 | |
| 44 // Entry point for accessing video capture devices available on the machine. | |
| 45 // Typical operation is to first call EnumerateDeviceDescriptors() to obtain | 19 // Typical operation is to first call EnumerateDeviceDescriptors() to obtain |
| 46 // information about available devices. The obtained descriptors can then be | 20 // information about available devices. The obtained descriptors can then be |
| 47 // used to either obtain the supported formats of a device using | 21 // used to either obtain the supported formats for a device using |
| 48 // GetSupportedFormats(), or to create an instance of VideoCaptureDevice for | 22 // GetSupportedFormats(), or to create an instance of VideoCaptureDevice for |
| 49 // the device using CreateDevice(). | 23 // the device using CreateDevice(). |
| 50 // TODO(chfremer): Consider using a simple string identifier instead of a | 24 // TODO(chfremer): Consider using a simple string identifier instead of a |
| 51 // VideoCaptureDeviceDescriptor. | 25 // VideoCaptureDeviceDescriptor. |
| 52 // https://crbug.com/637439 | 26 // https://crbug.com/637439 |
| 53 interface VideoCaptureDeviceFactory { | 27 interface VideoCaptureDeviceFactory { |
| 54 EnumerateDeviceDescriptors() | 28 EnumerateDeviceDescriptors() |
| 55 => (array<VideoCaptureDeviceDescriptor> descriptors); | 29 => (array<VideoCaptureDeviceDescriptor> descriptors); |
| 56 | 30 |
| 57 GetSupportedFormats(VideoCaptureDeviceDescriptor device_descriptor) | 31 GetSupportedFormats(VideoCaptureDeviceDescriptor device_descriptor) |
| 58 => (array<media.mojom.VideoCaptureFormat> supported_formats); | 32 => (array<VideoCaptureFormat> supported_formats); |
| 59 | 33 |
| 60 // Provides exclusive access to the device identified by |device_descriptor|. | 34 // Provides exclusive access to the device identified by |device_descriptor|. |
| 61 // The access is valid until either the message pipe associated with | 35 // The access is valid until either the message pipe associated with |
| 62 // |proxy_request| is closed by the client, or a subsequent call to | 36 // |proxy_request| is closed by the client, or a subsequent call to |
| 63 // CreateDeviceProxy() is made. | 37 // CreateDeviceProxy() is made. |
| 64 CreateDeviceProxy(VideoCaptureDeviceDescriptor device_descriptor, | 38 CreateDeviceProxy(VideoCaptureDeviceDescriptor device_descriptor, |
| 65 VideoCaptureDeviceProxy& proxy_request) | 39 VideoCaptureDeviceProxy& proxy_request) |
| 66 => (DeviceAccessResultCode result_code); | 40 => (DeviceAccessResultCode result_code); |
| 67 }; | 41 }; |
| OLD | NEW |