NVIDIA DRIVE OS Linux API Reference

5.1.0.2 Release

 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-2017, 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_video.h"
25 
36 #define NVMEDIA_IMAGE_VERSION_MAJOR 1
37 
38 #define NVMEDIA_IMAGE_VERSION_MINOR 11
39 
58 #define NVMEDIA_MAX_AGGREGATE_IMAGES 6
59 
64 #define NVMEDIA_MAX_IMAGE_GROUP_SIZE 3
65 
70 #define NVMEDIA_IMAGE_TIMEOUT_INFINITE 0xFFFFFFFF
71 
75 typedef struct {
79  uint32_t width;
81  uint32_t height;
83  uint32_t imageCount;
89  uint32_t attributes;
92  void *tag;
98  uint32_t colorStd;
99 } NvMediaImage;
100 
104 typedef struct {
108  uint32_t numImages;
111  void *tag;
113 
117 typedef enum {
131 
135 typedef enum {
145 
157  NvMediaVersion *version
158 );
159 
171 NvMediaImage *
173  NvMediaDevice *device,
174  NvMediaSurfaceType type,
175  NvMediaSurfAllocAttr *attrs,
176  uint32_t numAttrs,
177  uint32_t flags
178 );
179 
185 void
187  NvMediaImage *image
188 );
189 
201 typedef enum {
209 
215 typedef struct {
217  uint32_t pitch;
219  void *mapping;
221 
228 typedef struct {
232  uint32_t width;
234  uint32_t height;
236  uint32_t surfaces;
240  void *metaData;
242 
264  NvMediaImage *image,
265  uint32_t lockAccessType,
266  NvMediaImageSurfaceMap *surfaceMap
267 );
268 
276 void
278  NvMediaImage *image
279 );
280 
313  NvMediaImage *image,
314  NvMediaRect *dstRect,
315  void **srcPntrs,
316  uint32_t *srcPitches
317 );
318 
342  NvMediaImage *image,
343  NvMediaRect *srcRect,
344  void **dstPntrs,
345  uint32_t *dstPitches
346 );
347 
374  NvMediaImage *image,
375  uint32_t imageIndex,
376  void *embeddedBufTop,
377  uint32_t *embeddedBufTopSize,
378  void *embeddedBufBottom,
379  uint32_t *embeddedBufBottomSize
380 );
381 
394  NvMediaImage *image,
395  NvMediaTime *timeStamp
396 );
397 
410  NvMediaImage *image,
411  NvMediaGlobalTime *globalTimeStamp
412 );
413 
431  NvMediaImage *image,
432  uint32_t millisecondWait,
433  NvMediaTaskStatus *status
434 );
435 
438 /*
439  * \defgroup history_nvmedia_image History
440  * Provides change history for the NvMedia Image API.
441  *
442  * \section history_nvmedia_image Version History
443  *
444  * <b> Version 1.1 </b> March 3, 2016
445  * - Initial release
446  *
447  * <b> Version 1.2 </b> May 11, 2016
448  * - Added \ref NvMediaImageCheckVersion API
449  *
450  * <b> Version 1.3 </b> Jan 17, 2017
451  * - Added atrribute NVMEDIA_IMAGE_ATTRIBUTE_CAPTURE in \ref NvMediaImageAttributes
452  *
453  * <b> Version 1.4 </b> Feb 9, 2017
454  * - Added new APIs
455  * NvMediaImageCreateNew()
456  *
457  * <b> Version 1.5 </b> March 16, 2017
458  * - Added \ref NVMEDIA_BITS_PER_PIXEL_16 in \ref NvMediaBitsPerPixel
459  *
460  * <b> Version 1.6 </b> May 9, 2017
461  * - Deprecated the following APIs
462  * - NvMediaImageAcquire
463  * - NvMediaImageRelease
464  * - NvMediaImageWaitForIdle
465  * - NvMediaImageWaitForCompletion
466  * - NvMediaImageCheckVersion
467  * - NvMediaImageGetVersion() is added to get the version of NvMedia Image library
468  * - All NvMedia data types are moved to standard data types
469  *
470  * <b> Version 1.7 </b> May 14, 2017
471  * - Added API to get status of operation on an image. \ref NvMediaImageGetStatus
472  *
473  * <b> Version 1.8 </b> May 15, 2017
474  * - Added deprecated warning message for \ref NvMediaImageCreate,
475  * \ref NvMediaImageSiblingCreate, \ref NvMediaImageSiblingDestroy,
476  * \ref NvMediaVideoCreateImageSibling, \ref NvMediaImageCreateVideoSibling
477  *
478  * <b> Version 1.9 </b> May 18, 2017
479  * - Added colorStd member in \ref NvMediaImage
480  *
481  * <b> Version 1.10 </b> June 12, 2017
482  * - Added \ref NvMediaImageGroup to hold a list of NvMediaImages.
483  *
484  * <b> Version 1.11 </b> September 12, 2017
485  * - Deprecated \ref NvMediaImageClass, \ref NvMediaImageAttributes, \ref NvMediaImageAdvancedConfig
486  * - Deprecated \ref NvMediaImageCreate, \ref NvMediaImageSiblingCreate,
487  * \ref NvMediaVideoCreateImageSibling, \ref NvMediaImageSiblingDestroy,
488  * \ref NvMediaImageCreateVideoSibling, \ref NvMediaVideoSurfaceSiblingDestroy
489  *
490  */
493 #ifdef __cplusplus
494 }; /* extern "C" */
495 #endif
496 
497 #endif /* _NVMEDIA_IMAGE_H */
uint32_t attributes
Image attributes.
Definition: nvmedia_image.h:89
A handle representing image objects.
Definition: nvmedia_image.h:75
12 bits per pixel.
#define NvMediaSurfaceType
Defines the set of NvMedia surface types.
16 bits per pixel.
NvMediaStatus NvMediaImageLock(NvMediaImage *image, uint32_t lockAccessType, NvMediaImageSurfaceMap *surfaceMap)
Locks an image and returns the associated mapped pointers pointing to the image surface data...
NvMediaStatus NvMediaImageGetBits(NvMediaImage *image, NvMediaRect *srcRect, void **dstPntrs, uint32_t *dstPitches)
NvMediaImageGetBits reads an NvMedia image and writes the content into a client memory buffer...
uint32_t height
Image height.
Definition: nvmedia_image.h:81
NvMediaSurfaceType type
Image surface type.
uint32_t colorStd
Image color standard type.
Definition: nvmedia_image.h:98
uint32_t width
Image width.
Definition: nvmedia_image.h:79
20 bits per pixel.
struct timespec NvMediaTime
Holds the media time (timespec as defined by the POSIX specification).
Definition: nvmedia_core.h:84
#define NVMEDIA_MAX_IMAGE_GROUP_SIZE
Maximum number of images in an image group.
Definition: nvmedia_image.h:64
Holds NvMedia Version information.
Definition: nvmedia_core.h:252
NvMediaStatus NvMediaImageGetGlobalTimeStamp(NvMediaImage *image, NvMediaGlobalTime *globalTimeStamp)
Gets the global capture time-stamp of the image.
NvMediaStatus NvMediaImagePutBits(NvMediaImage *image, NvMediaRect *dstRect, void **srcPntrs, uint32_t *srcPitches)
Reads a client memory buffer and writes the content into an NvMedia image surface.
Holds status of latest operation for NvMedia managed data structure.
Definition: nvmedia_core.h:235
uint32_t embeddedDataBottomSize
Size of bottom embedded data.
Definition: nvmedia_image.h:87
A handle representing an image group.
NVIDIA Media Interface: Core
NvMediaStatus
The set of all possible error codes.
Definition: nvmedia_core.h:199
NvMediaSurfaceType type
Image surface type.
Definition: nvmedia_image.h:77
uint32_t numImages
Number of NvMedia Images in the group.
8 bits per pixel.
NvMediaStatus NvMediaImageGetStatus(NvMediaImage *image, uint32_t millisecondWait, NvMediaTaskStatus *status)
Gets status of the current/last operation for the image, and optionally waits for operation to comple...
void * metaData
Pointer to access metadata.
NvMediaStatus NvMediaImageGetVersion(NvMediaVersion *version)
Gets the version for the NvMedia Image library.
void * tag
Tag that can be used by the application.
Definition: nvmedia_image.h:92
10 bits per pixel.
int uint32_t uint32_t uint32_t const uint32_t const uint32_t const uint32_t const uint64_t uint32_t uint32_t flags
14 bits per pixel.
Holds a rectangular region of a surface.
Definition: nvmedia_core.h:146
uint32_t surfaces
Number of surfaces in the image.
Holds NvMedia Surface allocation attributes.
NVIDIA Media Interface: Video Surface Processing
NvMediaImage * NvMediaImageCreateNew(NvMediaDevice *device, NvMediaSurfaceType type, NvMediaSurfAllocAttr *attrs, uint32_t numAttrs, uint32_t flags)
Allocates an image object.
void NvMediaDevice
An opaque handle representing a NvMediaDevice object.
Definition: nvmedia_core.h:305
uint64_t NvMediaGlobalTime
Media global time, measured in microseconds.
Definition: nvmedia_core.h:89
uint32_t imageCount
Number of images stored in this image container.
Definition: nvmedia_image.h:83
void * tag
Tag that can be used by the application.
Image surface map descriptor used by NvMediaImageLock.
NvMediaStatus NvMediaImageGetEmbeddedData(NvMediaImage *image, uint32_t imageIndex, void *embeddedBufTop, uint32_t *embeddedBufTopSize, void *embeddedBufBottom, uint32_t *embeddedBufBottomSize)
Return embedded data stored in a captured image.
uint32_t width
Image width.
void NvMediaImageUnlock(NvMediaImage *image)
Unlocks an image.
uint32_t embeddedDataTopSize
Size of top embedded data.
Definition: nvmedia_image.h:85
NvMediaGlobalTime captureGlobalTimeStamp
Image capture global timestamp in microseconds.
Definition: nvmedia_image.h:96
uint32_t pitch
Pitch of the surface.
NvMediaBitsPerPixel
Bits per pixel.
Image surface descriptor used by NvMediaImageLock.
NvMediaTime captureTimeStamp
Image capture time-stamp.
Definition: nvmedia_image.h:94
NvMediaRawPixelOrder
Pixel order in a raw image.
NvMediaImageLockAccess
Image lock access types.
void NvMediaImageDestroy(NvMediaImage *image)
Destroys an image object that was created by NvMediaImageCreateNew.
void * mapping
CPU accessible memory pointer of the surface.
NvMediaStatus NvMediaImageGetTimeStamp(NvMediaImage *image, NvMediaTime *timeStamp)
Gets the capture timestamp of the image.
uint32_t height
Image height.