Chromium Code Reviews| 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, MANUAL, SINGLE_SHOT, CONTINUOUS }; |
| 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; | 22 Range iso; |
| 23 Range height; | 23 Range height; |
| 24 Range width; | 24 Range width; |
| 25 Range zoom; | 25 Range zoom; |
| 26 FocusMode focus_mode; | 26 FocusMode focus_mode; |
| 27 }; | 27 }; |
| 28 | 28 |
| 29 // Equivalent to idl PhotoSettings, | 29 // Equivalent to idl PhotoSettings, |
| 30 // https://w3c.github.io/mediacapture-image/index.html#photosettings | 30 // https://w3c.github.io/mediacapture-image/index.html#photosettings |
| 31 struct PhotoSettings { | 31 struct PhotoSettings { |
| 32 // 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. |
| 33 bool has_zoom; | 33 bool has_zoom; |
| 34 uint32 zoom; | 34 uint32 zoom; |
| 35 bool has_width; | 35 bool has_width; |
| 36 uint32 width; | 36 uint32 width; |
| 37 bool has_height; | 37 bool has_height; |
| 38 uint32 height; | 38 uint32 height; |
| 39 bool has_focus_mode; | |
| 40 FocusMode focus_mode; | |
|
Tom Sepez
2016/08/15 22:27:55
Would Mojom's optional member feature be more appr
mcasas
2016/08/15 22:58:54
Enum suffers from the same problem as
integer type
| |
| 39 }; | 41 }; |
| 40 | 42 |
| 41 // This is a mojo move-only equivalent of a Blob, i.e. MIME type and Data. | 43 // This is a mojo move-only equivalent of a Blob, i.e. MIME type and Data. |
| 42 struct Blob { | 44 struct Blob { |
| 43 string mime_type; | 45 string mime_type; |
| 44 array<uint8> data; | 46 array<uint8> data; |
| 45 }; | 47 }; |
| 46 | 48 |
| 47 // |source_id| is the renderer-side UUID identifier of the image capture device. | 49 // |source_id| is the renderer-side UUID identifier of the image capture device. |
| 48 interface ImageCapture | 50 interface ImageCapture |
| 49 { | 51 { |
| 50 // Retrieves the image capture device capabilities and current settings. | 52 // Retrieves the image capture device capabilities and current settings. |
| 51 // https://w3c.github.io/mediacapture-image/index.html#widl-ImageCapture-get PhotoCapabilities-Promise-PhotoCapabilities | 53 // https://w3c.github.io/mediacapture-image/index.html#widl-ImageCapture-get PhotoCapabilities-Promise-PhotoCapabilities |
| 52 GetCapabilities(string source_id) | 54 GetCapabilities(string source_id) |
| 53 => (PhotoCapabilities capabilities); | 55 => (PhotoCapabilities capabilities); |
| 54 | 56 |
| 55 // Sets the |settings| on the associated video capture device. | 57 // Sets the |settings| on the associated video capture device. |
| 56 // https://w3c.github.io/mediacapture-image/index.html#widl-ImageCapture-set Options-Promise-void--PhotoSettings-photoSettings | 58 // https://w3c.github.io/mediacapture-image/index.html#widl-ImageCapture-set Options-Promise-void--PhotoSettings-photoSettings |
| 57 SetOptions(string source_id, PhotoSettings settings) | 59 SetOptions(string source_id, PhotoSettings settings) |
| 58 => (bool success); | 60 => (bool success); |
| 59 | 61 |
| 60 // Takes a Photo from the given |source_id|, returning it encoded in |blob| | 62 // Takes a Photo from the given |source_id|, returning it encoded in |blob| |
| 61 // with the format specified in its |mime_type|. | 63 // with the format specified in its |mime_type|. |
| 62 // https://w3c.github.io/mediacapture-image/index.html#widl-ImageCapture-tak ePhoto-Promise-Blob | 64 // https://w3c.github.io/mediacapture-image/index.html#widl-ImageCapture-tak ePhoto-Promise-Blob |
| 63 TakePhoto(string source_id) | 65 TakePhoto(string source_id) |
| 64 => (Blob blob); | 66 => (Blob blob); |
| 65 }; | 67 }; |
| OLD | NEW |