michael@0: /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* vim: set ts=2 et sw=2 tw=80: */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this file, michael@0: * You can obtain one at http://mozilla.org/MPL/2.0/. michael@0: */ michael@0: michael@0: enum CameraMode { "picture", "video" }; michael@0: michael@0: /* Used for the dimensions of a captured picture, michael@0: a preview stream, a video capture stream, etc. */ michael@0: dictionary CameraSize michael@0: { michael@0: unsigned long width = 0; michael@0: unsigned long height = 0; michael@0: }; michael@0: michael@0: /* Pre-emptive camera configuration options. */ michael@0: dictionary CameraConfiguration michael@0: { michael@0: CameraMode mode = "picture"; michael@0: CameraSize previewSize = null; michael@0: DOMString recorderProfile = "cif"; // or some other recording profile michael@0: // supported by the CameraControl michael@0: }; michael@0: michael@0: callback CameraErrorCallback = void (DOMString error); michael@0: michael@0: callback GetCameraCallback = void (CameraControl camera, michael@0: CameraConfiguration configuration); michael@0: michael@0: [Func="nsDOMCameraManager::HasSupport"] michael@0: interface CameraManager michael@0: { michael@0: /* get a camera instance; 'camera' is one of the camera michael@0: identifiers returned by getListOfCameras() below. michael@0: */ michael@0: [Throws] michael@0: void getCamera(DOMString camera, michael@0: CameraConfiguration initialConfiguration, michael@0: GetCameraCallback callback, michael@0: optional CameraErrorCallback errorCallback); michael@0: michael@0: /* return an array of camera identifiers, e.g. michael@0: [ "front", "back" ] michael@0: */ michael@0: [Throws] michael@0: sequence getListOfCameras(); michael@0: };