| 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 |
| 17 enum FocusMode { UNAVAILABLE, AUTO, MANUAL }; |
| 18 |
| 16 // Equivalent to idl PhotoCapabilities, | 19 // Equivalent to idl PhotoCapabilities, |
| 17 // https://w3c.github.io/mediacapture-image/#photocapabilities | 20 // https://w3c.github.io/mediacapture-image/#photocapabilities |
| 18 struct PhotoCapabilities { | 21 struct PhotoCapabilities { |
| 19 Range zoom; | 22 Range zoom; |
| 23 FocusMode focus_mode; |
| 20 }; | 24 }; |
| 21 | 25 |
| 22 // Equivalent to idl PhotoSettings, | 26 // Equivalent to idl PhotoSettings, |
| 23 // https://w3c.github.io/mediacapture-image/index.html#photosettings | 27 // https://w3c.github.io/mediacapture-image/index.html#photosettings |
| 24 struct PhotoSettings { | 28 struct PhotoSettings { |
| 25 // uint32 cannot be nullable, i.e. uint32? does not work, use instead a flag. | 29 // uint32 cannot be nullable, i.e. uint32? does not work, use instead a flag. |
| 26 bool has_zoom; | 30 bool has_zoom; |
| 27 uint32 zoom; | 31 uint32 zoom; |
| 28 }; | 32 }; |
| 29 | 33 |
| 30 // |source_id| is the renderer-side UUID identifier of the image capture device. | 34 // |source_id| is the renderer-side UUID identifier of the image capture device. |
| 31 interface ImageCapture | 35 interface ImageCapture |
| 32 { | 36 { |
| 33 // Retrieves the image capture device capabilities and current settings. | 37 // Retrieves the image capture device capabilities and current settings. |
| 34 // https://w3c.github.io/mediacapture-image/index.html#widl-ImageCapture-get
PhotoCapabilities-Promise-PhotoCapabilities | 38 // https://w3c.github.io/mediacapture-image/index.html#widl-ImageCapture-get
PhotoCapabilities-Promise-PhotoCapabilities |
| 35 GetCapabilities(string source_id) | 39 GetCapabilities(string source_id) |
| 36 => (PhotoCapabilities capabilities); | 40 => (PhotoCapabilities capabilities); |
| 37 | 41 |
| 38 // Sets the |settings| on the associated video capture device. | 42 // Sets the |settings| on the associated video capture device. |
| 39 // https://w3c.github.io/mediacapture-image/index.html#widl-ImageCapture-set
Options-Promise-void--PhotoSettings-photoSettings | 43 // https://w3c.github.io/mediacapture-image/index.html#widl-ImageCapture-set
Options-Promise-void--PhotoSettings-photoSettings |
| 40 SetOptions(string source_id, PhotoSettings settings) | 44 SetOptions(string source_id, PhotoSettings settings) |
| 41 => (bool success); | 45 => (bool success); |
| 42 | 46 |
| 43 // Takes a Photo from the given |source_id|, returning it encoded in |data| | 47 // Takes a Photo from the given |source_id|, returning it encoded in |data| |
| 44 // with the format specified in |mime_type|. | 48 // with the format specified in |mime_type|. |
| 45 // https://w3c.github.io/mediacapture-image/index.html#widl-ImageCapture-tak
ePhoto-Promise-Blob | 49 // https://w3c.github.io/mediacapture-image/index.html#widl-ImageCapture-tak
ePhoto-Promise-Blob |
| 46 TakePhoto(string source_id) | 50 TakePhoto(string source_id) |
| 47 => (string mime_type, array<uint8> data); | 51 => (string mime_type, array<uint8> data); |
| 48 }; | 52 }; |
| OLD | NEW |