Argus API Argus Camera API

- Main Page
- Related Pages
- Namespaces
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
CameraProvider.h
Go to the documentation of this file.
1 /*
2 * Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 * * Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 * * Neither the name of NVIDIA CORPORATION nor the names of its
13 * contributors may be used to endorse or promote products derived
14 * from this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
17 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
20 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
21 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
22 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
23 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
24 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 */
28
29 #ifndef _ARGUS_CAMERA_PROVIDER_H
30 #define _ARGUS_CAMERA_PROVIDER_H
31
32
33 namespace Argus
34 {
35
36 /**
37 * A CameraProvider instance provides the entry point to the Argus runtime.
38 * It provides methods for querying the cameras in the system and for
39 * creating camera devices.
40 */
41 class CameraProvider : public InterfaceProvider, public Destructable
42 {
43 public:
44
45 /**
46 * Creates and returns a new Argus CameraProvider.
47 * If a CameraProvider object has already been created,
48 * this method will return a pointer to that object.
49 *
50 * @param[out] status Optional pointer to return success/status of the call.
51 */
52 static CameraProvider* create(Status* status = NULL);
53
54 protected:
55 ~CameraProvider() {}
56 };
57
58 /**
59 * @class ICameraProvider
60 *
61 * The core interface provided by a CameraProvider.
62 */
63 DEFINE_UUID(InterfaceID, IID_CAMERA_PROVIDER, a00f33d7,8564,4226,955c,2d,1b,cd,af,a3,5f);
64
65 class ICameraProvider : public Interface
66 {
67 public:
68 static const InterfaceID& id() { return IID_CAMERA_PROVIDER; }
69
70 /**
71 * Returns whether or not an extension is supported by this Argus implementation.
72 * This is generally used during process initialization to ensure that all required
73 * extensions are present before initializing any CaptureSessions. Note, however,
74 * that having an extension be supported does not imply that the resources or
75 * devices required for that extension are available; standard interface checking
76 * and any other extension-specific runtime checks, as described by the extension
77 * documentation, should always be performed before any extension is used.
78 * @param[in] extension the extension identifier.
79 */
80 virtual bool supportsExtension(const ExtensionName& extension) const = 0;
81
82 /**
83 * Returns the list of camera devices that are exposed by the provider. This
84 * includes devices that may already be in use by active CaptureSessions, and
85 * it's the application's responsibility to check device availability and/or
86 * handle any errors returned when CaptureSession creation fails due to a
87 * device already being in use.
88 * @param[out] devices, a vector that will be populated by the available devices.
89 *
90 * @returns success/status of the call.
91 */
92 virtual Status getCameraDevices(std::vector<CameraDevice*>* devices) const = 0;
93
94 /**
95 * Creates and returns a new CaptureSession using the given device.
96 * STATUS_UNAVAILABLE will be placed into @c status if the device is already in use.
97 * @param[in] devices The device(s) to use for the CaptureSession.
98 * @param[out] status Optional pointer to return success/status of the call.
99 * @returns The new CaptureSession, or NULL if an error occurred.
100 */
101 virtual CaptureSession* createCaptureSession(CameraDevice* device,
102 Status* status = NULL) = 0;
103
104 /**
105 * Creates and returns a new CaptureSession using the given device(s).
106 * STATUS_UNAVAILABLE will be placed into @c status if any of the devices are already in use.
107 * @param[in] devices The device(s) to use for the CaptureSession.
108 * @param[out] status Optional pointer to return success/status of the call.
109 * @returns The new CaptureSession, or NULL if an error occurred.
110 */
111 virtual CaptureSession* createCaptureSession(const std::vector<CameraDevice*>& devices,
112 Status* status = NULL) = 0;
113
114 protected:
115 ~ICameraProvider() {}
116 };
117
118 } // namespace Argus
119
120 #endif // _ARGUS_CAMERA_PROVIDER_H