dom/webidl/CameraManager.webidl

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

     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/.
     6  */
     8 enum CameraMode { "picture", "video" };
    10 /* Used for the dimensions of a captured picture,
    11    a preview stream, a video capture stream, etc. */
    12 dictionary CameraSize
    13 {
    14   unsigned long width = 0;
    15   unsigned long height = 0;
    16 };
    18 /* Pre-emptive camera configuration options. */
    19 dictionary CameraConfiguration
    20 {
    21   CameraMode mode = "picture";
    22   CameraSize previewSize = null;
    23   DOMString recorderProfile = "cif";  // or some other recording profile
    24                                       // supported by the CameraControl
    25 };
    27 callback CameraErrorCallback = void (DOMString error);
    29 callback GetCameraCallback = void (CameraControl camera,
    30                                    CameraConfiguration configuration);
    32 [Func="nsDOMCameraManager::HasSupport"]
    33 interface CameraManager
    34 {
    35   /* get a camera instance; 'camera' is one of the camera
    36      identifiers returned by getListOfCameras() below.
    37   */
    38   [Throws]
    39   void getCamera(DOMString camera,
    40                  CameraConfiguration initialConfiguration,
    41                  GetCameraCallback callback,
    42                  optional CameraErrorCallback errorCallback);
    44   /* return an array of camera identifiers, e.g.
    45        [ "front", "back" ]
    46    */
    47   [Throws]
    48   sequence<DOMString> getListOfCameras();
    49 };

mercurial