Jetson Linux API Reference

35.5.0 Release
EGLStream.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2017-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 
36 #ifndef _ARGUS_EGL_STREAM_H
37 #define _ARGUS_EGL_STREAM_H
38 
39 namespace Argus
40 {
41 
83 DEFINE_UUID(StreamType, STREAM_TYPE_EGL, 3a659360,5231,11e7,9598,18,00,20,0c,9a,66);
84 
88 DEFINE_NAMED_UUID_CLASS(EGLStreamMode);
89 DEFINE_UUID(EGLStreamMode, EGL_STREAM_MODE_MAILBOX, 33661d40,3ee2,11e6,bdf4,08,00,20,0c,9a,66);
90 DEFINE_UUID(EGLStreamMode, EGL_STREAM_MODE_FIFO, 33661d41,3ee2,11e6,bdf4,08,00,20,0c,9a,66);
91 
99 DEFINE_UUID(InterfaceID, IID_EGL_OUTPUT_STREAM_SETTINGS, 3a659361,5231,11e7,9598,18,00,20,0c,9a,66);
101 {
102 public:
103  static const InterfaceID& id() { return IID_EGL_OUTPUT_STREAM_SETTINGS; }
104 
109  virtual Status setPixelFormat(const PixelFormat& format) = 0;
110  virtual PixelFormat getPixelFormat() const = 0;
111 
116  virtual Status setResolution(const Size2D<uint32_t>& resolution) = 0;
117  virtual Size2D<uint32_t> getResolution() const = 0;
118 
130  virtual Status setExposureCount(uint32_t exposureCount) = 0;
131  virtual uint32_t getExposureCount() const = 0;
132 
137  virtual Status setEGLDisplay(EGLDisplay eglDisplay) = 0;
138  virtual EGLDisplay getEGLDisplay() const = 0;
139 
178  virtual Status setMode(const EGLStreamMode& mode) = 0;
179  virtual EGLStreamMode getMode() const = 0;
180 
186  virtual Status setFifoLength(uint32_t fifoLength) = 0;
187  virtual uint32_t getFifoLength() const = 0;
188 
198  virtual Status setMetadataEnable(bool metadataEnable) = 0;
199  virtual bool getMetadataEnable() const = 0;
200 
208  virtual bool supportsOutputStreamFormat(const SensorMode* sensorMode,
209  const PixelFormat& outputFormat) const = 0;
210 
211 protected:
213 };
214 
222 DEFINE_UUID(InterfaceID, IID_EGL_OUTPUT_STREAM, 3a659362,5231,11e7,9598,18,00,20,0c,9a,66);
224 {
225 public:
226  static const InterfaceID& id() { return IID_EGL_OUTPUT_STREAM; }
227 
235  virtual Status waitUntilConnected(uint64_t timeout = TIMEOUT_INFINITE) const = 0;
236 
240  virtual void disconnect() = 0;
241 
245  virtual PixelFormat getPixelFormat() const = 0;
246 
250  virtual Size2D<uint32_t> getResolution() const = 0;
251 
255  virtual EGLDisplay getEGLDisplay() const = 0;
256 
260  virtual EGLStreamKHR getEGLStream() const = 0;
261 
262 protected:
264 };
265 
273 DEFINE_UUID(InterfaceID, IID_EGL_INPUT_STREAM_SETTINGS, c3579170,b1ac,11ec,a893,08,00,20,0c,9a,66);
275 {
276 public:
277  static const InterfaceID& id() { return IID_EGL_INPUT_STREAM_SETTINGS; }
278 
283  virtual Status setPixelFormat(const PixelFormat& format) = 0;
284  virtual PixelFormat getPixelFormat() const = 0;
285 
290  virtual Status setResolution(const Size2D<uint32_t>& resolution) = 0;
291  virtual Size2D<uint32_t> getResolution() const = 0;
292 
304  virtual Status setExposureCount(uint32_t exposureCount) = 0;
305  virtual uint32_t getExposureCount() const = 0;
306 
307 
312  virtual Status setEGLDisplay(EGLDisplay eglDisplay) = 0;
313  virtual EGLDisplay getEGLDisplay() const = 0;
314 
335  virtual Status setFifoLength(uint32_t fifoLength) = 0;
336  virtual uint32_t getFifoLength() const = 0;
337 
345  virtual bool supportsInputStreamFormat(const SensorMode* sensorMode,
346  const PixelFormat& inputFormat) const = 0;
347 
348 protected:
350 };
351 
359 DEFINE_UUID(InterfaceID, IID_EGL_INPUT_STREAM, c3579171,b1ac,11ec,a893,08,00,20,0c,9a,66)
361 {
362 public:
363  static const InterfaceID& id() { return IID_EGL_INPUT_STREAM; }
364 
372  virtual Status waitUntilConnected(uint64_t timeout = TIMEOUT_INFINITE) const = 0;
373 
377  virtual void disconnect() = 0;
378 
382  virtual PixelFormat getPixelFormat() const = 0;
383 
387  virtual Size2D<uint32_t> getResolution() const = 0;
388 
392  virtual EGLDisplay getEGLDisplay() const = 0;
393 
397  virtual EGLStreamKHR getEGLStream() const = 0;
398 
399 protected:
401 };
402 
403 } // namespace Argus
404 
405 #endif // _ARGUS_EGL_STREAM_H
Argus::IEGLOutputStream::getResolution
virtual Size2D< uint32_t > getResolution() const =0
Returns the image resolution of the stream, in pixels.
Argus::IEGLOutputStreamSettings::setMetadataEnable
virtual Status setMetadataEnable(bool metadataEnable)=0
Enables or disables embedding Argus CaptureMetadata within frames written to the EGLStream.
Argus::IEGLOutputStreamSettings::getFifoLength
virtual uint32_t getFifoLength() const =0
Argus::DEFINE_NAMED_UUID_CLASS
DEFINE_NAMED_UUID_CLASS(BufferType)
Argus::TIMEOUT_INFINITE
const uint64_t TIMEOUT_INFINITE
Constant used for infinite timeouts.
Definition: Types.h:92
Argus::IEGLInputStreamSettings::setEGLDisplay
virtual Status setEGLDisplay(EGLDisplay eglDisplay)=0
Set the EGLDisplay the created stream must belong to.
Argus::IEGLOutputStream::~IEGLOutputStream
~IEGLOutputStream()
Definition: EGLStream.h:263
Argus::DEFINE_UUID
DEFINE_UUID(ExtensionName, EXT_BAYER_AVERAGE_MAP, 12c3de20, 64c5, 11e6, bdf4, 08, 00, 20, 0c, 9a, 66)
Argus::IEGLInputStreamSettings::getPixelFormat
virtual PixelFormat getPixelFormat() const =0
Argus::IEGLOutputStreamSettings::id
static const InterfaceID & id()
Definition: EGLStream.h:103
Argus::IEGLOutputStreamSettings::setEGLDisplay
virtual Status setEGLDisplay(EGLDisplay eglDisplay)=0
Set the EGLDisplay the created stream must belong to.
Argus
Definition: BayerAverageMap.h:39
Argus::IEGLInputStreamSettings::setResolution
virtual Status setResolution(const Size2D< uint32_t > &resolution)=0
Set the resolution of the stream.
Argus::IEGLOutputStreamSettings::setFifoLength
virtual Status setFifoLength(uint32_t fifoLength)=0
Sets the FIFO queue length of the stream.
Argus::Size2D< uint32_t >
Argus::IEGLOutputStreamSettings::getMetadataEnable
virtual bool getMetadataEnable() const =0
Argus::IEGLOutputStreamSettings::getPixelFormat
virtual PixelFormat getPixelFormat() const =0
Argus::IEGLInputStreamSettings::id
static const InterfaceID & id()
Definition: EGLStream.h:277
Argus::Interface
The top-level interface class.
Definition: Types.h:351
Argus::IEGLOutputStreamSettings::getMode
virtual EGLStreamMode getMode() const =0
Argus::IEGLOutputStreamSettings
Definition: EGLStream.h:100
Argus::IEGLOutputStreamSettings::setResolution
virtual Status setResolution(const Size2D< uint32_t > &resolution)=0
Set the resolution of the stream.
Argus::IEGLInputStream::~IEGLInputStream
~IEGLInputStream()
Definition: EGLStream.h:400
Argus::IEGLOutputStream::getPixelFormat
virtual PixelFormat getPixelFormat() const =0
Returns the format of the stream.
Argus::InterfaceID
A unique identifier for a libargus Interface.
Definition: Types.h:361
Argus::IEGLInputStreamSettings::~IEGLInputStreamSettings
~IEGLInputStreamSettings()
Definition: EGLStream.h:349
Argus::IEGLInputStreamSettings::setFifoLength
virtual Status setFifoLength(uint32_t fifoLength)=0
Sets the FIFO queue length of the stream.
Argus::IEGLInputStream::id
static const InterfaceID & id()
Definition: EGLStream.h:363
Argus::IEGLOutputStreamSettings::supportsOutputStreamFormat
virtual bool supportsOutputStreamFormat(const SensorMode *sensorMode, const PixelFormat &outputFormat) const =0
Argus::IEGLInputStreamSettings
Definition: EGLStream.h:274
Argus::IEGLInputStreamSettings::getEGLDisplay
virtual EGLDisplay getEGLDisplay() const =0
Argus::IEGLOutputStreamSettings::getEGLDisplay
virtual EGLDisplay getEGLDisplay() const =0
Argus::IEGLInputStreamSettings::getResolution
virtual Size2D< uint32_t > getResolution() const =0
Argus::IEGLOutputStreamSettings::setExposureCount
virtual Status setExposureCount(uint32_t exposureCount)=0
Set the number of exposures per stream frame.
Argus::IEGLOutputStream::disconnect
virtual void disconnect()=0
Disconnects the stream from the underlying EGLStream.
Argus::IEGLInputStreamSettings::setExposureCount
virtual Status setExposureCount(uint32_t exposureCount)=0
Set the number of exposures per stream frame.
Argus::IEGLInputStreamSettings::supportsInputStreamFormat
virtual bool supportsInputStreamFormat(const SensorMode *sensorMode, const PixelFormat &inputFormat) const =0
Argus::IEGLOutputStreamSettings::getResolution
virtual Size2D< uint32_t > getResolution() const =0
Argus::IEGLOutputStreamSettings::getExposureCount
virtual uint32_t getExposureCount() const =0
Argus::IEGLOutputStreamSettings::setPixelFormat
virtual Status setPixelFormat(const PixelFormat &format)=0
Set the format of the stream.
Argus::IEGLInputStream
Definition: EGLStream.h:360
Argus::IEGLOutputStream::id
static const InterfaceID & id()
Definition: EGLStream.h:226
Argus::IEGLOutputStreamSettings::setMode
virtual Status setMode(const EGLStreamMode &mode)=0
Sets the mode of the OutputStream.
Argus::IEGLOutputStream::getEGLDisplay
virtual EGLDisplay getEGLDisplay() const =0
Returns the EGLDisplay the stream's EGLStream belongs to.
Argus::IEGLInputStreamSettings::getFifoLength
virtual uint32_t getFifoLength() const =0
Argus::IEGLOutputStream
Definition: EGLStream.h:223
Argus::IEGLOutputStream::getEGLStream
virtual EGLStreamKHR getEGLStream() const =0
Returns the EGLStream backing the stream.
Argus::IEGLOutputStream::waitUntilConnected
virtual Status waitUntilConnected(uint64_t timeout=TIMEOUT_INFINITE) const =0
Waits until both the producer and consumer endpoints of the stream are connected.
Argus::Status
Status
Status values returned by API function calls.
Definition: Types.h:97
Argus::IEGLInputStreamSettings::setPixelFormat
virtual Status setPixelFormat(const PixelFormat &format)=0
Set the format of the stream.
Argus::IEGLOutputStreamSettings::~IEGLOutputStreamSettings
~IEGLOutputStreamSettings()
Definition: EGLStream.h:212
Argus::IEGLInputStreamSettings::getExposureCount
virtual uint32_t getExposureCount() const =0
Argus::SensorMode
Definition: CameraDevice.h:210