|
1 /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
|
2 /* vim: set ts=2 et sw=2 tw=80: */ |
|
3 /* This Source Code Form is subject to the terms of the Mozilla Public |
|
4 * License, v. 2.0. If a copy of the MPL was not distributed with this file, |
|
5 * You can obtain one at http://mozilla.org/MPL/2.0/. |
|
6 */ |
|
7 |
|
8 enum CameraMode { "picture", "video" }; |
|
9 |
|
10 /* Used for the dimensions of a captured picture, |
|
11 a preview stream, a video capture stream, etc. */ |
|
12 dictionary CameraSize |
|
13 { |
|
14 unsigned long width = 0; |
|
15 unsigned long height = 0; |
|
16 }; |
|
17 |
|
18 /* Pre-emptive camera configuration options. */ |
|
19 dictionary CameraConfiguration |
|
20 { |
|
21 CameraMode mode = "picture"; |
|
22 CameraSize previewSize = null; |
|
23 DOMString recorderProfile = "cif"; // or some other recording profile |
|
24 // supported by the CameraControl |
|
25 }; |
|
26 |
|
27 callback CameraErrorCallback = void (DOMString error); |
|
28 |
|
29 callback GetCameraCallback = void (CameraControl camera, |
|
30 CameraConfiguration configuration); |
|
31 |
|
32 [Func="nsDOMCameraManager::HasSupport"] |
|
33 interface CameraManager |
|
34 { |
|
35 /* get a camera instance; 'camera' is one of the camera |
|
36 identifiers returned by getListOfCameras() below. |
|
37 */ |
|
38 [Throws] |
|
39 void getCamera(DOMString camera, |
|
40 CameraConfiguration initialConfiguration, |
|
41 GetCameraCallback callback, |
|
42 optional CameraErrorCallback errorCallback); |
|
43 |
|
44 /* return an array of camera identifiers, e.g. |
|
45 [ "front", "back" ] |
|
46 */ |
|
47 [Throws] |
|
48 sequence<DOMString> getListOfCameras(); |
|
49 }; |