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