L4T Multimedia API Reference

27.1 Release

 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Event.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 
36 #ifndef _ARGUS_EVENT_H
37 #define _ARGUS_EVENT_H
38 
51 namespace Argus
52 {
53 
60 class Event : public InterfaceProvider
61 {
62 protected:
63  ~Event() {}
64 };
65 
69 class EventType : public NamedUUID
70 {
71 public:
72  EventType(uint32_t time_low_
73  , uint16_t time_mid_
74  , uint16_t time_hi_and_version_
75  , uint16_t clock_seq_
76  , uint8_t c0, uint8_t c1, uint8_t c2, uint8_t c3, uint8_t c4, uint8_t c5
77  , const char* name)
78  : NamedUUID(time_low_, time_mid_, time_hi_and_version_, clock_seq_,
79  c0, c1, c2, c3, c4, c5, name)
80  {}
81 
83  : NamedUUID(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "EVENT_TYPE_UNSPECIFIED")
84  {}
85 };
86 
87 
88 /*
89  * Core Event types
90  */
91 
94 DEFINE_UUID(EventType, EVENT_TYPE_ERROR, 2c80d8b0,2bfd,11e5,a2cb,08,00,20,0c,9a,66);
95 
97 DEFINE_UUID(EventType, EVENT_TYPE_CAPTURE_STARTED, 2c80d8b1,2bfd,11e5,a2cb,08,00,20,0c,9a,66);
98 
100 DEFINE_UUID(EventType, EVENT_TYPE_CAPTURE_COMPLETE, 2c80d8b2,2bfd,11e5,a2cb,08,00,20,0c,9a,66);
101 
102 
108 DEFINE_UUID(InterfaceID, IID_EVENT, 98bcb49e,fd7d,11e4,a322,16,97,f9,25,ec,7b);
109 
110 class IEvent : public Interface
111 {
112 public:
113  static const InterfaceID& id() { return IID_EVENT; }
114 
118  virtual EventType getEventType() const = 0;
119 
123  virtual uint64_t getTime() const = 0;
124 
128  virtual uint32_t getCaptureId() const = 0;
129 
130 protected:
131  ~IEvent() {}
132 };
133 
139 DEFINE_UUID(InterfaceID, IID_EVENT_ERROR, 13e0fc70,1ab6,11e5,b939,08,00,20,0c,9a,66);
140 
141 class IEventError : public Interface
142 {
143 public:
144  static const InterfaceID& id() { return IID_EVENT_ERROR; }
145 
149  virtual Status getStatus() const = 0;
150 
151 protected:
153 };
154 
160 DEFINE_UUID(InterfaceID, IID_EVENT_CAPTURE_COMPLETE, 8b2b40b5,f1e4,4c4d,ae1c,f3,93,f6,54,06,d5);
161 
163 {
164 public:
165  static const InterfaceID& id() { return IID_EVENT_CAPTURE_COMPLETE; }
166 
173  virtual const CaptureMetadata* getMetadata() const = 0;
174 
179  virtual Status getStatus() const = 0;
180 
181 protected:
183 };
184 
185 } // namespace Argus
187 #endif // _ARGUS_EVENT_H
A container for metadata from a single capture.
virtual EventType getEventType() const =0
Returns the event type.
The base interface for a class that provides libargus Interfaces.
Definition: Types.h:361
An Event represents an asynchronous result.
Definition: Event.h:60
virtual Status getStatus() const =0
Returns the Status value describing the error.
virtual uint64_t getTime() const =0
Returns the time of the event, in nanoseconds.
Status
Status values returned by API function calls.
Definition: Types.h:228
EventType(uint32_t time_low_, uint16_t time_mid_, uint16_t time_hi_and_version_, uint16_t clock_seq_, uint8_t c0, uint8_t c1, uint8_t c2, uint8_t c3, uint8_t c4, uint8_t c5, const char *name)
Definition: Event.h:72
The top-level interface class.
Definition: Types.h:330
The interface common to all event types.
Definition: Event.h:110
A unique identifier for a particular type of Event.
Definition: Event.h:69
virtual const CaptureMetadata * getMetadata() const =0
Returns all dynamic metadata associated with this capture.
static const InterfaceID & id()
Definition: Event.h:144
virtual uint32_t getCaptureId() const =0
Returns the capture id for the event.
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...
A unique identifier with a name (primarily for debugging purposes).
Definition: UUID.h:75
virtual Status getStatus() const =0
Returns the error status of the metadata event.
static const InterfaceID & id()
Definition: Event.h:165
The interface that exposes the properties for an ERROR event.
Definition: Event.h:141
A unique identifier for an libargus Interface.
Definition: Types.h:340
The interface that exposes the properties for a CAPTURE_COMPLETE event.
Definition: Event.h:162
~Event()
Definition: Event.h:63
static const InterfaceID & id()
Definition: Event.h:113