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_video.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2017-2018, 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 5
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 
207  NvMediaVideoSurface *videoSurface,
208  NvMediaRect *dstRect,
209  void **srcPntrs,
210  uint32_t *srcPitches
211 );
212 
235  NvMediaVideoSurface *videoSurface,
236  NvMediaRect *srcRect,
237  void **dstPntrs,
238  uint32_t *dstPitches
239 );
240 
243 /*
244  * \defgroup history_nvmedia_video History
245  * Provides change history for the NvMedia Video Surface handling
246  *
247  * \section history_nvmedia_video Version History
248  *
249  * <b> Version 1.0 </b> March 21, 2017
250  * - Initial release
251  *
252  * <b> Version 1.1 </b> May 15, 2017
253  * - Added deprecated warning message for \ref NvMediaVideoSurfaceCreateEx,
254  * \ref NvMediaVideoSurfaceSetAttributes
255  *
256  * <b> Version 1.2 </b> May 18, 2017
257  * - Added deprecated warning message for \ref NvMediaVideoSurfaceCreate
258  * - NvMediaVideoSurfaceWaitForCompletion() is deprecated
259  * - All NvMedia data types are moved to standard data types
260  *
261  * <b> Version 1.3 </b> May 18, 2017
262  * - Added colorStd member in \ref NvMediaVideoSurface
263  *
264  * <b> Version 1.4 </b> September 12, 2017
265  * - Removed NVMEDIA_SURFACE_CREATE_ATTRIBUTE_CAPTURE, NVMEDIA_SURFACE_CREATE_ATTRIBUTE_DISPLAY,
266  * NVMEDIA_SURFACE_ATTRIBUTE_INTERLACED
267  * - Deprecated \ref NvMediaVideoSurfaceCreate, \ref NvMediaVideoSurfaceCreateEx,
268  * \ref NvMediaVideoSurfaceSetAttributes
269  *
270  * <b> Version 1.5 </b> October 5, 2018
271  * - Updated the comments in the header to use new NvMediaSurfaceType values
272  *
273  */
274 
278 #ifdef __cplusplus
279 }; /* extern "C" */
280 #endif
281 
282 #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