NVIDIA DRIVE OS Linux API Reference

5.1.6.1 Release
For Test and Development only

 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
nvmedia_image.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2013-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 
16 #ifndef NVMEDIA_IMAGE_H
17 #define NVMEDIA_IMAGE_H
18 
19 #ifdef __cplusplus
20 extern "C" {
21 #endif
22 
23 #include "nvmedia_core.h"
24 #include "nvmedia_surface.h"
25 
36 #define NVMEDIA_IMAGE_VERSION_MAJOR (1u)
37 
38 #define NVMEDIA_IMAGE_VERSION_MINOR (21u)
39 
58 #define NVMEDIA_MAX_IMAGE_GROUP_SIZE (3u)
59 
64 #define NVMEDIA_IMAGE_TIMEOUT_INFINITE (0xFFFFFFFFu)
65 
69 typedef struct {
73  uint32_t width;
75  uint32_t height;
77  uint32_t imageCount;
83  uint32_t attributes;
86  void *tag;
92  uint32_t colorStd;
94  struct NvMediaImagePriv_ *imgPriv;
95 } NvMediaImage;
96 
100 typedef struct {
104  uint32_t numImages;
107  void *tag;
110  uint64_t captureTimeStamp[NVMEDIA_MAX_IMAGE_GROUP_SIZE];
112 
122  NvMediaVersion *version
123 );
124 
136 NvMediaImage *
138  NvMediaDevice *device,
139  NvMediaSurfaceType type,
140  const NvMediaSurfAllocAttr *attrs,
141  uint32_t numAttrs,
142  uint32_t flags
143 );
144 
150 void
152  NvMediaImage *image
153 );
154 
166 typedef enum {
174 
179 typedef struct {
181  uint32_t pitch;
183  void *mapping;
185 
192 typedef struct {
196  uint32_t width;
198  uint32_t height;
200  uint32_t surfaces;
205  void *metaData;
207 
230  const NvMediaImage *image,
231  NvMediaImageLockAccess lockAccessType,
232  NvMediaImageSurfaceMap *surfaceMap
233 );
234 
241 void
243  const NvMediaImage *image
244 );
245 
321  NvMediaImage *image,
322  const NvMediaRect *dstRect,
323  void **srcPntrs,
324  const uint32_t *srcPitches
325 );
326 
389  const NvMediaImage *image,
390  const NvMediaRect *srcRect,
391  void **dstPntrs,
392  const uint32_t *dstPitches
393 );
394 
451  const NvMediaImage *image,
452  uint32_t imageIndex,
453  void *embeddedBufTop,
454  uint32_t *embeddedBufTopSize,
455  void *embeddedBufBottom,
456  uint32_t *embeddedBufBottomSize
457 );
458 
470  const NvMediaImage *image,
471  NvMediaTime *timeStamp
472 );
473 
488  const NvMediaImage *image,
489  NvMediaGlobalTime *globalTimeStamp
490 );
491 
508  NvMediaImage *image,
509  void *tag
510 );
511 
527  const NvMediaImage *image,
528  void **tag
529 );
530 
548  const NvMediaImage *image,
549  uint32_t millisecondWait,
550  NvMediaTaskStatus *status
551 );
552 
555 /*
556  * \defgroup history_nvmedia_image History
557  * Provides change history for the NvMedia Image API.
558  *
559  * \section history_nvmedia_image Version History
560  *
561  * <b> Version 1.1 </b> March 3, 2016
562  * - Initial release
563  *
564  * <b> Version 1.2 </b> May 11, 2016
565  * - Added \ref NvMediaImageCheckVersion API
566  *
567  * <b> Version 1.3 </b> Jan 17, 2017
568  * - Added atrribute NVMEDIA_IMAGE_ATTRIBUTE_CAPTURE in \ref NvMediaImageAttributes
569  *
570  * <b> Version 1.4 </b> Feb 9, 2017
571  * - Added new APIs
572  * NvMediaImageCreateNew()
573  *
574  * <b> Version 1.5 </b> March 16, 2017
575  * - Added \ref NVMEDIA_BITS_PER_PIXEL_16 in \ref NvMediaBitsPerPixel
576  *
577  * <b> Version 1.6 </b> May 9, 2017
578  * - Deprecated the following APIs
579  * - NvMediaImageAcquire
580  * - NvMediaImageRelease
581  * - NvMediaImageWaitForIdle
582  * - NvMediaImageWaitForCompletion
583  * - NvMediaImageCheckVersion
584  * - NvMediaImageGetVersion() is added to get the version of NvMedia Image library
585  * - All NvMedia data types are moved to standard data types
586  *
587  * <b> Version 1.7 </b> May 14, 2017
588  * - Added API to get status of operation on an image. \ref NvMediaImageGetStatus
589  *
590  * <b> Version 1.8 </b> May 15, 2017
591  * - Added deprecated warning message for \ref NvMediaImageCreate,
592  * \ref NvMediaImageSiblingCreate, \ref NvMediaImageSiblingDestroy,
593  * \ref NvMediaVideoCreateImageSibling, \ref NvMediaImageCreateVideoSibling
594  *
595  * <b> Version 1.9 </b> May 18, 2017
596  * - Added colorStd member in \ref NvMediaImage
597  *
598  * <b> Version 1.10 </b> June 12, 2017
599  * - Added \ref NvMediaImageGroup to hold a list of NvMediaImages.
600  *
601  * <b> Version 1.11 </b> September 12, 2017
602  * - Deprecated \ref NvMediaImageClass, \ref NvMediaImageAttributes, \ref NvMediaImageAdvancedConfig
603  * - Deprecated \ref NvMediaImageCreate, \ref NvMediaImageSiblingCreate,
604  * \ref NvMediaVideoCreateImageSibling, \ref NvMediaImageSiblingDestroy,
605  * \ref NvMediaImageCreateVideoSibling, \ref NvMediaVideoSurfaceSiblingDestroy
606  *
607  * <b> Version 1.12 </b> Dec 06, 2018
608  * - Fixed MISRA-C rule 10.4, 20.7 and 21.1 violations
609  * resulting from this header.
610  *
611  * <b> Version 1.13 </b> January 16, 2019
612  * Updated desciption for \ref NvMediaImageGetBits and \ref NvMediaImagePutBits
613  *
614  * <b> Version 1.14 </b> March 13, 2019
615  * - Data type of lockAcessType in NvMediaImageLock Api
616  is changed from unit32_t to NvMediaImageLockAccess.
617  *
618  * <b> Version 1.15 </b> March 16, 2019
619  * - Add required header include nvmedia_surface.h
620  *
621  * <b> Version 1.16 </b> March 20, 2019
622  * - Added \ref NvMediaImageSetTag and \ref NvMediaImageGetTag APIs
623  * - Tag member of NvMedia Image will be deprecated in later release.
624  *
625  * <b> Version 1.17 </b> March 22, 2019
626  * - Added \ref NVMEDIA_RAW_PIXEL_ORDER_RCCB, \ref NVMEDIA_RAW_PIXEL_ORDER_BCCR,
627  * \ref NVMEDIA_RAW_PIXEL_ORDER_CRBC, \ref NVMEDIA_RAW_PIXEL_ORDER_CBRC, and
628  * \ref NVMEDIA_RAW_PIXEL_ORDER_COUNT
629  * in \ref NvMediaRawPixelOrder
630  *
631  * <b> Version 1.18 </b> March 25, 2019
632  * - Added opaque pointer for image structure
633  * - Fixed MISRA-C rule 8.13 violations resulting from this header.
634  *
635  *<b> Version 1.19 </b> March 28, 2019
636  * - Unnecessary header include nvmedia_video.h has been removed
637  *
638  * <b> Version 1.20 </b> March 29, 2019
639  * - Added captureTimeStamp to \ref NvMediaImageGroup to hold timestamps
640  *
641  *<b> Version 1.21 </b> March 28, 2019
642  * - Move NvMediaBitsPerPixel and NVMEDIA_MAX_AGGREGATE_IMAGES to nvmedia_icp.h
643  * - Move NvMediaRawPixelOrder to nvmedia_ipp.h
644  */
647 #ifdef __cplusplus
648 }; /* extern "C" */
649 #endif
650 
651 #endif /* NVMEDIA_IMAGE_H */
uint32_t attributes
Holds image attributes.
Definition: nvmedia_image.h:83
Holds a handle representing image objects.
Definition: nvmedia_image.h:69
#define NvMediaSurfaceType
Defines the set of NvMedia surface types.
NvMediaStatus NvMediaImageGetEmbeddedData(const NvMediaImage *image, uint32_t imageIndex, void *embeddedBufTop, uint32_t *embeddedBufTopSize, void *embeddedBufBottom, uint32_t *embeddedBufBottomSize)
Returns embedded data stored in a captured image.
NvMediaStatus NvMediaImageGetBits(const NvMediaImage *image, const NvMediaRect *srcRect, void **dstPntrs, const uint32_t *dstPitches)
Reads an NvMedia image and writes the content into a client memory buffer.
uint32_t height
Holds image height.
Definition: nvmedia_image.h:75
NvMediaStatus NvMediaImagePutBits(NvMediaImage *image, const NvMediaRect *dstRect, void **srcPntrs, const uint32_t *srcPitches)
Reads a client memory buffer and writes the content into an NvMedia image surface.
Specifies read/write access.
NvMediaStatus NvMediaImageGetTimeStamp(const NvMediaImage *image, NvMediaTime *timeStamp)
Gets the capture timestamp of the image.
NVIDIA Media Interface: Surface Handling
NvMediaSurfaceType type
Holds image surface type.
uint32_t colorStd
Holds an image color standard type.
Definition: nvmedia_image.h:92
NvMediaStatus NvMediaImageLock(const NvMediaImage *image, NvMediaImageLockAccess lockAccessType, NvMediaImageSurfaceMap *surfaceMap)
Locks an image and returns the associated mapped pointers to the image surface data.
uint32_t width
Holds image width.
Definition: nvmedia_image.h:73
struct timespec NvMediaTime
Holds the media time (timespec as defined by the POSIX specification).
Definition: nvmedia_core.h:85
#define NVMEDIA_MAX_IMAGE_GROUP_SIZE
Maximum number of images in an image group.
Definition: nvmedia_image.h:58
Holds NvMedia version information.
Definition: nvmedia_core.h:226
struct NvMediaDevice NvMediaDevice
An opaque handle representing an NvMediaDevice object.
Definition: nvmedia_core.h:337
Holds status of latest operation for NvMedia managed data structure.
Definition: nvmedia_core.h:209
uint32_t embeddedDataBottomSize
Holds the size of bottom embedded data.
Definition: nvmedia_image.h:81
Holds a handle representing an image group.
NVIDIA Media Interface: Core
NvMediaStatus
Defines all possible error codes.
Definition: nvmedia_core.h:169
NvMediaSurfaceType type
Holds image surface type.
Definition: nvmedia_image.h:71
uint32_t numImages
Holds the number of NvMedia images in the group.
void * metaData
Holds a pointer to metadata associated with the surface.
NvMediaStatus NvMediaImageGetVersion(NvMediaVersion *version)
Gets the version of the NvMedia Image library.
int uint32_t uint32_t uint32_t const uint32_t const uint32_t const uint32_t const uint64_t uint32_t uint32_t flags
Holds a rectangular region of a surface.
Definition: nvmedia_core.h:133
uint32_t surfaces
Holds the number of surfaces in the image.
Holds NvMedia Surface allocation attributes.
NvMediaImage * NvMediaImageCreateNew(NvMediaDevice *device, NvMediaSurfaceType type, const NvMediaSurfAllocAttr *attrs, uint32_t numAttrs, uint32_t flags)
Allocates an image object.
uint64_t NvMediaGlobalTime
Media global time, measured in microseconds.
Definition: nvmedia_core.h:90
uint32_t imageCount
Holds the number of images stored in this image container.
Definition: nvmedia_image.h:77
void NvMediaImageUnlock(const NvMediaImage *image)
Unlocks an image.
void * tag
Holds a tag for use by the application.
Holds an image surface map descriptor used by NvMediaImageLock().
uint32_t width
Holds image width.
struct NvMediaImagePriv_ * imgPriv
Holds an opaque pointer for internal use.
Definition: nvmedia_image.h:94
NvMediaStatus NvMediaImageGetGlobalTimeStamp(const NvMediaImage *image, NvMediaGlobalTime *globalTimeStamp)
Gets the global capture timestamp of the image.
uint32_t embeddedDataTopSize
Holds the size of top embedded data.
Definition: nvmedia_image.h:79
NvMediaGlobalTime captureGlobalTimeStamp
Holds an image capture global timestamp in microseconds.
Definition: nvmedia_image.h:90
uint32_t pitch
Holds pitch of the surface.
Holds an image surface descriptor used by NvMediaImageLock().
NvMediaTime captureTimeStamp
Holds an image capture timestamp.
Definition: nvmedia_image.h:88
NvMediaStatus NvMediaImageGetStatus(const NvMediaImage *image, uint32_t millisecondWait, NvMediaTaskStatus *status)
Gets status of the current or most recent operation for an image; optionally waits for the current op...
Specifies read access.
Specifies write access.
NvMediaStatus NvMediaImageGetTag(const NvMediaImage *image, void **tag)
Gets the tag from an NvMediaImage.
NvMediaImageLockAccess
Specifies image lock access types.
NvMediaStatus NvMediaImageSetTag(NvMediaImage *image, void *tag)
Sets a tag for an NvMediaImage.
void NvMediaImageDestroy(NvMediaImage *image)
Destroys an image object created by NvMediaImageCreateNew().
void * mapping
Holds a CPU accessible memory pointer to the surface.
uint32_t height
Holds image height.