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 media.mojom; | 5 module media.mojom; |
6 | 6 |
7 // Equivalent to idl MediaSettingsRange, arbitrary range representing the | 7 // Equivalent to idl MediaSettingsRange, arbitrary range representing the |
8 // allowed variations of a Capability or an Option. | 8 // allowed variations of a Capability or an Option. |
9 // https://w3c.github.io/mediacapture-image/#mediasettingsrange | 9 // https://w3c.github.io/mediacapture-image/#mediasettingsrange |
10 struct Range { | 10 struct Range { |
11 uint32 max; | 11 uint32 max; |
12 uint32 min; | 12 uint32 min; |
13 uint32 current; | 13 uint32 current; |
14 }; | 14 }; |
15 | 15 |
16 // https://w3c.github.io/mediacapture-image/#idl-def-FocusMode | 16 // https://w3c.github.io/mediacapture-image/#idl-def-FocusMode |
17 enum FocusMode { UNAVAILABLE, AUTO, MANUAL }; | 17 enum FocusMode { UNAVAILABLE, AUTO, MANUAL }; |
18 | 18 |
19 // Equivalent to idl PhotoCapabilities, | 19 // Equivalent to idl PhotoCapabilities, |
20 // https://w3c.github.io/mediacapture-image/#photocapabilities | 20 // https://w3c.github.io/mediacapture-image/#photocapabilities |
21 struct PhotoCapabilities { | 21 struct PhotoCapabilities { |
| 22 Range iso; |
| 23 Range height; |
| 24 Range width; |
22 Range zoom; | 25 Range zoom; |
23 FocusMode focus_mode; | 26 FocusMode focus_mode; |
24 }; | 27 }; |
25 | 28 |
26 // Equivalent to idl PhotoSettings, | 29 // Equivalent to idl PhotoSettings, |
27 // https://w3c.github.io/mediacapture-image/index.html#photosettings | 30 // https://w3c.github.io/mediacapture-image/index.html#photosettings |
28 struct PhotoSettings { | 31 struct PhotoSettings { |
29 // uint32 cannot be nullable, i.e. uint32? does not work, use instead a flag. | 32 // uint32 cannot be nullable, i.e. uint32? does not work, use instead a flag. |
30 bool has_zoom; | 33 bool has_zoom; |
31 uint32 zoom; | 34 uint32 zoom; |
| 35 bool has_width; |
| 36 uint32 width; |
| 37 bool has_height; |
| 38 uint32 height; |
32 }; | 39 }; |
33 | 40 |
34 // |source_id| is the renderer-side UUID identifier of the image capture device. | 41 // |source_id| is the renderer-side UUID identifier of the image capture device. |
35 interface ImageCapture | 42 interface ImageCapture |
36 { | 43 { |
37 // Retrieves the image capture device capabilities and current settings. | 44 // Retrieves the image capture device capabilities and current settings. |
38 // https://w3c.github.io/mediacapture-image/index.html#widl-ImageCapture-get
PhotoCapabilities-Promise-PhotoCapabilities | 45 // https://w3c.github.io/mediacapture-image/index.html#widl-ImageCapture-get
PhotoCapabilities-Promise-PhotoCapabilities |
39 GetCapabilities(string source_id) | 46 GetCapabilities(string source_id) |
40 => (PhotoCapabilities capabilities); | 47 => (PhotoCapabilities capabilities); |
41 | 48 |
42 // Sets the |settings| on the associated video capture device. | 49 // Sets the |settings| on the associated video capture device. |
43 // https://w3c.github.io/mediacapture-image/index.html#widl-ImageCapture-set
Options-Promise-void--PhotoSettings-photoSettings | 50 // https://w3c.github.io/mediacapture-image/index.html#widl-ImageCapture-set
Options-Promise-void--PhotoSettings-photoSettings |
44 SetOptions(string source_id, PhotoSettings settings) | 51 SetOptions(string source_id, PhotoSettings settings) |
45 => (bool success); | 52 => (bool success); |
46 | 53 |
47 // Takes a Photo from the given |source_id|, returning it encoded in |data| | 54 // Takes a Photo from the given |source_id|, returning it encoded in |data| |
48 // with the format specified in |mime_type|. | 55 // with the format specified in |mime_type|. |
49 // https://w3c.github.io/mediacapture-image/index.html#widl-ImageCapture-tak
ePhoto-Promise-Blob | 56 // https://w3c.github.io/mediacapture-image/index.html#widl-ImageCapture-tak
ePhoto-Promise-Blob |
50 TakePhoto(string source_id) | 57 TakePhoto(string source_id) |
51 => (string mime_type, array<uint8> data); | 58 => (string mime_type, array<uint8> data); |
52 }; | 59 }; |
OLD | NEW |