NVIDIA DRIVE OS Linux API Reference

5.1.3.0 Release

 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
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,
143  NvMediaSurfaceType type,
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 */
unsigned char * pY
Y surface pointer.
#define NvMediaSurfaceType
Defines the set of NvMedia surface types.
uint32_t height
Surface height.
Definition: nvmedia_video.h:64
uint32_t lumaHeight
Surface height in luma pixels.
Definition: nvmedia_video.h:99
uint32_t pitchV2
V2 surface pitch.
NvMediaVideoSurface * NvMediaVideoSurfaceCreateNew(NvMediaDevice *device, NvMediaSurfaceType type, NvMediaSurfAllocAttr *attrs, uint32_t numAllocAttrs, uint32_t flags)
Allocates a video surface object.
unsigned char * pU
U surface pointer.
unsigned char * pV
V surface pointer.
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.
NVIDIA Media Interface: Surface Handling
A handle representing a video surface map.
Definition: nvmedia_video.h:95
unsigned char * pRGBA
RGBA surface pointer.
void NvMediaVideoSurfaceDestroy(NvMediaVideoSurface *surface)
Destroys a video surface object.
uint32_t pitchU2
U2 surface pitch.
uint32_t pitchU
U surface pitch.
uint32_t pitchY2
Y2 surface pitch.
unsigned char * pU2
U2 surface pointer.
NvMediaStatus NvMediaVideoSurfaceLock(NvMediaVideoSurface *surface, NvMediaVideoSurfaceMap *surfaceMap)
Locks a video surface and returns the associated mapped pointers pointing to the Y, U and V surfaces that a software video decoder can fill up.
NVIDIA Media Interface: Core
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 ...
NvMediaStatus
The set of all possible error codes.
Definition: nvmedia_core.h:199
unsigned char * pV2
V2 surface pointer.
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:146
uint32_t lumaWidth
Surface width in luma pixels.
Definition: nvmedia_video.h:97
void * tag
Surface tag that can be used by the application.
Definition: nvmedia_video.h:67
uint32_t pitchY
Y surface pitch.
Holds NvMedia Surface allocation attributes.
void NvMediaDevice
An opaque handle representing a NvMediaDevice object.
Definition: nvmedia_core.h:305
NvMediaSurfaceType type
Surface type.
Definition: nvmedia_video.h:60
void NvMediaVideoSurfaceUnlock(NvMediaVideoSurface *surface)
Unlocks a video surface.
uint32_t pitchRGBA
RGBA surface pitch.
unsigned char * pY2
Y2 surface pointer.
uint32_t width
Surface width.
Definition: nvmedia_video.h:62
uint32_t pitchV
V surface pitch.
A handle representing a video surface object.
Definition: nvmedia_video.h:58
uint32_t colorStd
Surface color standard type.
Definition: nvmedia_video.h:69