Argus API
Argus Camera API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Request.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_REQUEST_H
30 #define _ARGUS_REQUEST_H
31 
32 namespace Argus
33 {
34 
35 /**
36  * A Request defines the parameters to configure the capture.
37  * It will expose the IRequest interface.
38  */
39 class Request : public InterfaceProvider, public Destructable
40 {
41 protected:
42  ~Request() {}
43 };
44 
45 /**
46  * @class IRequest
47  *
48  * Defines the interface to a capture Request.
49  */
50 DEFINE_UUID(InterfaceID, IID_REQUEST, eb9b3750,fc8d,455f,8e0f,91,b3,3b,d9,4e,c5);
51 
52 class IRequest : public Interface
53 {
54 public:
55  static const InterfaceID& id() { return IID_REQUEST; }
56 
57  /**
58  * Enables the specified output stream.
59  * Captures made with this Request will produce output on that stream.
60  */
61  virtual Status enableOutputStream(OutputStream* stream) = 0;
62 
63  /**
64  * Disables the specified output stream.
65  */
66  virtual Status disableOutputStream(OutputStream* stream) = 0;
67 
68  /**
69  * Disables all output streams.
70  */
71  virtual Status clearOutputStreams() = 0;
72 
73  /**
74  * Returns all enabled output streams.
75  * @param[out] streams, a vector that will be populated with the enabled streams.
76  *
77  * @returns success/status of the call.
78  */
79  virtual Status getOutputStreams(std::vector<OutputStream*>* streams) const = 0;
80 
81  /**
82  * Returns the Stream settings for a particular stream in the request.
83  * The returned object will have the same lifespan as this object,
84  * and expose the IStreamSettings interface.
85  * @param[in] stream The stream for which the settings are requested.
86  */
87  virtual InterfaceProvider* getStreamSettings(const OutputStream* stream) = 0;
88 
89  /**
90  * Returns the capture control settings for a given AC.
91  * The returned object will have the same lifespan as this object,
92  * and expose the IAutoControlSettings interface.
93  * @param[in] acId The id of the AC component for which the settings are requested.
94  * <b>(Currently unused)</b>
95  *
96  */
97  virtual InterfaceProvider* getAutoControlSettings(const AutoControlId acId = 0) = 0;
98 
99  /**
100  * Returns the source settings for the request.
101  * The returned object will have the same lifespan as this object,
102  * and expose the ISourceSettings interface.
103  */
104  virtual InterfaceProvider* getSourceSettings() = 0;
105 
106  /**
107  * Sets the client data for the request. This value is passed through to and queryable
108  * from the CaptureMetadata generated for any captures completed using this Request.
109  * Default value is 0.
110  * @param[in] data The client data.
111  */
112  virtual Status setClientData(uint32_t data) = 0;
113 
114  /**
115  * Gets the client data for the request.
116  */
117  virtual uint32_t getClientData() const = 0;
118 
119 protected:
121 };
122 
123 } // namespace Argus
124 
125 #endif // _ARGUS_REQUEST_H