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/.
8 enum CameraMode { "unspecified", "picture", "video" };
10 /* Used for the dimensions of a captured picture,
11 a preview stream, a video capture stream, etc. */
14 unsigned long width = 0;
15 unsigned long height = 0;
18 /* Pre-emptive camera configuration options. */
19 dictionary CameraConfiguration
21 CameraMode mode = "unspecified";
22 CameraSize previewSize = null;
23 DOMString recorderProfile = ""; // one of the profiles reported by
24 // CameraControl.capabilities.recorderProfiles
27 callback CameraErrorCallback = void (DOMString error);
29 callback GetCameraCallback = void (CameraControl camera,
30 CameraConfiguration configuration);
32 [Func="nsDOMCameraManager::HasSupport"]
33 interface CameraManager
35 /* get a camera instance; 'camera' is one of the camera
36 identifiers returned by getListOfCameras() below.
39 void getCamera(DOMString camera,
40 CameraConfiguration initialConfiguration,
41 GetCameraCallback callback,
42 optional CameraErrorCallback errorCallback);
44 /* return an array of camera identifiers, e.g.
48 sequence<DOMString> getListOfCameras();