2013-05-18 05:48:25 +04:00
|
|
|
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2013-05-10 10:25:25 +04:00
|
|
|
/* vim: set ts=2 et sw=2 tw=80: */
|
2013-05-18 05:48:25 +04:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
|
|
|
* You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
*/
|
|
|
|
|
2014-08-05 21:20:31 +04:00
|
|
|
enum CameraMode { "unspecified", "picture", "video" };
|
2014-02-15 02:41:07 +04:00
|
|
|
|
|
|
|
/* Used for the dimensions of a captured picture,
|
|
|
|
a preview stream, a video capture stream, etc. */
|
|
|
|
dictionary CameraSize
|
|
|
|
{
|
|
|
|
unsigned long width = 0;
|
|
|
|
unsigned long height = 0;
|
|
|
|
};
|
2014-02-14 17:27:44 +04:00
|
|
|
|
2014-02-15 02:41:07 +04:00
|
|
|
/* Pre-emptive camera configuration options. */
|
|
|
|
dictionary CameraConfiguration
|
|
|
|
{
|
2014-08-05 21:20:31 +04:00
|
|
|
CameraMode mode = "unspecified";
|
2014-02-15 02:41:07 +04:00
|
|
|
CameraSize previewSize = null;
|
2014-08-05 21:20:31 +04:00
|
|
|
DOMString recorderProfile = ""; // one of the profiles reported by
|
|
|
|
// CameraControl.capabilities.recorderProfiles
|
2014-02-14 17:27:44 +04:00
|
|
|
};
|
|
|
|
|
2014-02-15 02:41:07 +04:00
|
|
|
callback CameraErrorCallback = void (DOMString error);
|
2014-02-14 17:27:44 +04:00
|
|
|
|
2014-02-15 02:41:07 +04:00
|
|
|
callback GetCameraCallback = void (CameraControl camera,
|
|
|
|
CameraConfiguration configuration);
|
2014-02-14 17:27:44 +04:00
|
|
|
|
2014-04-09 19:53:34 +04:00
|
|
|
[Func="nsDOMCameraManager::HasSupport"]
|
2014-02-15 02:41:07 +04:00
|
|
|
interface CameraManager
|
|
|
|
{
|
|
|
|
/* get a camera instance; 'camera' is one of the camera
|
|
|
|
identifiers returned by getListOfCameras() below.
|
|
|
|
*/
|
2013-05-10 10:25:25 +04:00
|
|
|
[Throws]
|
2014-10-03 12:19:00 +04:00
|
|
|
Promise<CameraGetPromiseData> getCamera(DOMString camera,
|
|
|
|
optional CameraConfiguration initialConfiguration,
|
|
|
|
optional GetCameraCallback callback,
|
|
|
|
optional CameraErrorCallback errorCallback);
|
2013-05-14 14:59:11 +04:00
|
|
|
|
2014-02-15 02:41:07 +04:00
|
|
|
/* return an array of camera identifiers, e.g.
|
|
|
|
[ "front", "back" ]
|
2013-05-14 14:59:11 +04:00
|
|
|
*/
|
2013-05-10 10:25:25 +04:00
|
|
|
[Throws]
|
|
|
|
sequence<DOMString> getListOfCameras();
|
|
|
|
};
|