Request.h 6.6 KB

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