2013-05-18 01:48:25 +00:00
|
|
|
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2013-05-10 06:25:25 +00:00
|
|
|
/* vim: set ts=2 et sw=2 tw=80: */
|
2013-05-18 01:48:25 +00: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 17:20:31 +00:00
|
|
|
enum CameraMode { "unspecified", "picture", "video" };
|
2014-02-14 22:41:07 +00: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 13:27:44 +00:00
|
|
|
|
2014-12-13 03:51:29 +00:00
|
|
|
/* Pre-emptive camera configuration options. If 'mode' is set to "unspecified",
|
|
|
|
the camera will not be configured immediately. If the 'mode' is set to
|
|
|
|
"video" or "picture", then the camera automatically configures itself and
|
|
|
|
will be ready for use upon return.
|
|
|
|
|
|
|
|
The remaining parameters are optional and are considered hints by the
|
|
|
|
camera. The application should use the values returned in the
|
|
|
|
GetCameraCallback configuration because while the camera makes a best effort
|
|
|
|
to adhere to the requested values, it may need to change them to ensure
|
|
|
|
optimal behavior.
|
|
|
|
|
|
|
|
If not specified, 'pictureSize' and 'recorderProfile' default to the best or
|
|
|
|
highest resolutions supported by the camera hardware.
|
|
|
|
|
|
|
|
To determine 'previewSize', one should generally provide the size of the
|
|
|
|
element which will contain the preview rather than guess which supported
|
|
|
|
preview size is the best. If not specified, 'previewSize' defaults to the
|
|
|
|
inner window size. */
|
2014-02-14 22:41:07 +00:00
|
|
|
dictionary CameraConfiguration
|
|
|
|
{
|
2014-12-13 03:51:29 +00:00
|
|
|
CameraMode mode = "picture";
|
2014-02-14 22:41:07 +00:00
|
|
|
CameraSize previewSize = null;
|
2014-12-13 03:51:29 +00:00
|
|
|
CameraSize pictureSize = null;
|
|
|
|
|
|
|
|
/* one of the profiles reported by
|
|
|
|
CameraControl.capabilities.recorderProfiles
|
|
|
|
*/
|
|
|
|
DOMString recorderProfile = "default";
|
2014-02-14 13:27:44 +00:00
|
|
|
};
|
|
|
|
|
2014-04-09 15:53:34 +00:00
|
|
|
[Func="nsDOMCameraManager::HasSupport"]
|
2014-02-14 22:41:07 +00:00
|
|
|
interface CameraManager
|
|
|
|
{
|
|
|
|
/* get a camera instance; 'camera' is one of the camera
|
|
|
|
identifiers returned by getListOfCameras() below.
|
|
|
|
*/
|
2013-05-10 06:25:25 +00:00
|
|
|
[Throws]
|
2014-10-03 08:19:00 +00:00
|
|
|
Promise<CameraGetPromiseData> getCamera(DOMString camera,
|
2014-12-11 16:02:51 +00:00
|
|
|
optional CameraConfiguration initialConfiguration);
|
2013-05-14 10:59:11 +00:00
|
|
|
|
2014-02-14 22:41:07 +00:00
|
|
|
/* return an array of camera identifiers, e.g.
|
|
|
|
[ "front", "back" ]
|
2013-05-14 10:59:11 +00:00
|
|
|
*/
|
2013-05-10 06:25:25 +00:00
|
|
|
[Throws]
|
|
|
|
sequence<DOMString> getListOfCameras();
|
|
|
|
};
|