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.
6 namespace webcamPrivate
{
7 enum PanDirection
{ stop
, right
, left
};
8 enum TiltDirection
{ stop
, up
, down
};
9 enum Protocol
{ visca
};
11 dictionary ProtocolConfiguration
{
15 dictionary WebcamConfiguration
{
18 PanDirection? panDirection
;
21 TiltDirection? tiltDirection
;
25 callback WebcamIdCallback
= void(DOMString webcamId
);
26 callback WebcamConfigurationCallback
=
27 void(WebcamConfiguration configuration
);
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
);