Request.h 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  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. * Returns all enabled output streams.
  88. * @param[out] streams A vector that will be populated with the enabled streams.
  89. *
  90. * @returns success/status of the call.
  91. */
  92. virtual Status getOutputStreams(std::vector<OutputStream*>* streams) const = 0;
  93. /**
  94. * Returns the Stream settings for a particular stream in the request.
  95. * The returned object will have the same lifespan as this object,
  96. * and expose the IStreamSettings interface.
  97. * @param[in] stream The stream for which the settings are requested.
  98. */
  99. virtual InterfaceProvider* getStreamSettings(const OutputStream* stream) = 0;
  100. /**
  101. * Returns the capture control settings for a given AC.
  102. * The returned object will have the same lifespan as this object,
  103. * and expose the IAutoControlSettings interface.
  104. * @param[in] acId The id of the AC component for which the settings are requested.
  105. * <b>(Currently unused)</b>
  106. */
  107. virtual InterfaceProvider* getAutoControlSettings(const AutoControlId acId = 0) = 0;
  108. /**
  109. * Returns the source settings for the request.
  110. * The returned object will have the same lifespan as this object,
  111. * and expose the ISourceSettings interface.
  112. */
  113. virtual InterfaceProvider* getSourceSettings() = 0;
  114. /**
  115. * Sets the client data for the request. This value is passed through to and queryable
  116. * from the CaptureMetadata generated for any captures completed using this Request.
  117. * Default value is 0.
  118. * @param[in] data The client data.
  119. */
  120. virtual Status setClientData(uint32_t data) = 0;
  121. /**
  122. * Gets the client data for the request.
  123. */
  124. virtual uint32_t getClientData() const = 0;
  125. /**
  126. * Set this if need 2 simultaneous outputs i.e. YUV and RGBA
  127. */
  128. virtual Status setPixelFormatType(const PixelFormatType& pixelFormatType) = 0;
  129. /**
  130. * Check if 2 simultaneous outputs are needed
  131. */
  132. virtual PixelFormatType getPixelFormatType() const = 0;
  133. /**
  134. * Set the output port for RGBA output
  135. */
  136. virtual Status setCVOutput(const CVOutput& cvOutput) = 0;
  137. /**
  138. * Get output port for RGBA output
  139. */
  140. virtual CVOutput getCVOutput() const = 0;
  141. /**
  142. * Set this to false if o/p buffer is Bayer and ISP stage needs to be skipped
  143. */
  144. virtual Status setEnableIspStage(bool enableIspStage) = 0;
  145. /**
  146. * Check if ISP stage is enabled/disabled.
  147. */
  148. virtual bool getEnableIspStage() const = 0;
  149. protected:
  150. ~IRequest() {}
  151. };
  152. } // namespace Argus
  153. #endif // _ARGUS_REQUEST_H