| 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-MeteringMode |
| 17 enum FocusMode { UNAVAILABLE, MANUAL, SINGLE_SHOT, CONTINUOUS }; | 17 enum MeteringMode { 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 MeteringMode focus_mode; |
| 27 MeteringMode exposure_mode; |
| 27 }; | 28 }; |
| 28 | 29 |
| 29 // Equivalent to idl Point2D. | 30 // Equivalent to idl Point2D. |
| 30 // TODO(mcasas): use gfx::mojom::PointF after https://crbug.com/640049. | 31 // TODO(mcasas): use gfx::mojom::PointF after https://crbug.com/640049. |
| 31 struct Point2D { | 32 struct Point2D { |
| 32 float x; | 33 float x; |
| 33 float y; | 34 float y; |
| 34 }; | 35 }; |
| 35 | 36 |
| 36 // Equivalent to idl PhotoSettings, | 37 // Equivalent to idl PhotoSettings, |
| 37 // https://w3c.github.io/mediacapture-image/index.html#photosettings | 38 // https://w3c.github.io/mediacapture-image/index.html#photosettings |
| 38 struct PhotoSettings { | 39 struct PhotoSettings { |
| 39 // uint32 cannot be nullable, i.e. uint32? does not work, use instead a flag. | 40 // uint32 cannot be nullable, i.e. uint32? does not work, use instead a flag. |
| 40 bool has_zoom; | 41 bool has_zoom; |
| 41 uint32 zoom; | 42 uint32 zoom; |
| 42 bool has_width; | 43 bool has_width; |
| 43 uint32 width; | 44 uint32 width; |
| 44 bool has_height; | 45 bool has_height; |
| 45 uint32 height; | 46 uint32 height; |
| 46 bool has_focus_mode; | 47 bool has_focus_mode; |
| 47 FocusMode focus_mode; | 48 MeteringMode focus_mode; |
| 49 bool has_exposure_mode; |
| 50 MeteringMode exposure_mode; |
| 48 array<Point2D> points_of_interest; | 51 array<Point2D> points_of_interest; |
| 49 }; | 52 }; |
| 50 | 53 |
| 51 // This is a mojo move-only equivalent of a Blob, i.e. MIME type and Data. | 54 // This is a mojo move-only equivalent of a Blob, i.e. MIME type and Data. |
| 52 struct Blob { | 55 struct Blob { |
| 53 string mime_type; | 56 string mime_type; |
| 54 array<uint8> data; | 57 array<uint8> data; |
| 55 }; | 58 }; |
| 56 | 59 |
| 57 // |source_id| is the renderer-side UUID identifier of the image capture device. | 60 // |source_id| is the renderer-side UUID identifier of the image capture device. |
| 58 interface ImageCapture | 61 interface ImageCapture |
| 59 { | 62 { |
| 60 // Retrieves the image capture device capabilities and current settings. | 63 // Retrieves the image capture device capabilities and current settings. |
| 61 // https://w3c.github.io/mediacapture-image/index.html#widl-ImageCapture-get
PhotoCapabilities-Promise-PhotoCapabilities | 64 // https://w3c.github.io/mediacapture-image/index.html#widl-ImageCapture-get
PhotoCapabilities-Promise-PhotoCapabilities |
| 62 GetCapabilities(string source_id) | 65 GetCapabilities(string source_id) |
| 63 => (PhotoCapabilities capabilities); | 66 => (PhotoCapabilities capabilities); |
| 64 | 67 |
| 65 // Sets the |settings| on the associated video capture device. | 68 // Sets the |settings| on the associated video capture device. |
| 66 // https://w3c.github.io/mediacapture-image/index.html#widl-ImageCapture-set
Options-Promise-void--PhotoSettings-photoSettings | 69 // https://w3c.github.io/mediacapture-image/index.html#widl-ImageCapture-set
Options-Promise-void--PhotoSettings-photoSettings |
| 67 SetOptions(string source_id, PhotoSettings settings) | 70 SetOptions(string source_id, PhotoSettings settings) |
| 68 => (bool success); | 71 => (bool success); |
| 69 | 72 |
| 70 // Takes a Photo from the given |source_id|, returning it encoded in |blob| | 73 // Takes a Photo from the given |source_id|, returning it encoded in |blob| |
| 71 // with the format specified in its |mime_type|. | 74 // with the format specified in its |mime_type|. |
| 72 // https://w3c.github.io/mediacapture-image/index.html#widl-ImageCapture-tak
ePhoto-Promise-Blob | 75 // https://w3c.github.io/mediacapture-image/index.html#widl-ImageCapture-tak
ePhoto-Promise-Blob |
| 73 TakePhoto(string source_id) | 76 TakePhoto(string source_id) |
| 74 => (Blob blob); | 77 => (Blob blob); |
| 75 }; | 78 }; |
| OLD | NEW |