Libargus API
Libargus Camera API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Request.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2016-2022, 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 /**
30  * @file
31  * <b>Libargus API: Request API</b>
32  *
33  * @b Description: Defines the Request object and core IRequest interface.
34  */
35 
36 #ifndef _ARGUS_REQUEST_H
37 #define _ARGUS_REQUEST_H
38 
39 namespace Argus
40 {
41 
42 /**
43  * Container for all settings used by a single capture request.
44  *
45  * @defgroup ArgusRequest Request
46  * @ingroup ArgusObjects
47  */
48 class Request : public InterfaceProvider, public Destructable
49 {
50 protected:
51  ~Request() {}
52 };
53 
54 /**
55  * @class IRequest
56  *
57  * Interface to the core Request settings.
58  *
59  * @ingroup ArgusRequest
60  *
61  * @defgroup ArgusAutoControlSettings AutoControlSettings
62  * Child auto control settings, returned by IRequest::getAutoControlSettings
63  * @ingroup ArgusRequest
64  *
65  * @defgroup ArgusStreamSettings StreamSettings
66  * Child per-stream settings, returned by IRequest::getStreamSettings
67  * @ingroup ArgusRequest
68  *
69  * @defgroup ArgusSourceSettings SourceSettings
70  * Child source settings, returned by IRequest::getSourceSettings
71  * @ingroup ArgusRequest
72  */
73 DEFINE_UUID(InterfaceID, IID_REQUEST, eb9b3750,fc8d,455f,8e0f,91,b3,3b,d9,4e,c5);
74 class IRequest : public Interface
75 {
76 public:
77  static const InterfaceID& id() { return IID_REQUEST; }
78 
79  /**
80  * Enables the specified output stream.
81  * Captures made with this Request will produce output on that stream.
82  */
83  virtual Status enableOutputStream(OutputStream* stream) = 0;
84 
85  /**
86  * Disables the specified output stream.
87  */
88  virtual Status disableOutputStream(OutputStream* stream) = 0;
89 
90  /**
91  * Disables all output streams.
92  */
93  virtual Status clearOutputStreams() = 0;
94 
95  /**
96  * Enables the specified input stream and stream settings.
97  * Captures made with this Request will produce input on that stream.
98  */
99  virtual Status enableInputStream(InputStream *stream, InputStreamSettings *streamSettings) = 0;
100 
101  /**
102  * Disables the specified input stream with the stream settings provided.
103  */
104  virtual Status disableInputStream(InputStream *stream, InputStreamSettings *streamSettings) = 0;
105 
106  /**
107  * Disables all input streams.
108  */
109  virtual Status clearInputStreams() = 0;
110 
111  /**
112  * Returns all enabled output streams.
113  * @param[out] streams A vector that will be populated with the enabled streams.
114  *
115  * @returns success/status of the call.
116  */
117  virtual Status getOutputStreams(std::vector<OutputStream*>* streams) const = 0;
118 
119  /**
120  * Returns all enabled input streams.
121  * @param[out] streams A vector that will be populated with the enabled input streams.
122  *
123  * @returns success/status of the call.
124  */
125  virtual Status getInputStreams(std::vector<InputStream*>* streams) const = 0;
126 
127 
128  /**
129  * Returns the Stream settings for a particular stream in the request.
130  * The returned object will have the same lifespan as this object,
131  * and expose the IStreamSettings interface.
132  * @param[in] stream The stream for which the settings are requested.
133  */
134  virtual InterfaceProvider* getStreamSettings(const OutputStream* stream) = 0;
135 
136  /**
137  * Returns the capture control settings for a given AC.
138  * The returned object will have the same lifespan as this object,
139  * and expose the IAutoControlSettings interface.
140  * @param[in] acId The id of the AC component for which the settings are requested.
141  * <b>(Currently unused)</b>
142  */
143  virtual InterfaceProvider* getAutoControlSettings(const AutoControlId acId = 0) = 0;
144 
145  /**
146  * Returns the source settings for the request.
147  * The returned object will have the same lifespan as this object,
148  * and expose the ISourceSettings interface.
149  */
150  virtual InterfaceProvider* getSourceSettings() = 0;
151 
152  /**
153  * Sets the client data for the request. This value is passed through to and queryable
154  * from the CaptureMetadata generated for any captures completed using this Request.
155  * Default value is 0.
156  * @param[in] data The client data.
157  */
158  virtual Status setClientData(uint32_t data) = 0;
159 
160  /**
161  * Gets the client data for the request.
162  */
163  virtual uint32_t getClientData() const = 0;
164 
165  /**
166  * Set this if need 2 simultaneous outputs i.e. YUV and RGBA
167  */
168  virtual Status setPixelFormatType(const PixelFormatType& pixelFormatType) = 0;
169 
170  /**
171  * Check if 2 simultaneous outputs are needed
172  */
173  virtual PixelFormatType getPixelFormatType() const = 0;
174 
175  /**
176  * Set the output port for RGBA output
177  */
178  virtual Status setCVOutput(const CVOutput& cvOutput) = 0;
179 
180  /**
181  * Get output port for RGBA output
182  */
183  virtual CVOutput getCVOutput() const = 0;
184 
185  /**
186  * Set this to false if o/p buffer is Bayer and ISP stage needs to be skipped
187  */
188  virtual Status setEnableIspStage(bool enableIspStage) = 0;
189 
190  /**
191  * Check if ISP stage is enabled/disabled.
192  */
193  virtual bool getEnableIspStage() const = 0;
194 
195  /**
196  * Set the flag to enable reprocessing mode for this request.
197  */
198  virtual Status setReprocessingEnable(bool enable) = 0;
199 
200 
201 protected:
203 };
204 
205 } // namespace Argus
206 
207 #endif // _ARGUS_REQUEST_H