Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / extensions / common / api / webcam_private.idl
blob8095699cd21c103695e3f7ba994324ecdd1b3df2
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
3 // found in the LICENSE file.
5 // Webcam Private API.
6 namespace webcamPrivate {
7 enum PanDirection { stop, right, left };
8 enum TiltDirection { stop, up, down };
9 enum Protocol { visca };
11 dictionary ProtocolConfiguration {
12 Protocol? protocol;
15 dictionary WebcamConfiguration {
16 double? pan;
17 double? panSpeed;
18 PanDirection? panDirection;
19 double? tilt;
20 double? tiltSpeed;
21 TiltDirection? tiltDirection;
22 double? zoom;
25 callback WebcamIdCallback = void(DOMString webcamId);
26 callback WebcamConfigurationCallback =
27 void(WebcamConfiguration configuration);
29 interface Functions {
30 // Open a serial port that controls a webcam.
31 static void openSerialWebcam(DOMString path, ProtocolConfiguration protocol,
32 WebcamIdCallback callback);
34 // Close a serial port connection to a webcam.
35 static void closeWebcam(DOMString webcamId);
37 static void get(DOMString webcamId, WebcamConfigurationCallback callback);
38 static void set(DOMString webcamId, WebcamConfiguration config);
40 // Reset a webcam. Note: the value of the parameter have no effect, it's the
41 // presence of the parameter that matters. E.g.: reset(webcamId, {pan: 0,
42 // tilt: 1}); will reset pan & tilt, but not zoom.
43 static void reset(DOMString webcamId, WebcamConfiguration config);