Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(76)

Side by Side Diff: media/mojo/interfaces/image_capture.mojom

Issue 2167313002: ImageCapture: introduce image_capture Blob to allow move-only semantics (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 {
(...skipping 13 matching lines...) Expand all
24 }; 24 };
25 25
26 // Equivalent to idl PhotoSettings, 26 // Equivalent to idl PhotoSettings,
27 // https://w3c.github.io/mediacapture-image/index.html#photosettings 27 // https://w3c.github.io/mediacapture-image/index.html#photosettings
28 struct PhotoSettings { 28 struct PhotoSettings {
29 // 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.
30 bool has_zoom; 30 bool has_zoom;
31 uint32 zoom; 31 uint32 zoom;
32 }; 32 };
33 33
34 // This is a mojo move-only equivalent of a Blob, i.e. MIME type and Data.
35 struct Blob {
36 string mime_type;
37 array<uint8> data;
38 };
39
34 // |source_id| is the renderer-side UUID identifier of the image capture device. 40 // |source_id| is the renderer-side UUID identifier of the image capture device.
35 interface ImageCapture 41 interface ImageCapture
36 { 42 {
37 // Retrieves the image capture device capabilities and current settings. 43 // Retrieves the image capture device capabilities and current settings.
38 // https://w3c.github.io/mediacapture-image/index.html#widl-ImageCapture-get PhotoCapabilities-Promise-PhotoCapabilities 44 // https://w3c.github.io/mediacapture-image/index.html#widl-ImageCapture-get PhotoCapabilities-Promise-PhotoCapabilities
39 GetCapabilities(string source_id) 45 GetCapabilities(string source_id)
40 => (PhotoCapabilities capabilities); 46 => (PhotoCapabilities capabilities);
41 47
42 // Sets the |settings| on the associated video capture device. 48 // 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 49 // https://w3c.github.io/mediacapture-image/index.html#widl-ImageCapture-set Options-Promise-void--PhotoSettings-photoSettings
44 SetOptions(string source_id, PhotoSettings settings) 50 SetOptions(string source_id, PhotoSettings settings)
45 => (bool success); 51 => (bool success);
46 52
47 // Takes a Photo from the given |source_id|, returning it encoded in |data| 53 // Takes a Photo from the given |source_id|, returning it encoded in |blob|
48 // with the format specified in |mime_type|. 54 // with the format specified in its |mime_type|.
49 // https://w3c.github.io/mediacapture-image/index.html#widl-ImageCapture-tak ePhoto-Promise-Blob 55 // https://w3c.github.io/mediacapture-image/index.html#widl-ImageCapture-tak ePhoto-Promise-Blob
50 TakePhoto(string source_id) 56 TakePhoto(string source_id)
51 => (string mime_type, array<uint8> data); 57 => (Blob blob);
52 }; 58 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698