NVIDIA DRIVE 5.0 Linux SDK API Reference

5.0.5.0 Release

 All Data Structures 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 {
129 
133 typedef enum {
143 
155  NvMediaVersion *version
156 );
157 
169 NvMediaImage *
171  NvMediaDevice *device,
172  NvMediaSurfaceType type,
173  NvMediaSurfAllocAttr *attrs,
174  uint32_t numAttrs,
175  uint32_t flags
176 );
177 
183 void
185  NvMediaImage *image
186 );
187 
199 typedef enum {
207 
213 typedef struct {
215  uint32_t pitch;
217  void *mapping;
219 
226 typedef struct {
230  uint32_t width;
232  uint32_t height;
234  uint32_t surfaces;
238  void *metaData;
240 
262  NvMediaImage *image,
263  uint32_t lockAccessType,
264  NvMediaImageSurfaceMap *surfaceMap
265 );
266 
274 void
276  NvMediaImage *image
277 );
278 
311  NvMediaImage *image,
312  NvMediaRect *dstRect,
313  void **srcPntrs,
314  uint32_t *srcPitches
315 );
316 
340  NvMediaImage *image,
341  NvMediaRect *srcRect,
342  void **dstPntrs,
343  uint32_t *dstPitches
344 );
345 
372  NvMediaImage *image,
373  uint32_t imageIndex,
374  void *embeddedBufTop,
375  uint32_t *embeddedBufTopSize,
376  void *embeddedBufBottom,
377  uint32_t *embeddedBufBottomSize
378 );
379 
392  NvMediaImage *image,
393  NvMediaTime *timeStamp
394 );
395 
408  NvMediaImage *image,
409  NvMediaGlobalTime *globalTimeStamp
410 );
411 
429  NvMediaImage *image,
430  uint32_t millisecondWait,
431  NvMediaTaskStatus *status
432 );
433 
436 /*
437  * \defgroup history_nvmedia_image History
438  * Provides change history for the NvMedia Image API.
439  *
440  * \section history_nvmedia_image Version History
441  *
442  * <b> Version 1.1 </b> March 3, 2016
443  * - Initial release
444  *
445  * <b> Version 1.2 </b> May 11, 2016
446  * - Added \ref NvMediaImageCheckVersion API
447  *
448  * <b> Version 1.3 </b> Jan 17, 2017
449  * - Added atrribute NVMEDIA_IMAGE_ATTRIBUTE_CAPTURE in \ref NvMediaImageAttributes
450  *
451  * <b> Version 1.4 </b> Feb 9, 2017
452  * - Added new APIs
453  * NvMediaImageCreateNew()
454  *
455  * <b> Version 1.5 </b> March 16, 2017
456  * - Added \ref NVMEDIA_BITS_PER_PIXEL_16 in \ref NvMediaBitsPerPixel
457  *
458  * <b> Version 1.6 </b> May 9, 2017
459  * - Deprecated the following APIs
460  * - NvMediaImageAcquire
461  * - NvMediaImageRelease
462  * - NvMediaImageWaitForIdle
463  * - NvMediaImageWaitForCompletion
464  * - NvMediaImageCheckVersion
465  * - NvMediaImageGetVersion() is added to get the version of NvMedia Image library
466  * - All NvMedia data types are moved to standard data types
467  *
468  * <b> Version 1.7 </b> May 14, 2017
469  * - Added API to get status of operation on an image. \ref NvMediaImageGetStatus
470  *
471  * <b> Version 1.8 </b> May 15, 2017
472  * - Added deprecated warning message for \ref NvMediaImageCreate,
473  * \ref NvMediaImageSiblingCreate, \ref NvMediaImageSiblingDestroy,
474  * \ref NvMediaVideoCreateImageSibling, \ref NvMediaImageCreateVideoSibling
475  *
476  * <b> Version 1.9 </b> May 18, 2017
477  * - Added colorStd member in \ref NvMediaImage
478  *
479  * <b> Version 1.10 </b> June 12, 2017
480  * - Added \ref NvMediaImageGroup to hold a list of NvMediaImages.
481  *
482  * <b> Version 1.11 </b> September 12, 2017
483  * - Deprecated \ref NvMediaImageClass, \ref NvMediaImageAttributes, \ref NvMediaImageAdvancedConfig
484  * - Deprecated \ref NvMediaImageCreate, \ref NvMediaImageSiblingCreate,
485  * \ref NvMediaVideoCreateImageSibling, \ref NvMediaImageSiblingDestroy,
486  * \ref NvMediaImageCreateVideoSibling, \ref NvMediaVideoSurfaceSiblingDestroy
487  *
488  */
491 #ifdef __cplusplus
492 }; /* extern "C" */
493 #endif
494 
495 #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
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:231
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:214
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:178
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.
14 bits per pixel.
Holds a rectangular region of a surface.
Definition: nvmedia_core.h:135
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:284
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.