OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 // Webcam Private API. | 5 // Webcam Private API. |
6 namespace webcamPrivate { | 6 namespace webcamPrivate { |
7 enum PanDirection { stop, right, left }; | 7 enum PanDirection { stop, right, left }; |
8 enum TiltDirection { stop, up, down }; | 8 enum TiltDirection { stop, up, down }; |
| 9 enum Protocol { visca }; |
| 10 |
| 11 dictionary ProtocolConfiguration { |
| 12 Protocol? protocol; |
| 13 }; |
9 | 14 |
10 dictionary WebcamConfiguration { | 15 dictionary WebcamConfiguration { |
11 double? pan; | 16 double? pan; |
12 PanDirection? panDirection; | 17 PanDirection? panDirection; |
13 double? tilt; | 18 double? tilt; |
14 TiltDirection? tiltDirection; | 19 TiltDirection? tiltDirection; |
15 double? zoom; | 20 double? zoom; |
16 }; | 21 }; |
17 | 22 |
| 23 callback WebcamIdCallback = void(DOMString webcamId); |
18 callback WebcamConfigurationCallback = | 24 callback WebcamConfigurationCallback = |
19 void(WebcamConfiguration configuration); | 25 void(WebcamConfiguration configuration); |
20 | 26 |
21 interface Functions { | 27 interface Functions { |
| 28 // Open a serial port that controls a webcam. |
| 29 static void openSerialWebcam(DOMString path, ProtocolConfiguration protocol, |
| 30 WebcamIdCallback callback); |
| 31 |
| 32 // Close a serial port connection to a webcam. |
| 33 static void closeWebcam(DOMString webcamId); |
| 34 |
22 static void get(DOMString webcamId, WebcamConfigurationCallback callback); | 35 static void get(DOMString webcamId, WebcamConfigurationCallback callback); |
23 static void set(DOMString webcamId, WebcamConfiguration config); | 36 static void set(DOMString webcamId, WebcamConfiguration config); |
24 static void reset(DOMString webcamId, WebcamConfiguration config); | 37 static void reset(DOMString webcamId, WebcamConfiguration config); |
25 }; | 38 }; |
26 }; | 39 }; |
27 | 40 |
OLD | NEW |