NVIDIA DRIVE OS Linux SDK API Reference

5.1.15.2 Release
For Test and Development only
nvmedia_video.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 
16 #ifndef _NVMEDIA_VIDEO_H
17 #define _NVMEDIA_VIDEO_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_VIDEO_VERSION_MAJOR 1
37 
38 #define NVMEDIA_VIDEO_VERSION_MINOR 6
39 
58 typedef struct {
62  uint32_t width;
64  uint32_t height;
67  void *tag;
69  uint32_t colorStd;
71 
95 typedef struct {
97  uint32_t lumaWidth;
99  uint32_t lumaHeight;
101  unsigned char *pY;
103  uint32_t pitchY;
105  unsigned char *pU;
107  uint32_t pitchU;
109  unsigned char *pV;
111  uint32_t pitchV;
113  unsigned char *pY2;
115  uint32_t pitchY2;
117  unsigned char *pU2;
119  uint32_t pitchU2;
121  unsigned char *pV2;
123  uint32_t pitchV2;
125  unsigned char *pRGBA;
127  uint32_t pitchRGBA;
129 
142  NvMediaDevice *device,
144  NvMediaSurfAllocAttr *attrs,
145  uint32_t numAllocAttrs,
146  uint32_t flags
147 );
148 
153 void
155  NvMediaVideoSurface *surface
156 );
157 
171  NvMediaVideoSurface *surface,
172  NvMediaVideoSurfaceMap *surfaceMap
173 );
174 
180 void
182  NvMediaVideoSurface *surface
183 );
184 
210  NvMediaVideoSurface *videoSurface,
211  NvMediaRect *dstRect,
212  void **srcPntrs,
213  uint32_t *srcPitches
214 );
215 
241  NvMediaVideoSurface *videoSurface,
242  NvMediaRect *srcRect,
243  void **dstPntrs,
244  uint32_t *dstPitches
245 );
246 
249 /*
250  * \defgroup history_nvmedia_video History
251  * Provides change history for the NvMedia Video Surface handling
252  *
253  * \section history_nvmedia_video Version History
254  *
255  * <b> Version 1.0 </b> March 21, 2017
256  * - Initial release
257  *
258  * <b> Version 1.1 </b> May 15, 2017
259  * - Added deprecated warning message for \ref NvMediaVideoSurfaceCreateEx,
260  * \ref NvMediaVideoSurfaceSetAttributes
261  *
262  * <b> Version 1.2 </b> May 18, 2017
263  * - Added deprecated warning message for \ref NvMediaVideoSurfaceCreate
264  * - NvMediaVideoSurfaceWaitForCompletion() is deprecated
265  * - All NvMedia data types are moved to standard data types
266  *
267  * <b> Version 1.3 </b> May 18, 2017
268  * - Added colorStd member in \ref NvMediaVideoSurface
269  *
270  * <b> Version 1.4 </b> September 12, 2017
271  * - Removed NVMEDIA_SURFACE_CREATE_ATTRIBUTE_CAPTURE, NVMEDIA_SURFACE_CREATE_ATTRIBUTE_DISPLAY,
272  * NVMEDIA_SURFACE_ATTRIBUTE_INTERLACED
273  * - Deprecated \ref NvMediaVideoSurfaceCreate, \ref NvMediaVideoSurfaceCreateEx,
274  * \ref NvMediaVideoSurfaceSetAttributes
275  *
276  * <b> Version 1.5 </b> October 5, 2018
277  * - Updated the comments in the header to use new NvMediaSurfaceType values
278  *
279  * <b> Version 1.6 </b> January 16, 2019
280  * - Updated description for \ref NvMediaVideoSurfaceGetBits and \ref NvMediaVideoSurfacePutBits
281  *
282  */
283 
287 #ifdef __cplusplus
288 }; /* extern "C" */
289 #endif
290 
291 #endif /* _NVMEDIA_VIDEO_H */
NvMediaVideoSurfaceGetBits
NvMediaStatus NvMediaVideoSurfaceGetBits(NvMediaVideoSurface *videoSurface, NvMediaRect *srcRect, void **dstPntrs, uint32_t *dstPitches)
Reads an NvMedia video surface and writes the content into a client memory buffer.
NvMediaVideoSurfaceMap::pitchV
uint32_t pitchV
V surface pitch.
Definition: nvmedia_video.h:111
NvMediaVideoSurfaceMap::pV
unsigned char * pV
V surface pointer.
Definition: nvmedia_video.h:109
nvmedia_surface.h
NVIDIA Media Interface: Surface Handling
NvMediaVideoSurfaceMap::pY
unsigned char * pY
Y surface pointer.
Definition: nvmedia_video.h:101
NvMediaVideoSurfaceMap::pRGBA
unsigned char * pRGBA
RGBA surface pointer.
Definition: nvmedia_video.h:125
NvMediaVideoSurface::colorStd
uint32_t colorStd
Surface color standard type.
Definition: nvmedia_video.h:69
NvMediaVideoSurfaceMap::lumaHeight
uint32_t lumaHeight
Surface height in luma pixels.
Definition: nvmedia_video.h:99
NvMediaVideoSurfaceMap::pitchU
uint32_t pitchU
U surface pitch.
Definition: nvmedia_video.h:107
NvMediaVideoSurfaceMap::pitchY2
uint32_t pitchY2
Y2 surface pitch.
Definition: nvmedia_video.h:115
NvMediaVideoSurfaceMap::pU2
unsigned char * pU2
U2 surface pointer.
Definition: nvmedia_video.h:117
NvMediaVideoSurfaceMap::pitchV2
uint32_t pitchV2
V2 surface pitch.
Definition: nvmedia_video.h:123
NvMediaVideoSurfaceMap::pU
unsigned char * pU
U surface pointer.
Definition: nvmedia_video.h:105
NvMediaVideoSurface::tag
void * tag
Surface tag that can be used by the application.
Definition: nvmedia_video.h:67
NvMediaVideoSurfaceCreateNew
NvMediaVideoSurface * NvMediaVideoSurfaceCreateNew(NvMediaDevice *device, NvMediaSurfaceType type, NvMediaSurfAllocAttr *attrs, uint32_t numAllocAttrs, uint32_t flags)
Allocates a video surface object.
NvMediaVideoSurfaceMap::pV2
unsigned char * pV2
V2 surface pointer.
Definition: nvmedia_video.h:121
NvMediaDevice
struct NvMediaDevice NvMediaDevice
An opaque handle representing an NvMediaDevice object.
Definition: nvmedia_core.h:348
NvMediaVideoSurfaceMap::pitchU2
uint32_t pitchU2
U2 surface pitch.
Definition: nvmedia_video.h:119
type
int const char int type
Definition: drm-nvdc-docs.h:1479
NvMediaVideoSurfaceMap
A handle representing a video surface map.
Definition: nvmedia_video.h:95
NvMediaVideoSurfaceMap::pitchY
uint32_t pitchY
Y surface pitch.
Definition: nvmedia_video.h:103
NvMediaVideoSurface
A handle representing a video surface object.
Definition: nvmedia_video.h:58
NvMediaRect
Holds a rectangular region of a surface.
Definition: nvmedia_core.h:133
nvmedia_core.h
NVIDIA Media Interface: Core
NvMediaSurfaceType
#define NvMediaSurfaceType
Defines the set of NvMedia surface types.
Definition: nvmedia_surface.h:550
NvMediaVideoSurfaceMap::lumaWidth
uint32_t lumaWidth
Surface width in luma pixels.
Definition: nvmedia_video.h:97
NvMediaVideoSurface::width
uint32_t width
Surface width.
Definition: nvmedia_video.h:62
NvMediaStatus
NvMediaStatus
Defines all possible error codes.
Definition: nvmedia_core.h:180
NvMediaVideoSurface::height
uint32_t height
Surface height.
Definition: nvmedia_video.h:64
NvMediaVideoSurface::type
NvMediaSurfaceType type
Surface type.
Definition: nvmedia_video.h:60
NvMediaSurfAllocAttr
Holds NvMedia Surface allocation attributes.
Definition: nvmedia_surface.h:540
NvMediaVideoSurfaceLock
NvMediaStatus NvMediaVideoSurfaceLock(NvMediaVideoSurface *surface, NvMediaVideoSurfaceMap *surfaceMap)
Locks a video surface and returns the associated mapped pointers pointing to the Y,...
NvMediaVideoSurfaceMap::pY2
unsigned char * pY2
Y2 surface pointer.
Definition: nvmedia_video.h:113
NvMediaVideoSurfacePutBits
NvMediaStatus NvMediaVideoSurfacePutBits(NvMediaVideoSurface *videoSurface, NvMediaRect *dstRect, void **srcPntrs, uint32_t *srcPitches)
NvMediaVideoSurfacePutBits reads a client memory buffer and writes the content into an NvMedia video ...
NvMediaVideoSurfaceDestroy
void NvMediaVideoSurfaceDestroy(NvMediaVideoSurface *surface)
Destroys a video surface object.
NvMediaVideoSurfaceMap::pitchRGBA
uint32_t pitchRGBA
RGBA surface pitch.
Definition: nvmedia_video.h:127
NvMediaVideoSurfaceUnlock
void NvMediaVideoSurfaceUnlock(NvMediaVideoSurface *surface)
Unlocks a video surface.