Multimedia API Reference

November 16, 2016 | 24.2.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 PixelFormat getPixelFormat() const = 0;
113 
117  virtual Size getResolution() const = 0;
118 
122  virtual EGLDisplay getEGLDisplay() const = 0;
123 
127  virtual EGLStreamKHR getEGLStream() const = 0;
128 
129 protected:
130  ~IStream() {}
131 };
132 
138 DEFINE_UUID(InterfaceID, IID_OUTPUT_STREAM_SETTINGS, 52f2b830,3d52,11e6,bdf4,08,00,20,0c,9a,66);
139 
141 {
142 public:
143  static const InterfaceID& id() { return IID_OUTPUT_STREAM_SETTINGS; }
144 
149  virtual Status setPixelFormat(const PixelFormat& format) = 0;
150  virtual PixelFormat getPixelFormat() const = 0;
151 
156  virtual Status setResolution(const Size& resolution) = 0;
157  virtual Size getResolution() const = 0;
158 
163  virtual Status setCameraDevice(CameraDevice* device) = 0;
164  virtual CameraDevice* getCameraDevice() const = 0;
165 
170  virtual Status setEGLDisplay(EGLDisplay eglDisplay) = 0;
171  virtual EGLDisplay getEGLDisplay() const = 0;
172 
211  virtual Status setMode(const StreamMode& mode) = 0;
212  virtual StreamMode getMode() const = 0;
213 
219  virtual Status setFifoLength(uint32_t fifoLength) = 0;
220  virtual uint32_t getFifoLength() const = 0;
221 
222 protected:
224 };
225 
226 } // namespace Argus
228 #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:343
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:220
The top-level interface class.
Definition: Types.h:312
virtual Status waitUntilConnected(uint64_t timeout=TIMEOUT_INFINITE) const =0
Waits until both the producer and consumer endpoints of the stream are connected. ...
virtual Size getResolution() const =0
Pixel formats.
Definition: Types.h:266
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 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...
static const InterfaceID & id()
Definition: Stream.h:143
virtual Status setResolution(const Size &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:96
DEFINE_NAMED_UUID_CLASS(StreamMode)
A unique identifier for an libargus Interface.
Definition: Types.h:322
Aggregates width and height in a single structure.
Definition: Types.h:505
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:380
virtual Status setMode(const StreamMode &mode)=0
Sets the mode of the OutputStream.
virtual Size getResolution() const =0
Returns the image resolution of the stream, in pixels.
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 EGLDisplay getEGLDisplay() const =0
Interface that exposes the settings used for OutputStream creation.
Definition: Stream.h:140