L4T Multimedia API Reference

27.1 Release

 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Stream.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 
37 #ifndef _ARGUS_STREAM_H
38 #define _ARGUS_STREAM_H
39 
51 namespace Argus
52 {
53 
54 DEFINE_NAMED_UUID_CLASS(StreamMode);
55 DEFINE_UUID(StreamMode, STREAM_MODE_MAILBOX, 33661d40,3ee2,11e6,bdf4,08,00,20,0c,9a,66);
56 DEFINE_UUID(StreamMode, STREAM_MODE_FIFO, 33661d41,3ee2,11e6,bdf4,08,00,20,0c,9a,66);
57 
63 {
64 protected:
66 };
67 
73 {
74 protected:
76 };
77 
83 {
84 protected:
86 };
87 
93 DEFINE_UUID(InterfaceID, IID_STREAM, 8f50dade,cc26,4ec6,9d2e,d9,d0,19,2a,ef,06);
94 
95 class IStream : public Interface
96 {
97 public:
98  static const InterfaceID& id() { return IID_STREAM; }
99 
107  virtual Status waitUntilConnected(uint64_t timeout = TIMEOUT_INFINITE) const = 0;
108 
112  virtual void disconnect() = 0;
113 
117  virtual PixelFormat getPixelFormat() const = 0;
118 
122  virtual Size2D<uint32_t> getResolution() const = 0;
123 
127  virtual EGLDisplay getEGLDisplay() const = 0;
128 
132  virtual EGLStreamKHR getEGLStream() const = 0;
133 
134 protected:
135  ~IStream() {}
136 };
137 
143 DEFINE_UUID(InterfaceID, IID_OUTPUT_STREAM_SETTINGS, 52f2b830,3d52,11e6,bdf4,08,00,20,0c,9a,66);
144 
146 {
147 public:
148  static const InterfaceID& id() { return IID_OUTPUT_STREAM_SETTINGS; }
149 
154  virtual Status setPixelFormat(const PixelFormat& format) = 0;
155  virtual PixelFormat getPixelFormat() const = 0;
156 
161  virtual Status setResolution(const Size2D<uint32_t>& resolution) = 0;
162  virtual Size2D<uint32_t> getResolution() const = 0;
163 
168  virtual Status setCameraDevice(CameraDevice* device) = 0;
169  virtual CameraDevice* getCameraDevice() const = 0;
170 
175  virtual Status setEGLDisplay(EGLDisplay eglDisplay) = 0;
176  virtual EGLDisplay getEGLDisplay() const = 0;
177 
216  virtual Status setMode(const StreamMode& mode) = 0;
217  virtual StreamMode getMode() const = 0;
218 
224  virtual Status setFifoLength(uint32_t fifoLength) = 0;
225  virtual uint32_t getFifoLength() const = 0;
226 
234  virtual bool supportsOutputStreamFormat(const SensorMode* sensorMode,
235  const PixelFormat& outputFormat) const = 0;
236 
237 protected:
239 };
240 
241 } // namespace Argus
243 #endif // _ARGUS_STREAM_H
virtual EGLDisplay getEGLDisplay() const =0
Returns the EGLDisplay the stream's EGLStream belongs to.
static const InterfaceID & id()
Definition: Stream.h:98
The base interface for a class that provides libargus Interfaces.
Definition: Types.h:361
virtual bool supportsOutputStreamFormat(const SensorMode *sensorMode, const PixelFormat &outputFormat) const =0
Returns True if the output pixel format is supported by the CaptureSession for the queried sensor mod...
virtual Status setCameraDevice(CameraDevice *device)=0
Set the camera device to use as the source for this stream.
virtual CameraDevice * getCameraDevice() const =0
Output streams are created and owned by CaptureSessions, and they maintain a connection with an EGLSt...
Definition: Stream.h:72
Status
Status values returned by API function calls.
Definition: Types.h:228
The top-level interface class.
Definition: Types.h:330
virtual void disconnect()=0
Disconnects the stream from the underlying EGLStream.
virtual Status waitUntilConnected(uint64_t timeout=TIMEOUT_INFINITE) const =0
Waits until both the producer and consumer endpoints of the stream are connected. ...
Pixel formats.
Definition: Types.h:284
virtual Status setFifoLength(uint32_t fifoLength)=0
Sets the FIFO queue length of the stream.
virtual PixelFormat getPixelFormat() const =0
virtual EGLStreamKHR getEGLStream() const =0
Returns the EGLStream backing the stream.
virtual Size2D< uint32_t > getResolution() const =0
Returns the image resolution of the stream, in pixels.
virtual PixelFormat getPixelFormat() const =0
Returns the format of the stream.
DEFINE_UUID(ExtensionName, EXT_BAYER_SHARPNESS_MAP, 7d5e0470, 4ea6, 11e6, bdf4, 08, 00, 20, 0c, 9a, 66)
The Ext::BayerSharpnessMap extension adds internally-generated sharpness metrics to CaptureMetadata r...
An object representing the sensor mode of a CameraDevice.
Definition: CameraDevice.h:153
static const InterfaceID & id()
Definition: Stream.h:148
virtual Status setResolution(const Size2D< uint32_t > &resolution)=0
Set the resolution of the stream.
Interface that exposes the properties common to all Stream objects.
Definition: Stream.h:95
Contains an object representing a single camera device.
Definition: CameraDevice.h:65
const uint64_t TIMEOUT_INFINITE
Constant used for infinite timeouts.
Definition: Types.h:98
DEFINE_NAMED_UUID_CLASS(StreamMode)
A unique identifier for an libargus Interface.
Definition: Types.h:340
Input streams are created and owned by CaptureSessions, and they maintain a connection with an EGLStr...
Definition: Stream.h:62
virtual Status setEGLDisplay(EGLDisplay eglDisplay)=0
Set the EGLDisplay the created stream must belong to.
Settings for OutputStream creation are exposed by the OutputStreamSettings class. ...
Definition: Stream.h:82
A top level object class for libargus objects that are created and owned by the client.
Definition: Types.h:398
virtual Status setMode(const StreamMode &mode)=0
Sets the mode of the OutputStream.
virtual uint32_t getFifoLength() const =0
virtual Status setPixelFormat(const PixelFormat &format)=0
Set the format of the stream.
virtual StreamMode getMode() const =0
virtual Size2D< uint32_t > getResolution() const =0
virtual EGLDisplay getEGLDisplay() const =0
Interface that exposes the settings used for OutputStream creation.
Definition: Stream.h:145