Chromium Code Reviews| 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 }; | 9 enum Protocol { visca }; |
| 10 | 10 enum InquireType { pan, tilt, zoom }; |
| 11 | |
| 11 dictionary ProtocolConfiguration { | 12 dictionary ProtocolConfiguration { |
| 12 Protocol? protocol; | 13 Protocol? protocol; |
| 13 }; | 14 }; |
| 14 | 15 |
| 15 dictionary WebcamConfiguration { | 16 dictionary WebcamConfiguration { |
| 16 double? pan; | 17 double? pan; |
| 17 PanDirection? panDirection; | 18 PanDirection? panDirection; |
| 18 double? tilt; | 19 double? tilt; |
| 19 TiltDirection? tiltDirection; | 20 TiltDirection? tiltDirection; |
| 20 double? zoom; | 21 double? zoom; |
| 21 }; | 22 }; |
| 22 | 23 |
| 23 callback WebcamIdCallback = void(DOMString webcamId); | 24 callback WebcamIdCallback = void(DOMString webcamId); |
| 24 callback WebcamConfigurationCallback = | 25 callback WebcamConfigurationCallback = void(double value); |
| 25 void(WebcamConfiguration configuration); | |
| 26 | 26 |
| 27 interface Functions { | 27 interface Functions { |
| 28 // Open a serial port that controls a webcam. | 28 // Open a serial port that controls a webcam. |
| 29 static void openSerialWebcam(DOMString path, ProtocolConfiguration protocol, | 29 static void openSerialWebcam(DOMString path, ProtocolConfiguration protocol, |
| 30 WebcamIdCallback callback); | 30 WebcamIdCallback callback); |
| 31 | 31 |
| 32 // Close a serial port connection to a webcam. | 32 // Close a serial port connection to a webcam. |
| 33 static void closeWebcam(DOMString webcamId); | 33 static void closeWebcam(DOMString webcamId); |
| 34 | 34 |
| 35 static void get(DOMString webcamId, WebcamConfigurationCallback callback); | 35 static void get(DOMString webcamId, InquireType type, |
|
Zachary Kuznia
2015/08/19 20:49:44
This API shouldn't change, unless there are perfor
| |
| 36 WebcamConfigurationCallback callback); | |
| 36 static void set(DOMString webcamId, WebcamConfiguration config); | 37 static void set(DOMString webcamId, WebcamConfiguration config); |
| 37 static void reset(DOMString webcamId, WebcamConfiguration config); | 38 static void reset(DOMString webcamId, WebcamConfiguration config); |
| 38 }; | 39 }; |
| 39 }; | 40 }; |
| 40 | 41 |
| OLD | NEW |