1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/dom/webidl/CameraManager.webidl Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,49 @@ 1.4 +/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 1.5 +/* vim: set ts=2 et sw=2 tw=80: */ 1.6 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.7 + * License, v. 2.0. If a copy of the MPL was not distributed with this file, 1.8 + * You can obtain one at http://mozilla.org/MPL/2.0/. 1.9 + */ 1.10 + 1.11 +enum CameraMode { "picture", "video" }; 1.12 + 1.13 +/* Used for the dimensions of a captured picture, 1.14 + a preview stream, a video capture stream, etc. */ 1.15 +dictionary CameraSize 1.16 +{ 1.17 + unsigned long width = 0; 1.18 + unsigned long height = 0; 1.19 +}; 1.20 + 1.21 +/* Pre-emptive camera configuration options. */ 1.22 +dictionary CameraConfiguration 1.23 +{ 1.24 + CameraMode mode = "picture"; 1.25 + CameraSize previewSize = null; 1.26 + DOMString recorderProfile = "cif"; // or some other recording profile 1.27 + // supported by the CameraControl 1.28 +}; 1.29 + 1.30 +callback CameraErrorCallback = void (DOMString error); 1.31 + 1.32 +callback GetCameraCallback = void (CameraControl camera, 1.33 + CameraConfiguration configuration); 1.34 + 1.35 +[Func="nsDOMCameraManager::HasSupport"] 1.36 +interface CameraManager 1.37 +{ 1.38 + /* get a camera instance; 'camera' is one of the camera 1.39 + identifiers returned by getListOfCameras() below. 1.40 + */ 1.41 + [Throws] 1.42 + void getCamera(DOMString camera, 1.43 + CameraConfiguration initialConfiguration, 1.44 + GetCameraCallback callback, 1.45 + optional CameraErrorCallback errorCallback); 1.46 + 1.47 + /* return an array of camera identifiers, e.g. 1.48 + [ "front", "back" ] 1.49 + */ 1.50 + [Throws] 1.51 + sequence<DOMString> getListOfCameras(); 1.52 +};