| 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 int32 max; | 11 int32 max; |
| 12 int32 min; | 12 int32 min; |
| 13 int32 current; | 13 int32 current; |
| 14 }; | 14 }; |
| 15 | 15 |
| 16 // https://w3c.github.io/mediacapture-image/#idl-def-MeteringMode | 16 // https://w3c.github.io/mediacapture-image/#idl-def-MeteringMode |
| 17 enum MeteringMode { UNAVAILABLE, MANUAL, SINGLE_SHOT, CONTINUOUS }; | 17 enum MeteringMode { NONE, MANUAL, SINGLE_SHOT, CONTINUOUS }; |
| 18 |
| 19 // https://w3c.github.io/mediacapture-image/#idl-def-FillLightMode |
| 20 enum FillLightMode { NONE, OFF, AUTO, FLASH, TORCH }; |
| 18 | 21 |
| 19 // Equivalent to idl PhotoCapabilities, | 22 // Equivalent to idl PhotoCapabilities, |
| 20 // https://w3c.github.io/mediacapture-image/#photocapabilities | 23 // https://w3c.github.io/mediacapture-image/#photocapabilities |
| 21 struct PhotoCapabilities { | 24 struct PhotoCapabilities { |
| 22 Range iso; | 25 Range iso; |
| 23 Range height; | 26 Range height; |
| 24 Range width; | 27 Range width; |
| 25 Range zoom; | 28 Range zoom; |
| 26 MeteringMode focus_mode; | 29 MeteringMode focus_mode; |
| 27 MeteringMode exposure_mode; | 30 MeteringMode exposure_mode; |
| 28 Range exposure_compensation; | 31 Range exposure_compensation; |
| 29 MeteringMode white_balance_mode; | 32 MeteringMode white_balance_mode; |
| 33 FillLightMode fill_light_mode; |
| 30 }; | 34 }; |
| 31 | 35 |
| 32 // Equivalent to idl Point2D. | 36 // Equivalent to idl Point2D. |
| 33 // TODO(mcasas): use gfx::mojom::PointF after https://crbug.com/640049. | 37 // TODO(mcasas): use gfx::mojom::PointF after https://crbug.com/640049. |
| 34 struct Point2D { | 38 struct Point2D { |
| 35 float x; | 39 float x; |
| 36 float y; | 40 float y; |
| 37 }; | 41 }; |
| 38 | 42 |
| 39 // Equivalent to idl PhotoSettings, | 43 // Equivalent to idl PhotoSettings, |
| (...skipping 11 matching lines...) Expand all Loading... |
| 51 bool has_exposure_mode; | 55 bool has_exposure_mode; |
| 52 MeteringMode exposure_mode; | 56 MeteringMode exposure_mode; |
| 53 bool has_exposure_compensation; | 57 bool has_exposure_compensation; |
| 54 uint32 exposure_compensation; | 58 uint32 exposure_compensation; |
| 55 bool has_white_balance_mode; | 59 bool has_white_balance_mode; |
| 56 MeteringMode white_balance_mode; | 60 MeteringMode white_balance_mode; |
| 57 bool has_iso; | 61 bool has_iso; |
| 58 uint32 iso; | 62 uint32 iso; |
| 59 bool has_red_eye_reduction; | 63 bool has_red_eye_reduction; |
| 60 bool red_eye_reduction; | 64 bool red_eye_reduction; |
| 65 bool has_fill_light_mode; |
| 66 FillLightMode fill_light_mode; |
| 61 array<Point2D> points_of_interest; | 67 array<Point2D> points_of_interest; |
| 62 }; | 68 }; |
| 63 | 69 |
| 64 // This is a mojo move-only equivalent of a Blob, i.e. MIME type and Data. | 70 // This is a mojo move-only equivalent of a Blob, i.e. MIME type and Data. |
| 65 struct Blob { | 71 struct Blob { |
| 66 string mime_type; | 72 string mime_type; |
| 67 array<uint8> data; | 73 array<uint8> data; |
| 68 }; | 74 }; |
| 69 | 75 |
| 70 // |source_id| is the renderer-side UUID identifier of the image capture device. | 76 // |source_id| is the renderer-side UUID identifier of the image capture device. |
| 71 interface ImageCapture | 77 interface ImageCapture |
| 72 { | 78 { |
| 73 // Retrieves the image capture device capabilities and current settings. | 79 // Retrieves the image capture device capabilities and current settings. |
| 74 // https://w3c.github.io/mediacapture-image/index.html#widl-ImageCapture-get
PhotoCapabilities-Promise-PhotoCapabilities | 80 // https://w3c.github.io/mediacapture-image/index.html#widl-ImageCapture-get
PhotoCapabilities-Promise-PhotoCapabilities |
| 75 GetCapabilities(string source_id) | 81 GetCapabilities(string source_id) |
| 76 => (PhotoCapabilities capabilities); | 82 => (PhotoCapabilities capabilities); |
| 77 | 83 |
| 78 // Sets the |settings| on the associated video capture device. | 84 // Sets the |settings| on the associated video capture device. |
| 79 // https://w3c.github.io/mediacapture-image/index.html#widl-ImageCapture-set
Options-Promise-void--PhotoSettings-photoSettings | 85 // https://w3c.github.io/mediacapture-image/index.html#widl-ImageCapture-set
Options-Promise-void--PhotoSettings-photoSettings |
| 80 SetOptions(string source_id, PhotoSettings settings) | 86 SetOptions(string source_id, PhotoSettings settings) |
| 81 => (bool success); | 87 => (bool success); |
| 82 | 88 |
| 83 // Takes a Photo from the given |source_id|, returning it encoded in |blob| | 89 // Takes a Photo from the given |source_id|, returning it encoded in |blob| |
| 84 // with the format specified in its |mime_type|. | 90 // with the format specified in its |mime_type|. |
| 85 // https://w3c.github.io/mediacapture-image/index.html#widl-ImageCapture-tak
ePhoto-Promise-Blob | 91 // https://w3c.github.io/mediacapture-image/index.html#widl-ImageCapture-tak
ePhoto-Promise-Blob |
| 86 TakePhoto(string source_id) | 92 TakePhoto(string source_id) |
| 87 => (Blob blob); | 93 => (Blob blob); |
| 88 }; | 94 }; |
| OLD | NEW |