@lumiscia/lumen-cli-linux-arm64 0.0.0-stage → 0.6.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,553 @@
1
+ /*
2
+ * This copyright notice applies to this header file only:
3
+ *
4
+ * Copyright (c) 2010-2026 NVIDIA Corporation
5
+ *
6
+ * Permission is hereby granted, free of charge, to any person
7
+ * obtaining a copy of this software and associated documentation
8
+ * files (the "Software"), to deal in the Software without
9
+ * restriction, including without limitation the rights to use,
10
+ * copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ * copies of the software, and to permit persons to whom the
12
+ * software is furnished to do so, subject to the following
13
+ * conditions:
14
+ *
15
+ * The above copyright notice and this permission notice shall be
16
+ * included in all copies or substantial portions of the Software.
17
+ *
18
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
19
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
20
+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
21
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
22
+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
23
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
24
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
25
+ * OTHER DEALINGS IN THE SOFTWARE.
26
+ */
27
+
28
+ /********************************************************************************************************************/
29
+ //! \file nvcuvid.h
30
+ //! NVDECODE API provides video decoding interface to NVIDIA GPU devices.
31
+ //! \date 2015-2024
32
+ //! This file contains the interface constants, structure definitions and function prototypes.
33
+ /********************************************************************************************************************/
34
+
35
+ #if !defined(__NVCUVID_H__)
36
+ #define __NVCUVID_H__
37
+
38
+ #include "dynlink_cuviddec.h"
39
+
40
+ #if defined(__cplusplus)
41
+ extern "C" {
42
+ #endif /* __cplusplus */
43
+
44
+ #define MAX_CLOCK_TS 3
45
+
46
+ /***********************************************/
47
+ //!
48
+ //! High-level helper APIs for video sources
49
+ //!
50
+ /***********************************************/
51
+
52
+ typedef void *CUvideosource;
53
+ typedef void *CUvideoparser;
54
+
55
+
56
+ /************************************************************************/
57
+ //! \enum cudaVideoState
58
+ //! Video source state enums
59
+ //! Used in cuvidSetVideoSourceState and cuvidGetVideoSourceState APIs
60
+ /************************************************************************/
61
+ typedef enum {
62
+ cudaVideoState_Error = -1, /**< Error state (invalid source) */
63
+ cudaVideoState_Stopped = 0, /**< Source is stopped (or reached end-of-stream) */
64
+ cudaVideoState_Started = 1 /**< Source is running and delivering data */
65
+ } cudaVideoState;
66
+
67
+ /************************************************************************/
68
+ //! \enum cudaAudioCodec
69
+ //! Audio compression enums
70
+ //! Used in CUAUDIOFORMAT structure
71
+ /************************************************************************/
72
+ typedef enum {
73
+ cudaAudioCodec_MPEG1=0, /**< MPEG-1 Audio */
74
+ cudaAudioCodec_MPEG2, /**< MPEG-2 Audio */
75
+ cudaAudioCodec_MP3, /**< MPEG-1 Layer III Audio */
76
+ cudaAudioCodec_AC3, /**< Dolby Digital (AC3) Audio */
77
+ cudaAudioCodec_LPCM, /**< PCM Audio */
78
+ cudaAudioCodec_AAC, /**< AAC Audio */
79
+ } cudaAudioCodec;
80
+
81
+ /************************************************************************/
82
+ //! \ingroup STRUCTS
83
+ //! \struct TIMECODESET
84
+ //! Used to store Time code set extracted from H264 and HEVC codecs
85
+ /************************************************************************/
86
+ typedef struct _TIMECODESET
87
+ {
88
+ unsigned int time_offset_value;
89
+ unsigned short n_frames;
90
+ unsigned char clock_timestamp_flag;
91
+ unsigned char units_field_based_flag;
92
+ unsigned char counting_type;
93
+ unsigned char full_timestamp_flag;
94
+ unsigned char discontinuity_flag;
95
+ unsigned char cnt_dropped_flag;
96
+ unsigned char seconds_value;
97
+ unsigned char minutes_value;
98
+ unsigned char hours_value;
99
+ unsigned char seconds_flag;
100
+ unsigned char minutes_flag;
101
+ unsigned char hours_flag;
102
+ unsigned char time_offset_length;
103
+ unsigned char reserved;
104
+ } TIMECODESET;
105
+
106
+ /************************************************************************/
107
+ //! \ingroup STRUCTS
108
+ //! \struct TIMECODE
109
+ //! Used to extract Time code in H264 and HEVC codecs
110
+ /************************************************************************/
111
+ typedef struct _TIMECODE
112
+ {
113
+ TIMECODESET time_code_set[MAX_CLOCK_TS];
114
+ unsigned char num_clock_ts;
115
+ } TIMECODE;
116
+
117
+ /**********************************************************************************/
118
+ //! \ingroup STRUCTS
119
+ //! \struct SEIMASTERINGDISPLAYINFO
120
+ //! Used to extract mastering display color volume SEI in H264 and HEVC codecs
121
+ /**********************************************************************************/
122
+ typedef struct _SEIMASTERINGDISPLAYINFO
123
+ {
124
+ unsigned short display_primaries_x[3];
125
+ unsigned short display_primaries_y[3];
126
+ unsigned short white_point_x;
127
+ unsigned short white_point_y;
128
+ unsigned int max_display_mastering_luminance;
129
+ unsigned int min_display_mastering_luminance;
130
+ } SEIMASTERINGDISPLAYINFO;
131
+
132
+ /**********************************************************************************/
133
+ //! \ingroup STRUCTS
134
+ //! \struct SEICONTENTLIGHTLEVELINFO
135
+ //! Used to extract content light level info SEI in H264 and HEVC codecs
136
+ /**********************************************************************************/
137
+ typedef struct _SEICONTENTLIGHTLEVELINFO
138
+ {
139
+ unsigned short max_content_light_level;
140
+ unsigned short max_pic_average_light_level;
141
+ unsigned int reserved;
142
+ } SEICONTENTLIGHTLEVELINFO;
143
+
144
+ /**********************************************************************************/
145
+ //! \ingroup STRUCTS
146
+ //! \struct TIMECODEMPEG2
147
+ //! Used to extract Time code in MPEG2 codec
148
+ /**********************************************************************************/
149
+ typedef struct _TIMECODEMPEG2
150
+ {
151
+ unsigned char drop_frame_flag;
152
+ unsigned char time_code_hours;
153
+ unsigned char time_code_minutes;
154
+ unsigned char marker_bit;
155
+ unsigned char time_code_seconds;
156
+ unsigned char time_code_pictures;
157
+ } TIMECODEMPEG2;
158
+
159
+ /**********************************************************************************/
160
+ //! \ingroup STRUCTS
161
+ //! \struct SEIALTERNATIVETRANSFERCHARACTERISTICS
162
+ //! Used to extract alternative transfer characteristics SEI in H264 and HEVC codecs
163
+ /**********************************************************************************/
164
+ typedef struct _SEIALTERNATIVETRANSFERCHARACTERISTICS
165
+ {
166
+ unsigned char preferred_transfer_characteristics;
167
+ } SEIALTERNATIVETRANSFERCHARACTERISTICS;
168
+
169
+ /**********************************************************************************/
170
+ //! \ingroup STRUCTS
171
+ //! \struct CUSEIMESSAGE;
172
+ //! Used in CUVIDSEIMESSAGEINFO structure
173
+ /**********************************************************************************/
174
+ typedef struct _CUSEIMESSAGE
175
+ {
176
+ unsigned char sei_message_type; /**< OUT: SEI Message Type */
177
+ unsigned char reserved[3];
178
+ unsigned int sei_message_size; /**< OUT: SEI Message Size */
179
+ } CUSEIMESSAGE;
180
+
181
+ /************************************************************************************************/
182
+ //! \ingroup STRUCTS
183
+ //! \struct CUVIDEOFORMAT
184
+ //! Video format
185
+ //! Used in cuvidGetSourceVideoFormat API
186
+ /************************************************************************************************/
187
+ typedef struct
188
+ {
189
+ cudaVideoCodec codec; /**< OUT: Compression format */
190
+ /**
191
+ * OUT: frame rate = numerator / denominator (for example: 30000/1001)
192
+ */
193
+ struct {
194
+ /**< OUT: frame rate numerator (0 = unspecified or variable frame rate) */
195
+ unsigned int numerator;
196
+ /**< OUT: frame rate denominator (0 = unspecified or variable frame rate) */
197
+ unsigned int denominator;
198
+ } frame_rate;
199
+ unsigned char progressive_sequence; /**< OUT: 0=interlaced, 1=progressive */
200
+ unsigned char bit_depth_luma_minus8; /**< OUT: high bit depth luma. E.g, 2 for 10-bitdepth, 4 for 12-bitdepth */
201
+ unsigned char bit_depth_chroma_minus8; /**< OUT: high bit depth chroma. E.g, 2 for 10-bitdepth, 4 for 12-bitdepth */
202
+ unsigned char min_num_decode_surfaces; /**< OUT: Minimum number of decode surfaces to be allocated for correct
203
+ decoding. The client can send this value in ulNumDecodeSurfaces
204
+ (in CUVIDDECODECREATEINFO structure).
205
+ This guarantees correct functionality and optimal video memory
206
+ usage but not necessarily the best performance, which depends on
207
+ the design of the overall application. The optimal number of
208
+ decode surfaces (in terms of performance and memory utilization)
209
+ should be decided by experimentation for each application, but it
210
+ cannot go below min_num_decode_surfaces.
211
+ If this value is used for ulNumDecodeSurfaces then it must be
212
+ returned to parser during sequence callback. */
213
+ unsigned int coded_width; /**< OUT: coded frame width in pixels */
214
+ unsigned int coded_height; /**< OUT: coded frame height in pixels */
215
+ /**
216
+ * area of the frame that should be displayed
217
+ * typical example:
218
+ * coded_width = 1920, coded_height = 1088
219
+ * display_area = { 0,0,1920,1080 }
220
+ */
221
+ struct {
222
+ int left; /**< OUT: left position of display rect */
223
+ int top; /**< OUT: top position of display rect */
224
+ int right; /**< OUT: right position of display rect */
225
+ int bottom; /**< OUT: bottom position of display rect */
226
+ } display_area;
227
+ cudaVideoChromaFormat chroma_format; /**< OUT: Chroma format */
228
+ unsigned int bitrate; /**< OUT: video bitrate (bps, 0=unknown) */
229
+ /**
230
+ * OUT: Display Aspect Ratio = x:y (4:3, 16:9, etc)
231
+ */
232
+ struct {
233
+ int x;
234
+ int y;
235
+ } display_aspect_ratio;
236
+ /**
237
+ * Video Signal Description
238
+ * Refer section E.2.1 (VUI parameters semantics) of H264 spec file
239
+ */
240
+ struct {
241
+ unsigned char video_format : 3; /**< OUT: 0-Component, 1-PAL, 2-NTSC, 3-SECAM, 4-MAC, 5-Unspecified */
242
+ unsigned char video_full_range_flag : 1; /**< OUT: indicates the black level and luma and chroma range */
243
+ unsigned char reserved_zero_bits : 4; /**< Reserved bits */
244
+ unsigned char color_primaries; /**< OUT: chromaticity coordinates of source primaries */
245
+ unsigned char transfer_characteristics; /**< OUT: opto-electronic transfer characteristic of the source picture */
246
+ unsigned char matrix_coefficients; /**< OUT: used in deriving luma and chroma signals from RGB primaries */
247
+ } video_signal_description;
248
+ unsigned int seqhdr_data_length; /**< OUT: Additional bytes following (CUVIDEOFORMATEX) */
249
+ } CUVIDEOFORMAT;
250
+
251
+ /****************************************************************/
252
+ //! \ingroup STRUCTS
253
+ //! \struct CUVIDOPERATINGPOINTINFO
254
+ //! Operating point information of scalable bitstream
255
+ /****************************************************************/
256
+ typedef struct
257
+ {
258
+ cudaVideoCodec codec;
259
+ union
260
+ {
261
+ struct
262
+ {
263
+ unsigned char operating_points_cnt;
264
+ unsigned char reserved24_bits[3];
265
+ unsigned short operating_points_idc[32];
266
+ } av1;
267
+ unsigned char CodecReserved[1024];
268
+ };
269
+ } CUVIDOPERATINGPOINTINFO;
270
+
271
+ /**********************************************************************************/
272
+ //! \ingroup STRUCTS
273
+ //! \struct CUVIDSEIMESSAGEINFO
274
+ //! Used in cuvidParseVideoData API with PFNVIDSEIMSGCALLBACK pfnGetSEIMsg
275
+ /**********************************************************************************/
276
+ typedef struct _CUVIDSEIMESSAGEINFO
277
+ {
278
+ void *pSEIData; /**< OUT: SEI Message Data */
279
+ CUSEIMESSAGE *pSEIMessage; /**< OUT: SEI Message Info */
280
+ unsigned int sei_message_count; /**< OUT: SEI Message Count */
281
+ unsigned int picIdx; /**< OUT: SEI Message Pic Index */
282
+ } CUVIDSEIMESSAGEINFO;
283
+
284
+ /****************************************************************/
285
+ //! \ingroup STRUCTS
286
+ //! \struct CUVIDAV1SEQHDR
287
+ //! AV1 specific sequence header information
288
+ /****************************************************************/
289
+ typedef struct _CUVIDAV1SEQHDR {
290
+ unsigned int max_width;
291
+ unsigned int max_height;
292
+ unsigned char reserved[1016];
293
+ } CUVIDAV1SEQHDR;
294
+
295
+ /****************************************************************/
296
+ //! \ingroup STRUCTS
297
+ //! \struct CUVIDEOFORMATEX
298
+ //! Video format including raw sequence header information
299
+ //! Used in cuvidGetSourceVideoFormat API
300
+ /****************************************************************/
301
+ typedef struct
302
+ {
303
+ CUVIDEOFORMAT format; /**< OUT: CUVIDEOFORMAT structure */
304
+ union {
305
+ CUVIDAV1SEQHDR av1;
306
+ unsigned char raw_seqhdr_data[1024]; /**< OUT: Sequence header data */
307
+ };
308
+ } CUVIDEOFORMATEX;
309
+
310
+ /****************************************************************/
311
+ //! \ingroup STRUCTS
312
+ //! \struct CUAUDIOFORMAT
313
+ //! Audio formats
314
+ //! Used in cuvidGetSourceAudioFormat API
315
+ /****************************************************************/
316
+ typedef struct
317
+ {
318
+ cudaAudioCodec codec; /**< OUT: Compression format */
319
+ unsigned int channels; /**< OUT: number of audio channels */
320
+ unsigned int samplespersec; /**< OUT: sampling frequency */
321
+ unsigned int bitrate; /**< OUT: For uncompressed, can also be used to determine bits per sample */
322
+ unsigned int reserved1; /**< Reserved for future use */
323
+ unsigned int reserved2; /**< Reserved for future use */
324
+ } CUAUDIOFORMAT;
325
+
326
+
327
+ /***************************************************************/
328
+ //! \enum CUvideopacketflags
329
+ //! Data packet flags
330
+ //! Used in CUVIDSOURCEDATAPACKET structure
331
+ /***************************************************************/
332
+ typedef enum {
333
+ CUVID_PKT_ENDOFSTREAM = 0x01, /**< Set when this is the last packet for this stream */
334
+ CUVID_PKT_TIMESTAMP = 0x02, /**< Timestamp is valid */
335
+ CUVID_PKT_DISCONTINUITY = 0x04, /**< Set when a discontinuity has to be signalled */
336
+ CUVID_PKT_ENDOFPICTURE = 0x08, /**< Set when the packet contains exactly one frame or one field */
337
+ CUVID_PKT_NOTIFY_EOS = 0x10, /**< If this flag is set along with CUVID_PKT_ENDOFSTREAM, an additional (dummy)
338
+ display callback will be invoked with null value of CUVIDPARSERDISPINFO which
339
+ should be interpreted as end of the stream. */
340
+ } CUvideopacketflags;
341
+
342
+ /*****************************************************************************/
343
+ //! \ingroup STRUCTS
344
+ //! \struct CUVIDSOURCEDATAPACKET
345
+ //! Data Packet
346
+ //! Used in cuvidParseVideoData API
347
+ //! IN for cuvidParseVideoData
348
+ /*****************************************************************************/
349
+ typedef struct _CUVIDSOURCEDATAPACKET
350
+ {
351
+ tcu_ulong flags; /**< IN: Combination of CUVID_PKT_XXX flags */
352
+ tcu_ulong payload_size; /**< IN: number of bytes in the payload (may be zero if EOS flag is set) */
353
+ const unsigned char *payload; /**< IN: Pointer to packet payload data (may be NULL if EOS flag is set) */
354
+ CUvideotimestamp timestamp; /**< IN: Presentation time stamp (10MHz clock), only valid if
355
+ CUVID_PKT_TIMESTAMP flag is set */
356
+ } CUVIDSOURCEDATAPACKET;
357
+
358
+ // Callback for packet delivery
359
+ typedef int (CUDAAPI *PFNVIDSOURCECALLBACK)(void *, CUVIDSOURCEDATAPACKET *);
360
+
361
+ /**************************************************************************************************************************/
362
+ //! \ingroup STRUCTS
363
+ //! \struct CUVIDSOURCEPARAMS
364
+ //! Describes parameters needed in cuvidCreateVideoSource API
365
+ //! NVDECODE API is intended for HW accelerated video decoding so CUvideosource doesn't have audio demuxer for all supported
366
+ //! containers. It's recommended to clients to use their own or third party demuxer if audio support is needed.
367
+ /**************************************************************************************************************************/
368
+ typedef struct _CUVIDSOURCEPARAMS
369
+ {
370
+ unsigned int ulClockRate; /**< IN: Time stamp units in Hz (0=default=10000000Hz) */
371
+ unsigned int bAnnexb : 1; /**< IN: AV1 annexB stream */
372
+ unsigned int uReserved : 31; /**< Reserved for future use - set to zero */
373
+ unsigned int uReserved1[6]; /**< Reserved for future use - set to zero */
374
+ void *pUserData; /**< IN: User private data passed in to the data handlers */
375
+ PFNVIDSOURCECALLBACK pfnVideoDataHandler; /**< IN: Called to deliver video packets */
376
+ PFNVIDSOURCECALLBACK pfnAudioDataHandler; /**< IN: Called to deliver audio packets. */
377
+ void *pvReserved2[8]; /**< Reserved for future use - set to NULL */
378
+ } CUVIDSOURCEPARAMS;
379
+
380
+
381
+ /**********************************************/
382
+ //! \ingroup ENUMS
383
+ //! \enum CUvideosourceformat_flags
384
+ //! CUvideosourceformat_flags
385
+ //! Used in cuvidGetSourceVideoFormat API
386
+ /**********************************************/
387
+ typedef enum {
388
+ CUVID_FMT_EXTFORMATINFO = 0x100 /**< Return extended format structure (CUVIDEOFORMATEX) */
389
+ } CUvideosourceformat_flags;
390
+
391
+ #if !defined(__APPLE__)
392
+ /***************************************************************************************************************************/
393
+ //! \ingroup FUNCTS
394
+ //! \fn CUresult CUDAAPI cuvidCreateVideoSource(CUvideosource *pObj, const char *pszFileName, CUVIDSOURCEPARAMS *pParams)
395
+ //! Create CUvideosource object. CUvideosource spawns demultiplexer thread that provides two callbacks:
396
+ //! pfnVideoDataHandler() and pfnAudioDataHandler()
397
+ //! NVDECODE API is intended for HW accelerated video decoding so CUvideosource doesn't have audio demuxer for all supported
398
+ //! containers. It's recommended to clients to use their own or third party demuxer if audio support is needed.
399
+ /***************************************************************************************************************************/
400
+ typedef CUresult CUDAAPI tcuvidCreateVideoSource(CUvideosource *pObj, const char *pszFileName, CUVIDSOURCEPARAMS *pParams);
401
+
402
+ /***************************************************************************************************************************/
403
+ //! \ingroup FUNCTS
404
+ //! \fn CUresult CUDAAPI cuvidCreateVideoSourceW(CUvideosource *pObj, const wchar_t *pwszFileName, CUVIDSOURCEPARAMS *pParams)
405
+ //! Create video source
406
+ /***************************************************************************************************************************/
407
+ typedef CUresult CUDAAPI tcuvidCreateVideoSourceW(CUvideosource *pObj, const wchar_t *pwszFileName, CUVIDSOURCEPARAMS *pParams);
408
+
409
+ /********************************************************************/
410
+ //! \ingroup FUNCTS
411
+ //! \fn CUresult CUDAAPI cuvidDestroyVideoSource(CUvideosource obj)
412
+ //! Destroy video source
413
+ /********************************************************************/
414
+ typedef CUresult CUDAAPI tcuvidDestroyVideoSource(CUvideosource obj);
415
+
416
+ /******************************************************************************************/
417
+ //! \ingroup FUNCTS
418
+ //! \fn CUresult CUDAAPI cuvidSetVideoSourceState(CUvideosource obj, cudaVideoState state)
419
+ //! Set video source state to:
420
+ //! cudaVideoState_Started - to signal the source to run and deliver data
421
+ //! cudaVideoState_Stopped - to stop the source from delivering the data
422
+ //! cudaVideoState_Error - invalid source
423
+ /******************************************************************************************/
424
+ typedef CUresult CUDAAPI tcuvidSetVideoSourceState(CUvideosource obj, cudaVideoState state);
425
+
426
+ /******************************************************************************************/
427
+ //! \ingroup FUNCTS
428
+ //! \fn cudaVideoState CUDAAPI cuvidGetVideoSourceState(CUvideosource obj)
429
+ //! Get video source state
430
+ //! Returns:
431
+ //! cudaVideoState_Started - if Source is running and delivering data
432
+ //! cudaVideoState_Stopped - if Source is stopped or reached end-of-stream
433
+ //! cudaVideoState_Error - if Source is in error state
434
+ /******************************************************************************************/
435
+ typedef cudaVideoState CUDAAPI tcuvidGetVideoSourceState(CUvideosource obj);
436
+
437
+ /******************************************************************************************************************/
438
+ //! \ingroup FUNCTS
439
+ //! \fn CUresult CUDAAPI cuvidGetSourceVideoFormat(CUvideosource obj, CUVIDEOFORMAT *pvidfmt, unsigned int flags)
440
+ //! Gets video source format in pvidfmt, flags is set to combination of CUvideosourceformat_flags as per requirement
441
+ /******************************************************************************************************************/
442
+ typedef CUresult CUDAAPI tcuvidGetSourceVideoFormat(CUvideosource obj, CUVIDEOFORMAT *pvidfmt, unsigned int flags);
443
+
444
+ /**************************************************************************************************************************/
445
+ //! \ingroup FUNCTS
446
+ //! \fn CUresult CUDAAPI cuvidGetSourceAudioFormat(CUvideosource obj, CUAUDIOFORMAT *paudfmt, unsigned int flags)
447
+ //! Get audio source format
448
+ //! NVDECODE API is intended for HW accelerated video decoding so CUvideosource doesn't have audio demuxer for all supported
449
+ //! containers. It's recommended to clients to use their own or third party demuxer if audio support is needed.
450
+ /**************************************************************************************************************************/
451
+ typedef CUresult CUDAAPI tcuvidGetSourceAudioFormat(CUvideosource obj, CUAUDIOFORMAT *paudfmt, unsigned int flags);
452
+
453
+ #endif
454
+ /**********************************************************************************/
455
+ //! \ingroup STRUCTS
456
+ //! \struct CUVIDPARSERDISPINFO
457
+ //! Used in cuvidParseVideoData API with PFNVIDDISPLAYCALLBACK pfnDisplayPicture
458
+ /**********************************************************************************/
459
+ typedef struct _CUVIDPARSERDISPINFO
460
+ {
461
+ int picture_index; /**< OUT: Index of the current picture */
462
+ int progressive_frame; /**< OUT: 1 if progressive frame; 0 otherwise */
463
+ int top_field_first; /**< OUT: 1 if top field is displayed first; 0 otherwise */
464
+ int repeat_first_field; /**< OUT: Number of additional fields (1=ivtc, 2=frame doubling, 4=frame tripling,
465
+ -1=unpaired field) */
466
+ CUvideotimestamp timestamp; /**< OUT: Presentation time stamp */
467
+ } CUVIDPARSERDISPINFO;
468
+
469
+ /***********************************************************************************************************************/
470
+ //! Parser callbacks
471
+ //! The parser will call these synchronously from within cuvidParseVideoData(), whenever there is sequence change or a picture
472
+ //! is ready to be decoded and/or displayed. First argument in functions is "void *pUserData" member of structure CUVIDSOURCEPARAMS
473
+ //! Return values from these callbacks are interpreted as below. If the callbacks return failure, it will be propagated by
474
+ //! cuvidParseVideoData() to the application.
475
+ //! Parser picks default operating point as 0 and outputAllLayers flag as 0 if PFNVIDOPPOINTCALLBACK is not set or return value is
476
+ //! -1 or invalid operating point.
477
+ //! PFNVIDSEQUENCECALLBACK : 0: fail, 1: succeeded, > 1: override dpb size of parser (set by CUVIDPARSERPARAMS::ulMaxNumDecodeSurfaces
478
+ //! while creating parser)
479
+ //! PFNVIDDECODECALLBACK : 0: fail, >=1: succeeded
480
+ //! PFNVIDDISPLAYCALLBACK : 0: fail, >=1: succeeded
481
+ //! PFNVIDOPPOINTCALLBACK : <0: fail, >=0: succeeded (bit 0-9: OperatingPoint, bit 10-10: outputAllLayers, bit 11-30: reserved)
482
+ //! PFNVIDSEIMSGCALLBACK : 0: fail, >=1: succeeded
483
+ /***********************************************************************************************************************/
484
+ typedef int (CUDAAPI *PFNVIDSEQUENCECALLBACK)(void *, CUVIDEOFORMAT *);
485
+ typedef int (CUDAAPI *PFNVIDDECODECALLBACK)(void *, CUVIDPICPARAMS *);
486
+ typedef int (CUDAAPI *PFNVIDDISPLAYCALLBACK)(void *, CUVIDPARSERDISPINFO *);
487
+ typedef int (CUDAAPI *PFNVIDOPPOINTCALLBACK)(void *, CUVIDOPERATINGPOINTINFO*);
488
+ typedef int (CUDAAPI *PFNVIDSEIMSGCALLBACK) (void *, CUVIDSEIMESSAGEINFO *);
489
+
490
+ /**************************************/
491
+ //! \ingroup STRUCTS
492
+ //! \struct CUVIDPARSERPARAMS
493
+ //! Used in cuvidCreateVideoParser API
494
+ /**************************************/
495
+ typedef struct _CUVIDPARSERPARAMS
496
+ {
497
+ cudaVideoCodec CodecType; /**< IN: cudaVideoCodec_XXX */
498
+ unsigned int ulMaxNumDecodeSurfaces; /**< IN: Max # of decode surfaces (parser will cycle through these) */
499
+ unsigned int ulClockRate; /**< IN: Timestamp units in Hz (0=default=10000000Hz) */
500
+ unsigned int ulErrorThreshold; /**< IN: % Error threshold (0-100) for calling pfnDecodePicture (100=always
501
+ IN: call pfnDecodePicture even if picture bitstream is fully corrupted) */
502
+ unsigned int ulMaxDisplayDelay; /**< IN: Max display queue delay (improves pipelining of decode with display)
503
+ 0=no delay (recommended values: 2..4) */
504
+ unsigned int bAnnexb : 1; /**< IN: AV1 annexB stream */
505
+ unsigned int bMemoryOptimize : 1; /**< IN: Utilize minimum picIdx from dpb to allow memory saving at the
506
+ decoder layer, use cuvidReconfigureDecoder() to increase the
507
+ decode surfaces if needed (perf may get impacted) */
508
+ unsigned int uReserved : 30; /**< Reserved for future use - set to zero */
509
+ unsigned int uReserved1[4]; /**< IN: Reserved for future use - set to 0 */
510
+ void *pUserData; /**< IN: User data for callbacks */
511
+ PFNVIDSEQUENCECALLBACK pfnSequenceCallback; /**< IN: Called before decoding frames and/or whenever there is a fmt change */
512
+ PFNVIDDECODECALLBACK pfnDecodePicture; /**< IN: Called when a picture is ready to be decoded (decode order) */
513
+ PFNVIDDISPLAYCALLBACK pfnDisplayPicture; /**< IN: Called whenever a picture is ready to be displayed (display order) */
514
+ PFNVIDOPPOINTCALLBACK pfnGetOperatingPoint; /**< IN: Called from AV1 sequence header to get operating point of a AV1
515
+ scalable bitstream */
516
+ PFNVIDSEIMSGCALLBACK pfnGetSEIMsg; /**< IN: Called when all SEI messages are parsed for particular frame */
517
+ void *pvReserved2[5]; /**< Reserved for future use - set to NULL */
518
+ CUVIDEOFORMATEX *pExtVideoInfo; /**< IN: [Optional] sequence header data from system layer */
519
+ } CUVIDPARSERPARAMS;
520
+
521
+ /************************************************************************************************/
522
+ //! \ingroup FUNCTS
523
+ //! \fn CUresult CUDAAPI cuvidCreateVideoParser(CUvideoparser *pObj, CUVIDPARSERPARAMS *pParams)
524
+ //! Create video parser object and initialize
525
+ /************************************************************************************************/
526
+ typedef CUresult CUDAAPI tcuvidCreateVideoParser(CUvideoparser *pObj, CUVIDPARSERPARAMS *pParams);
527
+
528
+ /************************************************************************************************/
529
+ //! \ingroup FUNCTS
530
+ //! \fn CUresult CUDAAPI cuvidParseVideoData(CUvideoparser obj, CUVIDSOURCEDATAPACKET *pPacket)
531
+ //! Parse the video data from source data packet in pPacket
532
+ //! Extracts parameter sets like SPS, PPS, bitstream etc. from pPacket and
533
+ //! calls back pfnDecodePicture with CUVIDPICPARAMS data for kicking of HW decoding
534
+ //! calls back pfnSequenceCallback with CUVIDEOFORMAT data for initial sequence header or when
535
+ //! the decoder encounters a video format change
536
+ //! calls back pfnDisplayPicture with CUVIDPARSERDISPINFO data to display a video frame
537
+ /************************************************************************************************/
538
+ typedef CUresult CUDAAPI tcuvidParseVideoData(CUvideoparser obj, CUVIDSOURCEDATAPACKET *pPacket);
539
+
540
+ /************************************************************************************************/
541
+ //! \ingroup FUNCTS
542
+ //! \fn CUresult CUDAAPI cuvidDestroyVideoParser(CUvideoparser obj)
543
+ //! Destroy the video parser
544
+ /************************************************************************************************/
545
+ typedef CUresult CUDAAPI tcuvidDestroyVideoParser(CUvideoparser obj);
546
+
547
+ /**********************************************************************************************/
548
+
549
+ #if defined(__cplusplus)
550
+ }
551
+ #endif /* __cplusplus */
552
+
553
+ #endif // __NVCUVID_H__
@@ -0,0 +1,61 @@
1
+ The first LICENSE below is the libvpx license (BSD-3-Clause).
2
+ The second LICENSE below is the license of the bundled third_party/x86inc assembly macros (ISC), which are assembled into libvpx on x86 and x64 targets.
3
+
4
+
5
+ LICENSE:
6
+
7
+ Copyright (c) 2010, The WebM Project authors. All rights reserved.
8
+
9
+ Redistribution and use in source and binary forms, with or without
10
+ modification, are permitted provided that the following conditions are
11
+ met:
12
+
13
+ * Redistributions of source code must retain the above copyright
14
+ notice, this list of conditions and the following disclaimer.
15
+
16
+ * Redistributions in binary form must reproduce the above copyright
17
+ notice, this list of conditions and the following disclaimer in
18
+ the documentation and/or other materials provided with the
19
+ distribution.
20
+
21
+ * Neither the name of Google, nor the WebM Project, nor the names
22
+ of its contributors may be used to endorse or promote products
23
+ derived from this software without specific prior written
24
+ permission.
25
+
26
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
27
+ "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
28
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
29
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
30
+ HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
31
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
32
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
33
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
34
+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
35
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
36
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
37
+
38
+
39
+
40
+ LICENSE:
41
+
42
+ Copyright (C) 2005-2012 x264 project
43
+
44
+ Authors: Loren Merritt <lorenm@u.washington.edu>
45
+ Anton Mitrofanov <BugMaster@narod.ru>
46
+ Jason Garrett-Glaser <darkshikari@gmail.com>
47
+ Henrik Gramner <hengar-6@student.ltu.se>
48
+
49
+ Permission to use, copy, modify, and/or distribute this software for any
50
+ purpose with or without fee is hereby granted, provided that the above
51
+ copyright notice and this permission notice appear in all copies.
52
+
53
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
54
+ WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
55
+ MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
56
+ ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
57
+ WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
58
+ ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
59
+ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
60
+
61
+