NVIDIA DRIVE OS Linux SDK API Reference

5.1.9.0 Release

 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
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 {
326  NvScrncaptBool enabled;
328  unsigned int windowIdx;
334  unsigned int winDepth;
336  unsigned int alpha;
338  NvScrncaptBool invertH;
340  NvScrncaptBool invertV;
346 
350 typedef struct {
352  unsigned int headIdx;
354  NvScrncaptBool enabled;
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 */
unsigned char r
Definition: nvscrncapt.h:239
unsigned char u
Definition: nvscrncapt.h:245
unsigned int lengthV
Holds the V buffer length.
Definition: nvscrncapt.h:301
unsigned char * pV
Holds the V surface pointer.
Definition: nvscrncapt.h:299
Indicates not supported.
Definition: nvscrncapt.h:148
Indicates a an out-of-memory condition.
Definition: nvscrncapt.h:144
NvScrncaptBool enabled
Holds a flag indicating if this window is enabled.
Definition: nvscrncapt.h:326
unsigned int strideUV
Holds the U/V surface stride.
Definition: nvscrncapt.h:297
int numWins
Holds the number of windows assigned to this head.
Definition: nvscrncapt.h:360
Indicates a catch-all error, used when no other error code applies.
Definition: nvscrncapt.h:150
Holds a pixel value.
Definition: nvscrncapt.h:236
Holds the representation of a window's current state.
Definition: nvscrncapt.h:324
unsigned int strideRGB
Definition: nvscrncapt.h:289
int height
Holds the height.
Definition: nvscrncapt.h:318
NvScrncaptStatus NvScrncaptInit(NvScrncaptResult **pResult)
Initializes data structures required for screen capture.
unsigned int strideY
Definition: nvscrncapt.h:290
Indicates an incompatible version.
Definition: nvscrncapt.h:154
unsigned int resolutionH
Holds the horizaontal display resolution.
Definition: nvscrncapt.h:356
int numHeads
Holds the number of active heads.
Definition: nvscrncapt.h:380
NvScrncaptColorFormat pixelFormat
Holds the pixel color format.
Definition: nvscrncapt.h:276
unsigned char * pY
Definition: nvscrncapt.h:280
unsigned int lengthU
Holds the U buffer length.
Definition: nvscrncapt.h:295
NvScrncaptColorFormat
Defines the set of pixel color formats, which must be kept in sync with the kernel defines...
Definition: nvscrncapt.h:170
NvScrncaptStatus NvScrncaptCapture(NvScrncaptResult *result, unsigned int headMask)
Conducts screen capture on heads selected by input bitmask.
unsigned int winDepth
Holds the window depth.
Definition: nvscrncapt.h:334
unsigned int lengthY
Definition: nvscrncapt.h:285
Indicates invalid size.
Definition: nvscrncapt.h:152
NvScrncaptAperture outputAperture
Holds the output aperture.
Definition: nvscrncapt.h:344
#define NVSCRNCAPT_MAX_HEADS
Max # of Display Heads.
Definition: nvscrncapt.h:120
Holds the representation of a display aperture.
Definition: nvscrncapt.h:310
Holds statistics for a single capture.
Definition: nvscrncapt.h:368
Holds planes within the frame buffer.
Definition: nvscrncapt.h:272
Holds a head's current state.
Definition: nvscrncapt.h:350
unsigned int windowIdx
Holds the hardware window index whith which this handle is associated.
Definition: nvscrncapt.h:328
unsigned int resolutionV
Holds the vertical display resolution.
Definition: nvscrncapt.h:358
void * reserved
Holds the reserved for library use: do not manipulate.
Definition: nvscrncapt.h:390
NvScrncaptBlend
Defines the set of blend modes possible for a window.
Definition: nvscrncapt.h:226
The operation completed successfully; no error.
Definition: nvscrncapt.h:136
unsigned char b
Definition: nvscrncapt.h:249
NvScrncaptBlend blendMode
Holds the blend mode.
Definition: nvscrncapt.h:332
unsigned char * pRGB
Definition: nvscrncapt.h:279
unsigned char * userAddress
Holds the user-provided address of pre-allocated memory.
Definition: nvscrncapt.h:384
unsigned int alpha
Holds the global alpha value for window.
Definition: nvscrncapt.h:336
unsigned int lengthRGB
Definition: nvscrncapt.h:284
int width
Holds the width.
Definition: nvscrncapt.h:316
int startX
Holds the X-coordinate of start position.
Definition: nvscrncapt.h:312
#define NVSCRNCAPT_MAX_WINS
Max # of Windows.
Definition: nvscrncapt.h:122
NvScrncaptBool enabled
Holds the a flag indicating whether this head is enabled.
Definition: nvscrncapt.h:354
NvScrncaptStatistics stats
Holds the capture statistics.
Definition: nvscrncapt.h:388
unsigned char alpha
Holds the alpha pixel value.
Definition: nvscrncapt.h:253
unsigned int memSize
Holds the size of memory allocated for this capture in bytes.
Definition: nvscrncapt.h:370
NvScrncaptSurfaceMap surfaceMap
Holds the handle to the associated frame buffer surface map.
Definition: nvscrncapt.h:330
int NvScrncaptBool
A boolean value, holding NVSCRNCAPT_TRUE or NVSCRNCAPT_FALSE.
Definition: nvscrncapt.h:128
NvScrncaptAperture fbAperture
Holds the framebuffer aperture.
Definition: nvscrncapt.h:342
unsigned int userDataSize
Holds the size of user-allocated memory.
Definition: nvscrncapt.h:386
NvScrncaptSurfaceLayout surfaceLayout
Holds the surface layout.
Definition: nvscrncapt.h:274
Holds the screen capture result.
Definition: nvscrncapt.h:378
NvScrncaptSurfaceLayout
Defines the set of frame buffer memory layout types.
Definition: nvscrncapt.h:160
int startY
Holds the Y-coordinate of start position.
Definition: nvscrncapt.h:314
unsigned char v
Definition: nvscrncapt.h:250
NvScrncaptBool invertV
Holds the vertical inversion.
Definition: nvscrncapt.h:340
unsigned char g
Definition: nvscrncapt.h:244
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...
NvScrncaptBool invertH
Holds the horizontal inversion.
Definition: nvscrncapt.h:338
unsigned char y
Definition: nvscrncapt.h:240
Indicates a operation timed out.
Definition: nvscrncapt.h:142
NvScrncaptStatus
Defines the set of all possible error codes.
Definition: nvscrncapt.h:134
unsigned int captureTimeUsec
Holds the uSec taken for capture.
Definition: nvscrncapt.h:372
Indicates not initialized.
Definition: nvscrncapt.h:146
unsigned char blockHeight
Holds the block Height.
Definition: nvscrncapt.h:303
unsigned char * pU
Holds the U surface pointer.
Definition: nvscrncapt.h:293
Indicates a bad parameter was passed.
Definition: nvscrncapt.h:138
unsigned int headIdx
Holds the index of this display head.
Definition: nvscrncapt.h:352
Indicates a the resource is busy.
Definition: nvscrncapt.h:140
NvScrncaptStatus NvScrncaptCleanup(NvScrncaptResult *result)
Cleans up associated data structures and releases exclusive hold on screen capture functionality...