NVIDIA DRIVE OS Linux SDK API Reference

5.2.6 Release
For Test and Development only
nvscrncapt.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2016 NVIDIA Corporation. All Rights Reserved.
3  *
4  * NVIDIA Corporation and its licensors retain all intellectual property and
5  * proprietary rights in and to this software and related documentation. Any
6  * use, reproduction, disclosure or distribution of this software and related
7  * documentation without an express license agreement from NVIDIA Corporation
8  * is strictly prohibited.
9  */
10 
102 #ifndef _NVSCRNCAPT_H
103 #define _NVSCRNCAPT_H
104 
105 #ifdef __cplusplus
106 extern "C" {
107 #endif
108 
110 #define NVSCRNCAPT_VERSION_MAJOR 1
111 
112 #define NVSCRNCAPT_VERSION_MINOR 0
113 
115 #define NVSCRNCAPT_TRUE (0 == 0)
116 
117 #define NVSCRNCAPT_FALSE (0 == 1)
118 
120 #define NVSCRNCAPT_MAX_HEADS 4
121 
122 #define NVSCRNCAPT_MAX_WINS 6
123 
128 typedef int NvScrncaptBool;
129 
134 typedef enum {
156 
160 typedef enum {
165 
170 typedef enum {
172  /* NOTE: these enums need to be kept in sync with the kernel defines */
222 
226 typedef enum {
232 
236 typedef struct {
238  union {
239  unsigned char r;
240  unsigned char y;
241  };
243  union {
244  unsigned char g;
245  unsigned char u;
246  };
248  union {
249  unsigned char b;
250  unsigned char v;
251  };
253  unsigned char alpha;
255 
272 typedef struct {
278  union {
279  unsigned char *pRGB;
280  unsigned char *pY;
281  };
283  union {
284  unsigned int lengthRGB;
285  unsigned int lengthY;
286  };
288  union {
289  unsigned int strideRGB;
290  unsigned int strideY;
291  };
293  unsigned char *pU;
295  unsigned int lengthU;
297  unsigned int strideUV;
299  unsigned char *pV;
301  unsigned int lengthV;
303  unsigned char blockHeight;
305 
306 
310 typedef struct {
312  int startX;
314  int startY;
316  int width;
318  int height;
320 
324 typedef struct {
328  unsigned int windowIdx;
334  unsigned int winDepth;
336  unsigned int alpha;
346 
350 typedef struct {
352  unsigned int headIdx;
356  unsigned int resolutionH;
358  unsigned int resolutionV;
360  int numWins;
364 
368 typedef struct {
370  unsigned int memSize;
372  unsigned int captureTimeUsec;
374 
378 typedef struct {
380  int numHeads;
384  unsigned char *userAddress;
386  unsigned int userDataSize;
390  void *reserved;
392 
414 
442 NvScrncaptStatus NvScrncaptCapture(NvScrncaptResult *result, unsigned int headMask);
443 
460 
481 unsigned int NvScrncaptGetBlocklinearOffset(unsigned int x,
482  unsigned int y, unsigned int stride, unsigned int blockHeight);
483 
484 #ifdef __cplusplus
485 }; /* extern "C" */
486 #endif
487 
489 #endif /* _NVSCRNCAPT_H */
NvScrncaptAperture::startX
int startX
Holds the X-coordinate of start position.
Definition: nvscrncapt.h:312
NvScrncaptHeadState::numWins
int numWins
Holds the number of windows assigned to this head.
Definition: nvscrncapt.h:360
NvScrncaptCleanup
NvScrncaptStatus NvScrncaptCleanup(NvScrncaptResult *result)
Cleans up associated data structures and releases exclusive hold on screen capture functionality.
NvScrncaptColorFormat_XB5G5R5
@ NvScrncaptColorFormat_XB5G5R5
Definition: nvscrncapt.h:196
NvScrncaptWindowState::blendMode
NvScrncaptBlend blendMode
Holds the blend mode.
Definition: nvscrncapt.h:332
NvScrncaptColorFormat_YUV444SP
@ NvScrncaptColorFormat_YUV444SP
Definition: nvscrncapt.h:220
NvScrncaptColorFormat_B4G4R4A4
@ NvScrncaptColorFormat_B4G4R4A4
Definition: nvscrncapt.h:174
NvScrncaptColorFormat_YCbCr420SP
@ NvScrncaptColorFormat_YCbCr420SP
Definition: nvscrncapt.h:205
NvScrncaptColorFormat_RGB_AUTO
@ NvScrncaptColorFormat_RGB_AUTO
Definition: nvscrncapt.h:171
NvScrncaptColorFormat_R5G5B5A
@ NvScrncaptColorFormat_R5G5B5A
Definition: nvscrncapt.h:193
NvScrncaptWindowState::alpha
unsigned int alpha
Holds the global alpha value for window.
Definition: nvscrncapt.h:336
NVSCRNCAPT_STATUS_ERROR
@ NVSCRNCAPT_STATUS_ERROR
Indicates a catch-all error, used when no other error code applies.
Definition: nvscrncapt.h:150
NvScrncaptBlend_Premult
@ NvScrncaptBlend_Premult
Definition: nvscrncapt.h:228
NvScrncaptColorFormat_YCbCr444SP
@ NvScrncaptColorFormat_YCbCr444SP
Definition: nvscrncapt.h:211
NvScrncaptSurfaceMap::lengthV
unsigned int lengthV
Holds the V buffer length.
Definition: nvscrncapt.h:301
NvScrncaptSurfaceMap::pV
unsigned char * pV
Holds the V surface pointer.
Definition: nvscrncapt.h:299
NVSCRNCAPT_STATUS_BAD_PARAMETER
@ NVSCRNCAPT_STATUS_BAD_PARAMETER
Indicates a bad parameter was passed.
Definition: nvscrncapt.h:138
NvScrncaptColorFormat_YCbCr422RA
@ NvScrncaptColorFormat_YCbCr422RA
Definition: nvscrncapt.h:190
NvScrncaptHeadState::resolutionH
unsigned int resolutionH
Holds the horizaontal display resolution.
Definition: nvscrncapt.h:356
NvScrncaptColorFormat_YUV422SP
@ NvScrncaptColorFormat_YUV422SP
Definition: nvscrncapt.h:216
NvScrncaptPixel::r
unsigned char r
Definition: nvscrncapt.h:239
NvScrncaptWindowState::surfaceMap
NvScrncaptSurfaceMap surfaceMap
Holds the handle to the associated frame buffer surface map.
Definition: nvscrncapt.h:330
NvScrncaptSurfaceMap::lengthY
unsigned int lengthY
Definition: nvscrncapt.h:285
NvScrncaptSurfaceLayout_PitchLinear
@ NvScrncaptSurfaceLayout_PitchLinear
Definition: nvscrncapt.h:162
NvScrncaptColorFormat_YVU444SP
@ NvScrncaptColorFormat_YVU444SP
Definition: nvscrncapt.h:219
NvScrncaptColorFormat_YCrCb420SP
@ NvScrncaptColorFormat_YCrCb420SP
Definition: nvscrncapt.h:204
NvScrncaptColorFormat_AR5G5B5
@ NvScrncaptColorFormat_AR5G5B5
Definition: nvscrncapt.h:194
NvScrncaptWindowState::fbAperture
NvScrncaptAperture fbAperture
Holds the framebuffer aperture.
Definition: nvscrncapt.h:342
NvScrncaptAperture::height
int height
Holds the height.
Definition: nvscrncapt.h:318
NvScrncaptInit
NvScrncaptStatus NvScrncaptInit(NvScrncaptResult **pResult)
Initializes data structures required for screen capture.
NvScrncaptAperture::width
int width
Holds the width.
Definition: nvscrncapt.h:316
NvScrncaptSurfaceMap::strideRGB
unsigned int strideRGB
Definition: nvscrncapt.h:289
NvScrncaptColorFormat_YUV420P
@ NvScrncaptColorFormat_YUV420P
Definition: nvscrncapt.h:185
NvScrncaptSurfaceMap::pRGB
unsigned char * pRGB
Definition: nvscrncapt.h:279
NvScrncaptColorFormat_YUV422SPR
@ NvScrncaptColorFormat_YUV422SPR
Definition: nvscrncapt.h:218
NvScrncaptWindowState::invertV
NvScrncaptBool invertV
Holds the vertical inversion.
Definition: nvscrncapt.h:340
NvScrncaptSurfaceMap::pixelFormat
NvScrncaptColorFormat pixelFormat
Holds the pixel color format.
Definition: nvscrncapt.h:276
NVSCRNCAPT_STATUS_TIMED_OUT
@ NVSCRNCAPT_STATUS_TIMED_OUT
Indicates a operation timed out.
Definition: nvscrncapt.h:142
NvScrncaptResult::numHeads
int numHeads
Holds the number of active heads.
Definition: nvscrncapt.h:380
NvScrncaptWindowState::invertH
NvScrncaptBool invertH
Holds the horizontal inversion.
Definition: nvscrncapt.h:338
NVSCRNCAPT_STATUS_OK
@ NVSCRNCAPT_STATUS_OK
The operation completed successfully; no error.
Definition: nvscrncapt.h:136
NvScrncaptSurfaceMap::surfaceLayout
NvScrncaptSurfaceLayout surfaceLayout
Holds the surface layout.
Definition: nvscrncapt.h:274
NvScrncaptSurfaceMap::pU
unsigned char * pU
Holds the U surface pointer.
Definition: nvscrncapt.h:293
NvScrncaptColorFormat
NvScrncaptColorFormat
Defines the set of pixel color formats, which must be kept in sync with the kernel defines.
Definition: nvscrncapt.h:170
NvScrncaptHeadState::enabled
NvScrncaptBool enabled
Holds the a flag indicating whether this head is enabled.
Definition: nvscrncapt.h:354
NVSCRNCAPT_MAX_HEADS
#define NVSCRNCAPT_MAX_HEADS
Max # of Display Heads.
Definition: nvscrncapt.h:120
NvScrncaptColorFormat_B5G6R5
@ NvScrncaptColorFormat_B5G6R5
Definition: nvscrncapt.h:176
NVSCRNCAPT_STATUS_INVALID_SIZE
@ NVSCRNCAPT_STATUS_INVALID_SIZE
Indicates invalid size.
Definition: nvscrncapt.h:152
NvScrncaptCapture
NvScrncaptStatus NvScrncaptCapture(NvScrncaptResult *result, unsigned int headMask)
Conducts screen capture on heads selected by input bitmask.
NvScrncaptSurfaceMap::lengthU
unsigned int lengthU
Holds the U buffer length.
Definition: nvscrncapt.h:295
NvScrncaptColorFormat_R8G8B8A8
@ NvScrncaptColorFormat_R8G8B8A8
Definition: nvscrncapt.h:179
NvScrncaptStatistics
Holds statistics for a single capture.
Definition: nvscrncapt.h:368
NVSCRNCAPT_STATUS_OUT_OF_MEMORY
@ NVSCRNCAPT_STATUS_OUT_OF_MEMORY
Indicates a an out-of-memory condition.
Definition: nvscrncapt.h:144
NvScrncaptColorFormat_R8G8B8X8
@ NvScrncaptColorFormat_R8G8B8X8
Definition: nvscrncapt.h:202
NvScrncaptColorFormat_YCrCb422SPR
@ NvScrncaptColorFormat_YCrCb422SPR
Definition: nvscrncapt.h:208
NvScrncaptPixel::alpha
unsigned char alpha
Holds the alpha pixel value.
Definition: nvscrncapt.h:253
NvScrncaptColorFormat_YVU422SPR
@ NvScrncaptColorFormat_YVU422SPR
Definition: nvscrncapt.h:217
NvScrncaptColorFormat_R6x2G6x2B6x2A8
@ NvScrncaptColorFormat_R6x2G6x2B6x2A8
Definition: nvscrncapt.h:181
NvScrncaptColorFormat_YCrCb422SP
@ NvScrncaptColorFormat_YCrCb422SP
Definition: nvscrncapt.h:206
NvScrncaptSurfaceMap::lengthRGB
unsigned int lengthRGB
Definition: nvscrncapt.h:284
NvScrncaptSurfaceMap::pY
unsigned char * pY
Definition: nvscrncapt.h:280
NvScrncaptColorFormat_YUV422R
@ NvScrncaptColorFormat_YUV422R
Definition: nvscrncapt.h:189
NvScrncaptResult::reserved
void * reserved
Holds the reserved for library use: do not manipulate.
Definition: nvscrncapt.h:390
NvScrncaptColorFormat_YUV422P
@ NvScrncaptColorFormat_YUV422P
Definition: nvscrncapt.h:187
NvScrncaptWindowState
Holds the representation of a window's current state.
Definition: nvscrncapt.h:324
NvScrncaptResult::userAddress
unsigned char * userAddress
Holds the user-provided address of pre-allocated memory.
Definition: nvscrncapt.h:384
NvScrncaptColorFormat_YCbCr422R
@ NvScrncaptColorFormat_YCbCr422R
Definition: nvscrncapt.h:188
NvScrncaptBlend
NvScrncaptBlend
Defines the set of blend modes possible for a window.
Definition: nvscrncapt.h:226
NvScrncaptColorFormat_YUV420SP
@ NvScrncaptColorFormat_YUV420SP
Definition: nvscrncapt.h:214
NVSCRNCAPT_MAX_WINS
#define NVSCRNCAPT_MAX_WINS
Max # of Windows.
Definition: nvscrncapt.h:122
NvScrncaptPixel::u
unsigned char u
Definition: nvscrncapt.h:245
NvScrncaptPixel::b
unsigned char b
Definition: nvscrncapt.h:249
NvScrncaptSurfaceMap::blockHeight
unsigned char blockHeight
Holds the block Height.
Definition: nvscrncapt.h:303
NvScrncaptSurfaceMap::strideUV
unsigned int strideUV
Holds the U/V surface stride.
Definition: nvscrncapt.h:297
NVSCRNCAPT_STATUS_NOT_SUPPORTED
@ NVSCRNCAPT_STATUS_NOT_SUPPORTED
Indicates not supported.
Definition: nvscrncapt.h:148
NvScrncaptSurfaceLayout_Tiled
@ NvScrncaptSurfaceLayout_Tiled
Definition: nvscrncapt.h:161
NvScrncaptColorFormat_B5G5R5A
@ NvScrncaptColorFormat_B5G5R5A
Definition: nvscrncapt.h:175
NvScrncaptColorFormat_YCbCr420P
@ NvScrncaptColorFormat_YCbCr420P
Definition: nvscrncapt.h:184
NvScrncaptColorFormat_R5G5B5X
@ NvScrncaptColorFormat_R5G5B5X
Definition: nvscrncapt.h:197
NvScrncaptColorFormat_YCbCr422
@ NvScrncaptColorFormat_YCbCr422
Definition: nvscrncapt.h:182
NvScrncaptWindowState::enabled
NvScrncaptBool enabled
Holds a flag indicating if this window is enabled.
Definition: nvscrncapt.h:326
NvScrncaptResult::stats
NvScrncaptStatistics stats
Holds the capture statistics.
Definition: nvscrncapt.h:388
NVSCRNCAPT_STATUS_INCOMPATIBLE_VERSION
@ NVSCRNCAPT_STATUS_INCOMPATIBLE_VERSION
Indicates an incompatible version.
Definition: nvscrncapt.h:154
NvScrncaptPixel::v
unsigned char v
Definition: nvscrncapt.h:250
NvScrncaptColorFormat_B5G5R5X
@ NvScrncaptColorFormat_B5G5R5X
Definition: nvscrncapt.h:195
NvScrncaptColorFormat_YVU420SP
@ NvScrncaptColorFormat_YVU420SP
Definition: nvscrncapt.h:213
NvScrncaptColorFormat_XR5G5B5
@ NvScrncaptColorFormat_XR5G5B5
Definition: nvscrncapt.h:198
NvScrncaptResult::userDataSize
unsigned int userDataSize
Holds the size of user-allocated memory.
Definition: nvscrncapt.h:386
NvScrncaptColorFormat_R4G4B4A4
@ NvScrncaptColorFormat_R4G4B4A4
Definition: nvscrncapt.h:192
NvScrncaptSurfaceMap
Holds planes within the frame buffer.
Definition: nvscrncapt.h:272
NvScrncaptSurfaceLayout
NvScrncaptSurfaceLayout
Defines the set of frame buffer memory layout types.
Definition: nvscrncapt.h:160
NVSCRNCAPT_STATUS_BUSY
@ NVSCRNCAPT_STATUS_BUSY
Indicates a the resource is busy.
Definition: nvscrncapt.h:140
NvScrncaptColorFormat_P8
@ NvScrncaptColorFormat_P8
Definition: nvscrncapt.h:173
NvScrncaptBool
int NvScrncaptBool
A boolean value, holding NVSCRNCAPT_TRUE or NVSCRNCAPT_FALSE.
Definition: nvscrncapt.h:128
NvScrncaptAperture
Holds the representation of a display aperture.
Definition: nvscrncapt.h:310
NvScrncaptPixel
Holds a pixel value.
Definition: nvscrncapt.h:236
NvScrncaptColorFormat_AB5G5R5
@ NvScrncaptColorFormat_AB5G5R5
Definition: nvscrncapt.h:177
NvScrncaptColorFormat_YCrCb444SP
@ NvScrncaptColorFormat_YCrCb444SP
Definition: nvscrncapt.h:210
NvScrncaptStatistics::memSize
unsigned int memSize
Holds the size of memory allocated for this capture in bytes.
Definition: nvscrncapt.h:370
NVSCRNCAPT_STATUS_NOT_INITIALIZED
@ NVSCRNCAPT_STATUS_NOT_INITIALIZED
Indicates not initialized.
Definition: nvscrncapt.h:146
NvScrncaptBlend_None
@ NvScrncaptBlend_None
Definition: nvscrncapt.h:227
NvScrncaptColorFormat_A8B8G8R8
@ NvScrncaptColorFormat_A8B8G8R8
Definition: nvscrncapt.h:200
NvScrncaptColorFormat_YCbCr444P
@ NvScrncaptColorFormat_YCbCr444P
Definition: nvscrncapt.h:203
NvScrncaptResult
Holds the screen capture result.
Definition: nvscrncapt.h:378
NvScrncaptColorFormat_R5G6B5
@ NvScrncaptColorFormat_R5G6B5
Definition: nvscrncapt.h:199
NvScrncaptHeadState::resolutionV
unsigned int resolutionV
Holds the vertical display resolution.
Definition: nvscrncapt.h:358
NvScrncaptPixel::y
unsigned char y
Definition: nvscrncapt.h:240
NvScrncaptColorFormat_B8G8R8X8
@ NvScrncaptColorFormat_B8G8R8X8
Definition: nvscrncapt.h:201
NvScrncaptColorFormat_YCbCr422SPR
@ NvScrncaptColorFormat_YCbCr422SPR
Definition: nvscrncapt.h:209
NvScrncaptColorFormat_YCbCr422P
@ NvScrncaptColorFormat_YCbCr422P
Definition: nvscrncapt.h:186
NvScrncaptColorFormat_YUV422
@ NvScrncaptColorFormat_YUV422
Definition: nvscrncapt.h:183
NvScrncaptWindowState::outputAperture
NvScrncaptAperture outputAperture
Holds the output aperture.
Definition: nvscrncapt.h:344
NvScrncaptWindowState::winDepth
unsigned int winDepth
Holds the window depth.
Definition: nvscrncapt.h:334
NvScrncaptSurfaceMap::strideY
unsigned int strideY
Definition: nvscrncapt.h:290
NvScrncaptHeadState
Holds a head's current state.
Definition: nvscrncapt.h:350
NvScrncaptGetBlocklinearOffset
unsigned int NvScrncaptGetBlocklinearOffset(unsigned int x, unsigned int y, unsigned int stride, unsigned int blockHeight)
Auxiliary function to calculate byte offset for a pixel for NvScrncaptSurfaceLayout_BlockLinear surfa...
NvScrncaptColorFormat_YVU422SP
@ NvScrncaptColorFormat_YVU422SP
Definition: nvscrncapt.h:215
NvScrncaptBlend_Colorkey
@ NvScrncaptBlend_Colorkey
Definition: nvscrncapt.h:230
NvScrncaptPixel::g
unsigned char g
Definition: nvscrncapt.h:244
NvScrncaptAperture::startY
int startY
Holds the Y-coordinate of start position.
Definition: nvscrncapt.h:314
NvScrncaptColorFormat_YUV444P
@ NvScrncaptColorFormat_YUV444P
Definition: nvscrncapt.h:212
NvScrncaptColorFormat_B8G8R8A8
@ NvScrncaptColorFormat_B8G8R8A8
Definition: nvscrncapt.h:178
NvScrncaptColorFormat_YUV422RA
@ NvScrncaptColorFormat_YUV422RA
Definition: nvscrncapt.h:191
NvScrncaptBlend_Coverage
@ NvScrncaptBlend_Coverage
Definition: nvscrncapt.h:229
NvScrncaptColorFormat_YCbCr422SP
@ NvScrncaptColorFormat_YCbCr422SP
Definition: nvscrncapt.h:207
NvScrncaptHeadState::headIdx
unsigned int headIdx
Holds the index of this display head.
Definition: nvscrncapt.h:352
NvScrncaptStatus
NvScrncaptStatus
Defines the set of all possible error codes.
Definition: nvscrncapt.h:134
NvScrncaptStatistics::captureTimeUsec
unsigned int captureTimeUsec
Holds the uSec taken for capture.
Definition: nvscrncapt.h:372
NvScrncaptSurfaceLayout_BlockLinear
@ NvScrncaptSurfaceLayout_BlockLinear
Definition: nvscrncapt.h:163
NvScrncaptColorFormat_B6x2G6x2R6x2A8
@ NvScrncaptColorFormat_B6x2G6x2R6x2A8
Definition: nvscrncapt.h:180
NvScrncaptWindowState::windowIdx
unsigned int windowIdx
Holds the hardware window index whith which this handle is associated.
Definition: nvscrncapt.h:328