NVIDIA DRIVE OS Linux SDK API Reference

5.2.6 Release
For Test and Development only
nvmedia_core.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2017-2019, NVIDIA CORPORATION. All rights reserved. All
3  * information contained herein is proprietary and confidential to NVIDIA
4  * Corporation. Any use, reproduction, or disclosure without the written
5  * permission of NVIDIA Corporation is prohibited.
6  */
7 
8 
16 #ifndef NVMEDIA_CORE_H
17 #define NVMEDIA_CORE_H
18 
19 #ifdef __cplusplus
20 extern "C" {
21 #endif
22 
23 #include <math.h>
24 #include <stdint.h>
25 #include <time.h>
26 
27 #if !defined(NVM_DEPRECATED)
28  #if defined(__GNUC__) && (__GNUC__ >= 4) && (__GNUC_MINOR__ >= 6)
29  /*
30  * deprecated as build time warnings to prompt developers to migrate
31  * from older API to new one gradually. Should be removed once API
32  * transition is done(ie: no warnings).
33  */
34 
35  #pragma GCC diagnostic warning "-Wdeprecated-declarations"
36  #define NVM_DEPRECATED_MSG(fmt) __attribute__((deprecated(fmt)))
37  #else
38  #define NVM_DEPRECATED
39  #define NVM_DEPRECATED_MSG(fmt) NVM_DEPRECATED
40  #endif
41 #else
42  #define NVM_DEPRECATED_MSG(fmt) NVM_DEPRECATED
43 #endif
44 
62 #define NVMEDIA_RELEASE_VERSION_MAJOR 2
63 
64 #define NVMEDIA_RELEASE_VERSION_MINOR 0
65 
67 #define NVMEDIA_CORE_VERSION_MAJOR 1
68 
69 #define NVMEDIA_CORE_VERSION_MINOR 14
70 
72 #define NVMEDIA_TRUE (0 == 0)
73 
74 #define NVMEDIA_FALSE (0 == 1)
75 
80 typedef uint32_t NvMediaBool;
81 
85 typedef struct timespec NvMediaTime;
86 
90 typedef uint64_t NvMediaGlobalTime;
91 
94 typedef enum {
105 
108 typedef enum {
122 
133 typedef struct {
135  uint16_t x0;
137  uint16_t y0;
139  uint16_t x1;
141  uint16_t y1;
142 } NvMediaRect;
143 
147 typedef struct {
149  int32_t x;
151  int32_t y;
152 } NvMediaPoint;
153 
158 typedef struct {
160  float_t x;
162  float_t y;
164 
169 typedef struct {
171  double_t x;
173  double_t y;
175 
180 typedef enum {
213 } NvMediaStatus;
214 
220 typedef struct {
224  uint64_t endTimestamp;
226 
237 typedef struct {
239  uint8_t major;
241  uint8_t minor;
243 
244 /*
245  ******* Definitions ******************
246  * SOFFence - Start of frame \ref NvSciSyncFence. An NvSciSyncFence
247  * whose expiry indicates that the processing has started.
248  * EOFFence - End of frame NvSciSyncFence. An NvSciSyncFence
249  * whose expiry indicates that the processing is done.
250  * PREFence - An NvSciSyncFence on which the start of processing is
251  * blocked until the expiry of the fence.
252  **************************************
253  */
254 
258 typedef enum {
267 
271 typedef enum {
293 
295 
296 /*
297  * \brief Defines all possible access modes.
298  */
299 typedef enum {
305 
315  NvMediaVersion *version
316 );
317 
327  NvMediaVersion *version
328 );
329 
349 
361  void
362 );
363 
372 void
374  NvMediaDevice *device
375 );
376 
381 /*
382  * \defgroup history_nvmedia_core History
383  * Provides change history for the NvMedia Common Types.
384  *
385  * \section history_nvmedia_core Version History
386  *
387  * <b> Version 1.0 </b> March 21, 2017
388  * - Initial release
389  *
390  * <b> Version 1.1 </b> April 18, 2017
391  * - NVMEDIA_VERSION_MAJOR is renamed to NVMEDIA_CORE_VERSION_MAJOR.
392  * - NVMEDIA_VERSION_MINOR is renamed to NVMEDIA_CORE_VERSION_MINOR.
393  * - NvMediaBool is now changed from "int" to "uint32_t" type.
394  * - NvMediaRect is now changed from "unsigned short" to "uint16_t".
395  * - All NvMedia data types are moved to standard data types from <stdint.h>
396  * - NvMediaVersionInfo is now deprecated. Use module specific GetVersion()
397  API to query the module versions.
398  * - NvMediaGetVersionInfo is now deprecated. Use NvMediaCoreGetVersion()
399  or NvMediaReleaseGetVersion()
400  * - NvMediaCheckVersion is now deprecated. Applications are expected
401  to check their version using above GetVersion() APIs.
402  * - NVMEDIA_SET_VERSION macro is now deprecated.
403  *
404  * <b> Version 1.2 </b> May 4, 2017
405  * - Added \ref NvMediaROI and \ref NvMediaTaskStatus.
406  *
407  * <b> Version 1.3 </b> May 17, 2017
408  * - Added macros to generate build warnings for deprecated APIs
409  * - Changed the size of \ref NvMediaPoint members
410  *
411  * <b> Version 1.4 </b> September 14, 2017
412  * - Added \ref NvMediaTimeBase
413  *
414  * <b> Version 1.5 </b> December 12, 2017
415  * - Deprecated the following palette related APIs:
416  * NvMediaPaletteCreate
417  * NvMediaPaletteDestroy
418  * NvMediaPaletteLoad
419  *
420  * <b> Version 1.6 </b> Sep 12, 2018
421  * - Add \ref NvMediaPointDouble
422  *
423  * <b> Version 1.7 </b> Dec 12, 2018
424  * - MISRA Rule 21.1 and 21.2 violations are fixed
425  *
426  * <b> Version 1.8 </b> Feb 4, 2019
427  * - Removed \ref NvMediaROI
428  * - Moved \ref NvMediaColor to nvmedia_vmp.h
429  * - Changed \ref NvMediaDevice type from void to struct
430  *
431  * <b> Version 1.9 </b> March 7, 2019
432  * - Added \ref NvMediaNvSciSyncClientType and \ref NvMediaNvSciSyncObjType.
433  *
434  * <b> Version 1.10 </b> March 18, 2019
435  * - Added /ref NvMediaAccessMode
436  *
437  * <b> Version 1.11 </b> March 25, 2019
438  * - Removed enum value NVMEDIA_STATUS_CANCELLED from \ref NvMediaStatus
439  *
440  * <b> Version 1.12 </b> April 2, 2019
441  * - Added enum value NVMEDIA_STATUS_PFSD_ERROR to \ref NvMediaStatus
442  *
443  * <b> Version 1.13 </b> August 1, 2019
444  * - Added manual enumeration for backward compatibility to \ref NvMediaStatus
445  *
446  * <b> Version 1.14 </b> November 06, 2019
447  * - Add \ref NvMediaPointFloat
448  *
449  */
450 
451 #ifdef __cplusplus
452 }; /* extern "C" */
453 #endif
454 
455 #endif /* NVMEDIA_CORE_H */
NvMediaTime
struct timespec NvMediaTime
Holds the media time in timespec format as defined by the POSIX specification.
Definition: nvmedia_core.h:85
NvMediaPoint::x
int32_t x
Holds the horizontal location of the point.
Definition: nvmedia_core.h:149
NVMEDIA_STATUS_NOT_INITIALIZED
@ NVMEDIA_STATUS_NOT_INITIALIZED
Specifies that a component requred by the function call is not initialized.
Definition: nvmedia_core.h:194
NVMEDIA_SIGNALER
@ NVMEDIA_SIGNALER
An NvMedia component acts as a signaler.
Definition: nvmedia_core.h:260
NVMEDIA_ACCESS_MODE_READ_WRITE
@ NVMEDIA_ACCESS_MODE_READ_WRITE
Specifies read/write access mode.
Definition: nvmedia_core.h:303
NVMEDIA_SOFSYNCOBJ
@ NVMEDIA_SOFSYNCOBJ
Specifies an NvSciSyncObj type for which an NvMedia component acts as a signaler, signaling SOFFence.
Definition: nvmedia_core.h:280
NvMediaGlobalTime
uint64_t NvMediaGlobalTime
Media global time, measured in microseconds.
Definition: nvmedia_core.h:90
NVMEDIA_COLOR_STANDARD_ITUR_BT_709
@ NVMEDIA_COLOR_STANDARD_ITUR_BT_709
Specifies ITU BT.709 color standard.
Definition: nvmedia_core.h:112
NvMediaNvSciSyncObjType
NvMediaNvSciSyncObjType
Defines NvMedia NvSciSyncObj types.
Definition: nvmedia_core.h:271
NVMEDIA_STATUS_OK
@ NVMEDIA_STATUS_OK
Specifies that the operation completed successfully (with no error).
Definition: nvmedia_core.h:183
NVMEDIA_STATUS_PFSD_ERROR
@ NVMEDIA_STATUS_PFSD_ERROR
Specifies an error from Permanent Fault Software Diagnostic.
Definition: nvmedia_core.h:212
NvMediaDeviceDestroy
void NvMediaDeviceDestroy(NvMediaDevice *device)
Destroys an NvMediaDevice instance.
NVMEDIA_STATUS_INCOMPATIBLE_VERSION
@ NVMEDIA_STATUS_INCOMPATIBLE_VERSION
Specifies that a library's version is incompatible with the application.
Definition: nvmedia_core.h:208
NvMediaDevice
struct NvMediaDevice NvMediaDevice
An opaque handle representing an NvMediaDevice object.
Definition: nvmedia_core.h:348
NVMEDIA_ACCESS_MODE_READ
@ NVMEDIA_ACCESS_MODE_READ
Specifies read-only access mode.
Definition: nvmedia_core.h:301
NVMEDIA_PRESYNCOBJ
@ NVMEDIA_PRESYNCOBJ
Specifies an NvSciSyncObj type for which an NvMedia component acts as a waiter.
Definition: nvmedia_core.h:274
NVMEDIA_STATUS_NONE_PENDING
@ NVMEDIA_STATUS_NONE_PENDING
Specifies that no operation is pending.
Definition: nvmedia_core.h:200
NvMediaVersion
Holds NvMedia version information.
Definition: nvmedia_core.h:237
NVMEDIA_TIME_BASE_CLOCK_PTP
@ NVMEDIA_TIME_BASE_CLOCK_PTP
Specifies that PTP clock is used for base time calculation.
Definition: nvmedia_core.h:97
NVMEDIA_SOF_PRESYNCOBJ
@ NVMEDIA_SOF_PRESYNCOBJ
Specifies an NvSciSyncObj type for which an NvMedia component acts as a signaler, signaling SOFFence,...
Definition: nvmedia_core.h:292
NVMEDIA_STATUS_NOT_SUPPORTED
@ NVMEDIA_STATUS_NOT_SUPPORTED
Specifies that the requested operation is not supported.
Definition: nvmedia_core.h:196
NvMediaColorStandard
NvMediaColorStandard
Defines color standards.
Definition: nvmedia_core.h:108
NvMediaPoint
Defines the location of a point on a two-dimensional object.
Definition: nvmedia_core.h:147
NvMediaTaskStatus::status
NvMediaStatus status
Holds actual status - NvMediaStatus.
Definition: nvmedia_core.h:222
NVMEDIA_WAITER
@ NVMEDIA_WAITER
An NvMedia component acts as a waiter.
Definition: nvmedia_core.h:262
NvMediaPointDouble
Defines the double-precision location of a point on a two-dimensional object.
Definition: nvmedia_core.h:169
NVMEDIA_SIGNALER_WAITER
@ NVMEDIA_SIGNALER_WAITER
An NvMedia component acts as a signaler and waiter also for the same NvSciSyncObj.
Definition: nvmedia_core.h:265
NVMEDIA_STATUS_INSUFFICIENT_BUFFERING
@ NVMEDIA_STATUS_INSUFFICIENT_BUFFERING
Specifies insufficient buffering.
Definition: nvmedia_core.h:202
NvMediaRect
Holds a rectangular region of a surface.
Definition: nvmedia_core.h:133
NVMEDIA_STATUS_TIMED_OUT
@ NVMEDIA_STATUS_TIMED_OUT
Specifies that the operation timed out.
Definition: nvmedia_core.h:189
NvMediaVersion::major
uint8_t major
Holds NvMedia major version number.
Definition: nvmedia_core.h:239
NvMediaAccessMode
NvMediaAccessMode
Definition: nvmedia_core.h:299
NvMediaStatus
NvMediaStatus
Defines all possible error codes.
Definition: nvmedia_core.h:180
NvMediaPointFloat::y
float_t y
Holds the vertical location of the point.
Definition: nvmedia_core.h:162
NVMEDIA_COLOR_STANDARD_ITUR_BT_601_ER
@ NVMEDIA_COLOR_STANDARD_ITUR_BT_601_ER
Specifies ITU BT.601 color standard extended range.
Definition: nvmedia_core.h:117
NvMediaPointFloat::x
float_t x
Holds the horizontal location of the point.
Definition: nvmedia_core.h:160
NVMEDIA_STATUS_INVALID_SIZE
@ NVMEDIA_STATUS_INVALID_SIZE
Specifies that the size of an object passed to a function was invalid.
Definition: nvmedia_core.h:205
NvMediaRect::x1
uint16_t x1
Right X co-ordinate.
Definition: nvmedia_core.h:139
NvMediaVersion::minor
uint8_t minor
Holds NvMedia minor version number.
Definition: nvmedia_core.h:241
NvMediaRect::y0
uint16_t y0
Top Y co-ordinate.
Definition: nvmedia_core.h:137
NVMEDIA_STATUS_ERROR
@ NVMEDIA_STATUS_ERROR
Specifies a catch-all error, used when no other error code applies.
Definition: nvmedia_core.h:198
NVMEDIA_COLOR_STANDARD_ITUR_BT_709_ER
@ NVMEDIA_COLOR_STANDARD_ITUR_BT_709_ER
Specifies ITU BT.709 color standard extended range.
Definition: nvmedia_core.h:120
NVMEDIA_STATUS_UNDEFINED_STATE
@ NVMEDIA_STATUS_UNDEFINED_STATE
Specifies that the operation entered an undefined state.
Definition: nvmedia_core.h:210
NVMEDIA_TIME_BASE_CLOCK_MONOTONIC
@ NVMEDIA_TIME_BASE_CLOCK_MONOTONIC
Specifies that kernel monotonic clock is used for base time calculation.
Definition: nvmedia_core.h:100
NvMediaPointFloat
Defines the float-precision location of a point on a two-dimensional object.
Definition: nvmedia_core.h:158
NvMediaPointDouble::x
double_t x
Holds the horizontal location of the point.
Definition: nvmedia_core.h:171
NVMEDIA_EOF_PRESYNCOBJ
@ NVMEDIA_EOF_PRESYNCOBJ
Specifies an NvSciSyncObj type for which an NvMedia component acts both as a signaler,...
Definition: nvmedia_core.h:286
NVMEDIA_COLOR_STANDARD_ITUR_BT_601
@ NVMEDIA_COLOR_STANDARD_ITUR_BT_601
Specifies ITU BT.601 color standard.
Definition: nvmedia_core.h:110
NvMediaPointDouble::y
double_t y
Holds the vertical location of the point.
Definition: nvmedia_core.h:173
NvMediaRect::y1
uint16_t y1
Bottom Y co-ordinate.
Definition: nvmedia_core.h:141
NvMediaTaskStatus
Holds status of latest operation for NvMedia managed data structure.
Definition: nvmedia_core.h:220
NVMEDIA_STATUS_OUT_OF_MEMORY
@ NVMEDIA_STATUS_OUT_OF_MEMORY
Specifies that the process is out of memory.
Definition: nvmedia_core.h:191
NVMEDIA_STATUS_PENDING
@ NVMEDIA_STATUS_PENDING
Specifies that the operation has not finished yet.
Definition: nvmedia_core.h:187
NVMEDIA_EOFSYNCOBJ
@ NVMEDIA_EOFSYNCOBJ
Specifies an NvSciSyncObj type for which an NvMedia component acts as a signaler, signaling EOFFence.
Definition: nvmedia_core.h:277
NvMediaBool
uint32_t NvMediaBool
A boolean value, holding NVMEDIA_TRUE or NVMEDIA_FALSE.
Definition: nvmedia_core.h:80
NvMediaDeviceCreate
NvMediaDevice * NvMediaDeviceCreate(void)
Creates an instance of the NvMediaDevice structure.
NvMediaTaskStatus::endTimestamp
uint64_t endTimestamp
Holds timestamp of end of operation.
Definition: nvmedia_core.h:224
NVMEDIA_COLOR_STANDARD_SMPTE_240M
@ NVMEDIA_COLOR_STANDARD_SMPTE_240M
Specifies SMTE 240M color standard.
Definition: nvmedia_core.h:114
NVMEDIA_TIME_BASE_CLOCK_USER_DEFINED
@ NVMEDIA_TIME_BASE_CLOCK_USER_DEFINED
Specifies that a user defined clock is used for base time calculation.
Definition: nvmedia_core.h:103
NvMediaReleaseGetVersion
NvMediaStatus NvMediaReleaseGetVersion(NvMediaVersion *version)
Gets the release version information for the NvMedia library.
NvMediaRect::x0
uint16_t x0
Left X co-ordinate.
Definition: nvmedia_core.h:135
NvMediaCoreGetVersion
NvMediaStatus NvMediaCoreGetVersion(NvMediaVersion *version)
Gets the core version information for the NvMedia library.
NvMediaPoint::y
int32_t y
Holds the vertical location of the point.
Definition: nvmedia_core.h:151
NVMEDIA_STATUS_BAD_PARAMETER
@ NVMEDIA_STATUS_BAD_PARAMETER
Specifies that a bad parameter was passed.
Definition: nvmedia_core.h:185
NvMediaTimeBase
NvMediaTimeBase
Defines clock base for NvMediaTime.
Definition: nvmedia_core.h:94
NvMediaNvSciSyncClientType
NvMediaNvSciSyncClientType
NvMedia NvSciSync Client Type.
Definition: nvmedia_core.h:258