mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-04-24 12:21:15 +00:00
compat/cuda: update cuvid/nvdec headers to Video Codec SDK 8.0.14
This raises the required minimum NVIDIA display driver versions: NVIDIA Linux display driver 378.13 or newer NVIDIA Windows display driver 378.66 or newer
This commit is contained in:
parent
23538ad2eb
commit
17f63d98e6
@ -43,6 +43,7 @@
|
|||||||
typedef int CUdevice;
|
typedef int CUdevice;
|
||||||
typedef void* CUarray;
|
typedef void* CUarray;
|
||||||
typedef void* CUcontext;
|
typedef void* CUcontext;
|
||||||
|
typedef void* CUstream;
|
||||||
#if defined(__x86_64) || defined(AMD64) || defined(_M_AMD64)
|
#if defined(__x86_64) || defined(AMD64) || defined(_M_AMD64)
|
||||||
typedef unsigned long long CUdeviceptr;
|
typedef unsigned long long CUdeviceptr;
|
||||||
#else
|
#else
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* This copyright notice applies to this header file only:
|
* This copyright notice applies to this header file only:
|
||||||
*
|
*
|
||||||
* Copyright (c) 2010-2016 NVIDIA Corporation
|
* Copyright (c) 2010-2017 NVIDIA Corporation
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person
|
* Permission is hereby granted, free of charge, to any person
|
||||||
* obtaining a copy of this software and associated documentation
|
* obtaining a copy of this software and associated documentation
|
||||||
@ -25,17 +25,17 @@
|
|||||||
* OTHER DEALINGS IN THE SOFTWARE.
|
* OTHER DEALINGS IN THE SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/*****************************************************************************************************/
|
||||||
* \file cuviddec.h
|
//! \file cuviddec.h
|
||||||
* NvCuvid API provides Video Decoding interface to NVIDIA GPU devices.
|
//! NVDECODE API provides video decoding interface to NVIDIA GPU devices.
|
||||||
* \date 2015-2016
|
//! \date 2015-2017
|
||||||
* This file contains constants, structure definitions and function prototypes used for decoding.
|
//! This file contains constants, structure definitions and function prototypes used for decoding.
|
||||||
*/
|
/*****************************************************************************************************/
|
||||||
|
|
||||||
#if !defined(__CUDA_VIDEO_H__)
|
#if !defined(__CUDA_VIDEO_H__)
|
||||||
#define __CUDA_VIDEO_H__
|
#define __CUDA_VIDEO_H__
|
||||||
|
|
||||||
#if defined(__x86_64) || defined(AMD64) || defined(_M_AMD64)
|
#if defined(_WIN64) || defined(__LP64__) || defined(__x86_64) || defined(AMD64) || defined(_M_AMD64)
|
||||||
#if (CUDA_VERSION >= 3020) && (!defined(CUDA_FORCE_API_VERSION) || (CUDA_FORCE_API_VERSION >= 3020))
|
#if (CUDA_VERSION >= 3020) && (!defined(CUDA_FORCE_API_VERSION) || (CUDA_FORCE_API_VERSION >= 3020))
|
||||||
#define __CUVID_DEVPTR64
|
#define __CUVID_DEVPTR64
|
||||||
#endif
|
#endif
|
||||||
@ -54,93 +54,126 @@ typedef unsigned long tcu_ulong;
|
|||||||
typedef void *CUvideodecoder;
|
typedef void *CUvideodecoder;
|
||||||
typedef struct _CUcontextlock_st *CUvideoctxlock;
|
typedef struct _CUcontextlock_st *CUvideoctxlock;
|
||||||
|
|
||||||
/**
|
/*********************************************************************************/
|
||||||
* \addtogroup VIDEO_DECODER Video Decoder
|
//! \enum cudaVideoCodec
|
||||||
* @{
|
//! Video codec enums
|
||||||
*/
|
//! These enums are used in CUVIDDECODECREATEINFO and CUVIDDECODECAPS structures
|
||||||
|
/*********************************************************************************/
|
||||||
/*!
|
|
||||||
* \enum cudaVideoCodec
|
|
||||||
* Video Codec Enums
|
|
||||||
*/
|
|
||||||
typedef enum cudaVideoCodec_enum {
|
typedef enum cudaVideoCodec_enum {
|
||||||
cudaVideoCodec_MPEG1=0, /**< MPEG1 */
|
cudaVideoCodec_MPEG1=0, /**< MPEG1 */
|
||||||
cudaVideoCodec_MPEG2, /**< MPEG2 */
|
cudaVideoCodec_MPEG2, /**< MPEG2 */
|
||||||
cudaVideoCodec_MPEG4, /**< MPEG4 */
|
cudaVideoCodec_MPEG4, /**< MPEG4 */
|
||||||
cudaVideoCodec_VC1, /**< VC1 */
|
cudaVideoCodec_VC1, /**< VC1 */
|
||||||
cudaVideoCodec_H264, /**< H264 */
|
cudaVideoCodec_H264, /**< H264 */
|
||||||
cudaVideoCodec_JPEG, /**< JPEG */
|
cudaVideoCodec_JPEG, /**< JPEG */
|
||||||
cudaVideoCodec_H264_SVC, /**< H264-SVC */
|
cudaVideoCodec_H264_SVC, /**< H264-SVC */
|
||||||
cudaVideoCodec_H264_MVC, /**< H264-MVC */
|
cudaVideoCodec_H264_MVC, /**< H264-MVC */
|
||||||
cudaVideoCodec_HEVC, /**< HEVC */
|
cudaVideoCodec_HEVC, /**< HEVC */
|
||||||
cudaVideoCodec_VP8, /**< VP8 */
|
cudaVideoCodec_VP8, /**< VP8 */
|
||||||
cudaVideoCodec_VP9, /**< VP9 */
|
cudaVideoCodec_VP9, /**< VP9 */
|
||||||
cudaVideoCodec_NumCodecs, /**< Max COdecs */
|
cudaVideoCodec_NumCodecs, /**< Max codecs */
|
||||||
// Uncompressed YUV
|
// Uncompressed YUV
|
||||||
cudaVideoCodec_YUV420 = (('I'<<24)|('Y'<<16)|('U'<<8)|('V')), /**< Y,U,V (4:2:0) */
|
cudaVideoCodec_YUV420 = (('I'<<24)|('Y'<<16)|('U'<<8)|('V')), /**< Y,U,V (4:2:0) */
|
||||||
cudaVideoCodec_YV12 = (('Y'<<24)|('V'<<16)|('1'<<8)|('2')), /**< Y,V,U (4:2:0) */
|
cudaVideoCodec_YV12 = (('Y'<<24)|('V'<<16)|('1'<<8)|('2')), /**< Y,V,U (4:2:0) */
|
||||||
cudaVideoCodec_NV12 = (('N'<<24)|('V'<<16)|('1'<<8)|('2')), /**< Y,UV (4:2:0) */
|
cudaVideoCodec_NV12 = (('N'<<24)|('V'<<16)|('1'<<8)|('2')), /**< Y,UV (4:2:0) */
|
||||||
cudaVideoCodec_YUYV = (('Y'<<24)|('U'<<16)|('Y'<<8)|('V')), /**< YUYV/YUY2 (4:2:2) */
|
cudaVideoCodec_YUYV = (('Y'<<24)|('U'<<16)|('Y'<<8)|('V')), /**< YUYV/YUY2 (4:2:2) */
|
||||||
cudaVideoCodec_UYVY = (('U'<<24)|('Y'<<16)|('V'<<8)|('Y')) /**< UYVY (4:2:2) */
|
cudaVideoCodec_UYVY = (('U'<<24)|('Y'<<16)|('V'<<8)|('Y')) /**< UYVY (4:2:2) */
|
||||||
} cudaVideoCodec;
|
} cudaVideoCodec;
|
||||||
|
|
||||||
/*!
|
/*********************************************************************************/
|
||||||
* \enum cudaVideoSurfaceFormat
|
//! \enum cudaVideoSurfaceFormat
|
||||||
* Video Surface Formats Enums
|
//! Video surface format enums used for output format of decoded output
|
||||||
*/
|
//! These enums are used in CUVIDDECODECREATEINFO structure
|
||||||
|
/*********************************************************************************/
|
||||||
typedef enum cudaVideoSurfaceFormat_enum {
|
typedef enum cudaVideoSurfaceFormat_enum {
|
||||||
cudaVideoSurfaceFormat_NV12=0, /**< NV12 */
|
cudaVideoSurfaceFormat_NV12=0, /**< NV12 format */
|
||||||
cudaVideoSurfaceFormat_P016=1 /**< P016 */
|
cudaVideoSurfaceFormat_P016=1 /**< 16 bit semiplaner format. Can be used for 10 bit(6LSB bits 0),
|
||||||
|
12 bit (4LSB bits 0) */
|
||||||
} cudaVideoSurfaceFormat;
|
} cudaVideoSurfaceFormat;
|
||||||
|
|
||||||
/*!
|
/******************************************************************************************************************/
|
||||||
* \enum cudaVideoDeinterlaceMode
|
//! \enum cudaVideoDeinterlaceMode
|
||||||
* Deinterlacing Modes Enums
|
//! Deinterlacing mode enums
|
||||||
*/
|
//! These enums are used in CUVIDDECODECREATEINFO structure
|
||||||
|
//! Use cudaVideoDeinterlaceMode_Weave for progressive content and for content that doesn't need deinterlacing
|
||||||
|
//! cudaVideoDeinterlaceMode_Adaptive needs more video memory than other DImodes
|
||||||
|
/******************************************************************************************************************/
|
||||||
typedef enum cudaVideoDeinterlaceMode_enum {
|
typedef enum cudaVideoDeinterlaceMode_enum {
|
||||||
cudaVideoDeinterlaceMode_Weave=0, /**< Weave both fields (no deinterlacing) */
|
cudaVideoDeinterlaceMode_Weave=0, /**< Weave both fields (no deinterlacing) */
|
||||||
cudaVideoDeinterlaceMode_Bob, /**< Drop one field */
|
cudaVideoDeinterlaceMode_Bob, /**< Drop one field */
|
||||||
cudaVideoDeinterlaceMode_Adaptive /**< Adaptive deinterlacing */
|
cudaVideoDeinterlaceMode_Adaptive /**< Adaptive deinterlacing */
|
||||||
} cudaVideoDeinterlaceMode;
|
} cudaVideoDeinterlaceMode;
|
||||||
|
|
||||||
/*!
|
/**************************************************************************************************************/
|
||||||
* \enum cudaVideoChromaFormat
|
//! \enum cudaVideoChromaFormat
|
||||||
* Chroma Formats Enums
|
//! Chroma format enums
|
||||||
*/
|
//! These enums are used in CUVIDDECODECREATEINFO and CUVIDDECODECAPS structures
|
||||||
|
//! JPEG supports Monochrome, YUV 4:2:0, YUV 4:2:2 and YUV 4:4:4 chroma formats.
|
||||||
|
//! H264, HEVC, VP9, VP8, VC1, MPEG1, MPEG2 and MPEG4 support YUV 4:2:0 chroma format only.
|
||||||
|
/**************************************************************************************************************/
|
||||||
typedef enum cudaVideoChromaFormat_enum {
|
typedef enum cudaVideoChromaFormat_enum {
|
||||||
cudaVideoChromaFormat_Monochrome=0, /**< MonoChrome */
|
cudaVideoChromaFormat_Monochrome=0, /**< MonoChrome */
|
||||||
cudaVideoChromaFormat_420, /**< 4:2:0 */
|
cudaVideoChromaFormat_420, /**< YUV 4:2:0 */
|
||||||
cudaVideoChromaFormat_422, /**< 4:2:2 */
|
cudaVideoChromaFormat_422, /**< YUV 4:2:2 */
|
||||||
cudaVideoChromaFormat_444 /**< 4:4:4 */
|
cudaVideoChromaFormat_444 /**< YUV 4:4:4 */
|
||||||
} cudaVideoChromaFormat;
|
} cudaVideoChromaFormat;
|
||||||
|
|
||||||
/*!
|
/*************************************************************************************************************/
|
||||||
* \enum cudaVideoCreateFlags
|
//! \enum cudaVideoCreateFlags
|
||||||
* Decoder Flags Enums
|
//! Decoder flag enums to select preferred decode path
|
||||||
*/
|
//! cudaVideoCreate_Default and cudaVideoCreate_PreferCUVID are most optimized, use these whenever possible
|
||||||
|
/*************************************************************************************************************/
|
||||||
typedef enum cudaVideoCreateFlags_enum {
|
typedef enum cudaVideoCreateFlags_enum {
|
||||||
cudaVideoCreate_Default = 0x00, /**< Default operation mode: use dedicated video engines */
|
cudaVideoCreate_Default = 0x00, /**< Default operation mode: use dedicated video engines */
|
||||||
cudaVideoCreate_PreferCUDA = 0x01, /**< Use a CUDA-based decoder if faster than dedicated engines (requires a valid vidLock object for multi-threading) */
|
cudaVideoCreate_PreferCUDA = 0x01, /**< Use CUDA-based decoder (requires valid vidLock object for multi-threading) */
|
||||||
cudaVideoCreate_PreferDXVA = 0x02, /**< Go through DXVA internally if possible (requires D3D9 interop) */
|
cudaVideoCreate_PreferDXVA = 0x02, /**< Go through DXVA internally if possible (requires D3D9 interop) */
|
||||||
cudaVideoCreate_PreferCUVID = 0x04 /**< Use dedicated video engines directly */
|
cudaVideoCreate_PreferCUVID = 0x04 /**< Use dedicated video engines directly */
|
||||||
} cudaVideoCreateFlags;
|
} cudaVideoCreateFlags;
|
||||||
|
|
||||||
/*!
|
|
||||||
* \struct CUVIDDECODECREATEINFO
|
/**************************************************************************************************************/
|
||||||
* Struct used in create decoder
|
//! \struct CUVIDDECODECAPS;
|
||||||
*/
|
//! This structure is used in cuvidGetDecoderCaps API
|
||||||
|
/**************************************************************************************************************/
|
||||||
|
typedef struct _CUVIDDECODECAPS
|
||||||
|
{
|
||||||
|
cudaVideoCodec eCodecType; /**< IN: cudaVideoCodec_XXX */
|
||||||
|
cudaVideoChromaFormat eChromaFormat; /**< IN: cudaVideoChromaFormat_XXX */
|
||||||
|
unsigned int nBitDepthMinus8; /**< IN: The Value "BitDepth minus 8" */
|
||||||
|
unsigned int reserved1[3]; /**< Reserved for future use - set to zero */
|
||||||
|
|
||||||
|
unsigned char bIsSupported; /**< OUT: 1 if codec supported, 0 if not supported */
|
||||||
|
unsigned char reserved2[3]; /**< Reserved for future use - set to zero */
|
||||||
|
unsigned int nMaxWidth; /**< OUT: Max supported coded width in pixels */
|
||||||
|
unsigned int nMaxHeight; /**< OUT: Max supported coded height in pixels */
|
||||||
|
unsigned int nMaxMBCount; /**< OUT: Max supported macroblock count
|
||||||
|
CodedWidth*CodedHeight/256 must be <= nMaxMBCount */
|
||||||
|
unsigned short nMinWidth; /**< OUT: Min supported coded width in pixels */
|
||||||
|
unsigned short nMinHeight; /**< OUT: Min supported coded height in pixels */
|
||||||
|
unsigned int reserved3[11]; /**< Reserved for future use - set to zero */
|
||||||
|
} CUVIDDECODECAPS;
|
||||||
|
|
||||||
|
/**************************************************************************************************************/
|
||||||
|
//! \struct CUVIDDECODECREATEINFO
|
||||||
|
//! This structure is used in cuvidCreateDecoder API
|
||||||
|
/**************************************************************************************************************/
|
||||||
typedef struct _CUVIDDECODECREATEINFO
|
typedef struct _CUVIDDECODECREATEINFO
|
||||||
{
|
{
|
||||||
tcu_ulong ulWidth; /**< Coded Sequence Width */
|
tcu_ulong ulWidth; /**< IN: Coded sequence width in pixels */
|
||||||
tcu_ulong ulHeight; /**< Coded Sequence Height */
|
tcu_ulong ulHeight; /**< IN: Coded sequence height in pixels */
|
||||||
tcu_ulong ulNumDecodeSurfaces; /**< Maximum number of internal decode surfaces */
|
tcu_ulong ulNumDecodeSurfaces; /**< IN: Maximum number of internal decode surfaces */
|
||||||
cudaVideoCodec CodecType; /**< cudaVideoCodec_XXX */
|
cudaVideoCodec CodecType; /**< IN: cudaVideoCodec_XXX */
|
||||||
cudaVideoChromaFormat ChromaFormat; /**< cudaVideoChromaFormat_XXX (only 4:2:0 is currently supported) */
|
cudaVideoChromaFormat ChromaFormat; /**< IN: cudaVideoChromaFormat_XXX */
|
||||||
tcu_ulong ulCreationFlags; /**< Decoder creation flags (cudaVideoCreateFlags_XXX) */
|
tcu_ulong ulCreationFlags; /**< IN: Decoder creation flags (cudaVideoCreateFlags_XXX) */
|
||||||
tcu_ulong bitDepthMinus8;
|
tcu_ulong bitDepthMinus8; /**< IN: The value "BitDepth minus 8" */
|
||||||
tcu_ulong Reserved1[4]; /**< Reserved for future use - set to zero */
|
tcu_ulong ulIntraDecodeOnly; /**< IN: Set 1 only if video has all intra frames (default value is 0). This will
|
||||||
|
optimize video memory for Intra frames only decoding. The support is limited
|
||||||
|
to specific codecs(H264 rightnow), the flag will be ignored for codecs which
|
||||||
|
are not supported. However decoding might fail if the flag is enabled in case
|
||||||
|
of supported codecs for regular bit streams having P and/or B frames. */
|
||||||
|
tcu_ulong Reserved1[3]; /**< Reserved for future use - set to zero */
|
||||||
/**
|
/**
|
||||||
* area of the frame that should be displayed
|
* IN: area of the frame that should be displayed
|
||||||
*/
|
*/
|
||||||
struct {
|
struct {
|
||||||
short left;
|
short left;
|
||||||
@ -149,14 +182,15 @@ typedef struct _CUVIDDECODECREATEINFO
|
|||||||
short bottom;
|
short bottom;
|
||||||
} display_area;
|
} display_area;
|
||||||
|
|
||||||
cudaVideoSurfaceFormat OutputFormat; /**< cudaVideoSurfaceFormat_XXX */
|
cudaVideoSurfaceFormat OutputFormat; /**< IN: cudaVideoSurfaceFormat_XXX */
|
||||||
cudaVideoDeinterlaceMode DeinterlaceMode; /**< cudaVideoDeinterlaceMode_XXX */
|
cudaVideoDeinterlaceMode DeinterlaceMode; /**< IN: cudaVideoDeinterlaceMode_XXX */
|
||||||
tcu_ulong ulTargetWidth; /**< Post-processed Output Width (Should be aligned to 2) */
|
tcu_ulong ulTargetWidth; /**< IN: Post-processed output width (Should be aligned to 2) */
|
||||||
tcu_ulong ulTargetHeight; /**< Post-processed Output Height (Should be aligbed to 2) */
|
tcu_ulong ulTargetHeight; /**< IN: Post-processed output height (Should be aligbed to 2) */
|
||||||
tcu_ulong ulNumOutputSurfaces; /**< Maximum number of output surfaces simultaneously mapped */
|
tcu_ulong ulNumOutputSurfaces; /**< IN: Maximum number of output surfaces simultaneously mapped */
|
||||||
CUvideoctxlock vidLock; /**< If non-NULL, context lock used for synchronizing ownership of the cuda context */
|
CUvideoctxlock vidLock; /**< IN: If non-NULL, context lock used for synchronizing ownership of
|
||||||
|
the cuda context. Needed for cudaVideoCreate_PreferCUDA decode */
|
||||||
/**
|
/**
|
||||||
* target rectangle in the output frame (for aspect ratio conversion)
|
* IN: target rectangle in the output frame (for aspect ratio conversion)
|
||||||
* if a null rectangle is specified, {0,0,ulTargetWidth,ulTargetHeight} will be used
|
* if a null rectangle is specified, {0,0,ulTargetWidth,ulTargetHeight} will be used
|
||||||
*/
|
*/
|
||||||
struct {
|
struct {
|
||||||
@ -168,40 +202,43 @@ typedef struct _CUVIDDECODECREATEINFO
|
|||||||
tcu_ulong Reserved2[5]; /**< Reserved for future use - set to zero */
|
tcu_ulong Reserved2[5]; /**< Reserved for future use - set to zero */
|
||||||
} CUVIDDECODECREATEINFO;
|
} CUVIDDECODECREATEINFO;
|
||||||
|
|
||||||
/*!
|
/*********************************************************/
|
||||||
* \struct CUVIDH264DPBENTRY
|
//! \struct CUVIDH264DPBENTRY
|
||||||
* H.264 DPB Entry
|
//! H.264 DPB entry
|
||||||
*/
|
//! This structure is used in CUVIDH264PICPARAMS structure
|
||||||
|
/*********************************************************/
|
||||||
typedef struct _CUVIDH264DPBENTRY
|
typedef struct _CUVIDH264DPBENTRY
|
||||||
{
|
{
|
||||||
int PicIdx; /**< picture index of reference frame */
|
int PicIdx; /**< picture index of reference frame */
|
||||||
int FrameIdx; /**< frame_num(short-term) or LongTermFrameIdx(long-term) */
|
int FrameIdx; /**< frame_num(short-term) or LongTermFrameIdx(long-term) */
|
||||||
int is_long_term; /**< 0=short term reference, 1=long term reference */
|
int is_long_term; /**< 0=short term reference, 1=long term reference */
|
||||||
int not_existing; /**< non-existing reference frame (corresponding PicIdx should be set to -1) */
|
int not_existing; /**< non-existing reference frame (corresponding PicIdx should be set to -1) */
|
||||||
int used_for_reference; /**< 0=unused, 1=top_field, 2=bottom_field, 3=both_fields */
|
int used_for_reference; /**< 0=unused, 1=top_field, 2=bottom_field, 3=both_fields */
|
||||||
int FieldOrderCnt[2]; /**< field order count of top and bottom fields */
|
int FieldOrderCnt[2]; /**< field order count of top and bottom fields */
|
||||||
} CUVIDH264DPBENTRY;
|
} CUVIDH264DPBENTRY;
|
||||||
|
|
||||||
/*!
|
/************************************************************/
|
||||||
* \struct CUVIDH264MVCEXT
|
//! \struct CUVIDH264MVCEXT
|
||||||
* H.264 MVC Picture Parameters Ext
|
//! H.264 MVC picture parameters ext
|
||||||
*/
|
//! This structure is used in CUVIDH264PICPARAMS structure
|
||||||
|
/************************************************************/
|
||||||
typedef struct _CUVIDH264MVCEXT
|
typedef struct _CUVIDH264MVCEXT
|
||||||
{
|
{
|
||||||
int num_views_minus1;
|
int num_views_minus1; /**< Max number of coded views minus 1 in video : Range - 0 to 1023 */
|
||||||
int view_id;
|
int view_id; /**< view identifier */
|
||||||
unsigned char inter_view_flag;
|
unsigned char inter_view_flag; /**< 1 if used for inter-view prediction, 0 if not */
|
||||||
unsigned char num_inter_view_refs_l0;
|
unsigned char num_inter_view_refs_l0; /**< number of inter-view ref pics in RefPicList0 */
|
||||||
unsigned char num_inter_view_refs_l1;
|
unsigned char num_inter_view_refs_l1; /**< number of inter-view ref pics in RefPicList1 */
|
||||||
unsigned char MVCReserved8Bits;
|
unsigned char MVCReserved8Bits; /**< Reserved bits */
|
||||||
int InterViewRefsL0[16];
|
int InterViewRefsL0[16]; /**< view id of the i-th view component for inter-view prediction in RefPicList0 */
|
||||||
int InterViewRefsL1[16];
|
int InterViewRefsL1[16]; /**< view id of the i-th view component for inter-view prediction in RefPicList1 */
|
||||||
} CUVIDH264MVCEXT;
|
} CUVIDH264MVCEXT;
|
||||||
|
|
||||||
/*!
|
/*********************************************************/
|
||||||
* \struct CUVIDH264SVCEXT
|
//! \struct CUVIDH264SVCEXT
|
||||||
* H.264 SVC Picture Parameters Ext
|
//! H.264 SVC picture parameters ext
|
||||||
*/
|
//! This structure is used in CUVIDH264PICPARAMS structure
|
||||||
|
/*********************************************************/
|
||||||
typedef struct _CUVIDH264SVCEXT
|
typedef struct _CUVIDH264SVCEXT
|
||||||
{
|
{
|
||||||
unsigned char profile_idc;
|
unsigned char profile_idc;
|
||||||
@ -227,22 +264,22 @@ typedef struct _CUVIDH264SVCEXT
|
|||||||
unsigned char store_ref_base_pic_flag;
|
unsigned char store_ref_base_pic_flag;
|
||||||
unsigned char Reserved8BitsA;
|
unsigned char Reserved8BitsA;
|
||||||
unsigned char Reserved8BitsB;
|
unsigned char Reserved8BitsB;
|
||||||
// For the 4 scaled_ref_layer_XX fields below,
|
|
||||||
// if (extended_spatial_scalability_idc == 1), SPS field, G.7.3.2.1.4, add prefix "seq_"
|
|
||||||
// if (extended_spatial_scalability_idc == 2), SLH field, G.7.3.3.4,
|
|
||||||
short scaled_ref_layer_left_offset;
|
short scaled_ref_layer_left_offset;
|
||||||
short scaled_ref_layer_top_offset;
|
short scaled_ref_layer_top_offset;
|
||||||
short scaled_ref_layer_right_offset;
|
short scaled_ref_layer_right_offset;
|
||||||
short scaled_ref_layer_bottom_offset;
|
short scaled_ref_layer_bottom_offset;
|
||||||
unsigned short Reserved16Bits;
|
unsigned short Reserved16Bits;
|
||||||
struct _CUVIDPICPARAMS *pNextLayer; /**< Points to the picparams for the next layer to be decoded. Linked list ends at the target layer. */
|
struct _CUVIDPICPARAMS *pNextLayer; /**< Points to the picparams for the next layer to be decoded.
|
||||||
|
Linked list ends at the target layer. */
|
||||||
int bRefBaseLayer; /**< whether to store ref base pic */
|
int bRefBaseLayer; /**< whether to store ref base pic */
|
||||||
} CUVIDH264SVCEXT;
|
} CUVIDH264SVCEXT;
|
||||||
|
|
||||||
/*!
|
/******************************************************/
|
||||||
* \struct CUVIDH264PICPARAMS
|
//! \struct CUVIDH264PICPARAMS
|
||||||
* H.264 Picture Parameters
|
//! H.264 picture parameters
|
||||||
*/
|
//! This structure is used in CUVIDPICPARAMS structure
|
||||||
|
/******************************************************/
|
||||||
typedef struct _CUVIDH264PICPARAMS
|
typedef struct _CUVIDH264PICPARAMS
|
||||||
{
|
{
|
||||||
// SPS
|
// SPS
|
||||||
@ -291,20 +328,21 @@ typedef struct _CUVIDH264PICPARAMS
|
|||||||
unsigned long long slice_group_map_addr;
|
unsigned long long slice_group_map_addr;
|
||||||
const unsigned char *pMb2SliceGroupMap;
|
const unsigned char *pMb2SliceGroupMap;
|
||||||
} fmo;
|
} fmo;
|
||||||
unsigned int Reserved[12];
|
unsigned int Reserved[12];
|
||||||
// SVC/MVC
|
// SVC/MVC
|
||||||
union
|
union
|
||||||
{
|
{
|
||||||
CUVIDH264MVCEXT mvcext;
|
CUVIDH264MVCEXT mvcext;
|
||||||
CUVIDH264SVCEXT svcext;
|
CUVIDH264SVCEXT svcext;
|
||||||
} svcmvc;
|
};
|
||||||
} CUVIDH264PICPARAMS;
|
} CUVIDH264PICPARAMS;
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/********************************************************/
|
||||||
* \struct CUVIDMPEG2PICPARAMS
|
//! \struct CUVIDMPEG2PICPARAMS
|
||||||
* MPEG-2 Picture Parameters
|
//! MPEG-2 picture parameters
|
||||||
*/
|
//! This structure is used in CUVIDPICPARAMS structure
|
||||||
|
/********************************************************/
|
||||||
typedef struct _CUVIDMPEG2PICPARAMS
|
typedef struct _CUVIDMPEG2PICPARAMS
|
||||||
{
|
{
|
||||||
int ForwardRefIdx; // Picture index of forward reference (P/B-frames)
|
int ForwardRefIdx; // Picture index of forward reference (P/B-frames)
|
||||||
@ -325,21 +363,17 @@ typedef struct _CUVIDMPEG2PICPARAMS
|
|||||||
unsigned char QuantMatrixInter[64];
|
unsigned char QuantMatrixInter[64];
|
||||||
} CUVIDMPEG2PICPARAMS;
|
} CUVIDMPEG2PICPARAMS;
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
//
|
|
||||||
// MPEG-4 Picture Parameters
|
|
||||||
//
|
|
||||||
|
|
||||||
// MPEG-4 has VOP types instead of Picture types
|
// MPEG-4 has VOP types instead of Picture types
|
||||||
#define I_VOP 0
|
#define I_VOP 0
|
||||||
#define P_VOP 1
|
#define P_VOP 1
|
||||||
#define B_VOP 2
|
#define B_VOP 2
|
||||||
#define S_VOP 3
|
#define S_VOP 3
|
||||||
|
|
||||||
/*!
|
/*******************************************************/
|
||||||
* \struct CUVIDMPEG4PICPARAMS
|
//! \struct CUVIDMPEG4PICPARAMS
|
||||||
* MPEG-4 Picture Parameters
|
//! MPEG-4 picture parameters
|
||||||
*/
|
//! This structure is used in CUVIDPICPARAMS structure
|
||||||
|
/*******************************************************/
|
||||||
typedef struct _CUVIDMPEG4PICPARAMS
|
typedef struct _CUVIDMPEG4PICPARAMS
|
||||||
{
|
{
|
||||||
int ForwardRefIdx; // Picture index of forward reference (P/B-frames)
|
int ForwardRefIdx; // Picture index of forward reference (P/B-frames)
|
||||||
@ -370,20 +404,21 @@ typedef struct _CUVIDMPEG4PICPARAMS
|
|||||||
int gmc_enabled;
|
int gmc_enabled;
|
||||||
} CUVIDMPEG4PICPARAMS;
|
} CUVIDMPEG4PICPARAMS;
|
||||||
|
|
||||||
/*!
|
/********************************************************/
|
||||||
* \struct CUVIDVC1PICPARAMS
|
//! \struct CUVIDVC1PICPARAMS
|
||||||
* VC1 Picture Parameters
|
//! VC1 picture parameters
|
||||||
*/
|
//! This structure is used in CUVIDPICPARAMS structure
|
||||||
|
/********************************************************/
|
||||||
typedef struct _CUVIDVC1PICPARAMS
|
typedef struct _CUVIDVC1PICPARAMS
|
||||||
{
|
{
|
||||||
int ForwardRefIdx; /**< Picture index of forward reference (P/B-frames) */
|
int ForwardRefIdx; /**< Picture index of forward reference (P/B-frames) */
|
||||||
int BackwardRefIdx; /**< Picture index of backward reference (B-frames) */
|
int BackwardRefIdx; /**< Picture index of backward reference (B-frames) */
|
||||||
int FrameWidth; /**< Actual frame width */
|
int FrameWidth; /**< Actual frame width */
|
||||||
int FrameHeight; /**< Actual frame height */
|
int FrameHeight; /**< Actual frame height */
|
||||||
// PICTURE
|
// PICTURE
|
||||||
int intra_pic_flag; /**< Set to 1 for I,BI frames */
|
int intra_pic_flag; /**< Set to 1 for I,BI frames */
|
||||||
int ref_pic_flag; /**< Set to 1 for I,P frames */
|
int ref_pic_flag; /**< Set to 1 for I,P frames */
|
||||||
int progressive_fcm; /**< Progressive frame */
|
int progressive_fcm; /**< Progressive frame */
|
||||||
// SEQUENCE
|
// SEQUENCE
|
||||||
int profile;
|
int profile;
|
||||||
int postprocflag;
|
int postprocflag;
|
||||||
@ -414,20 +449,22 @@ typedef struct _CUVIDVC1PICPARAMS
|
|||||||
int rangeredfrm; // range reduction state
|
int rangeredfrm; // range reduction state
|
||||||
} CUVIDVC1PICPARAMS;
|
} CUVIDVC1PICPARAMS;
|
||||||
|
|
||||||
/*!
|
/***********************************************************/
|
||||||
* \struct CUVIDJPEGPICPARAMS
|
//! \struct CUVIDJPEGPICPARAMS
|
||||||
* JPEG Picture Parameters
|
//! JPEG picture parameters
|
||||||
*/
|
//! This structure is used in CUVIDPICPARAMS structure
|
||||||
|
/***********************************************************/
|
||||||
typedef struct _CUVIDJPEGPICPARAMS
|
typedef struct _CUVIDJPEGPICPARAMS
|
||||||
{
|
{
|
||||||
int Reserved;
|
int Reserved;
|
||||||
} CUVIDJPEGPICPARAMS;
|
} CUVIDJPEGPICPARAMS;
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*******************************************************/
|
||||||
* \struct CUVIDHEVCPICPARAMS
|
//! \struct CUVIDHEVCPICPARAMS
|
||||||
* HEVC Picture Parameters
|
//! HEVC picture parameters
|
||||||
*/
|
//! This structure is used in CUVIDPICPARAMS structure
|
||||||
|
/*******************************************************/
|
||||||
typedef struct _CUVIDHEVCPICPARAMS
|
typedef struct _CUVIDHEVCPICPARAMS
|
||||||
{
|
{
|
||||||
// sps
|
// sps
|
||||||
@ -494,8 +531,8 @@ typedef struct _CUVIDHEVCPICPARAMS
|
|||||||
|
|
||||||
unsigned char deblocking_filter_override_enabled_flag;
|
unsigned char deblocking_filter_override_enabled_flag;
|
||||||
unsigned char pps_deblocking_filter_disabled_flag;
|
unsigned char pps_deblocking_filter_disabled_flag;
|
||||||
signed char pps_beta_offset_div2;
|
signed char pps_beta_offset_div2;
|
||||||
signed char pps_tc_offset_div2;
|
signed char pps_tc_offset_div2;
|
||||||
unsigned char tiles_enabled_flag;
|
unsigned char tiles_enabled_flag;
|
||||||
unsigned char uniform_spacing_flag;
|
unsigned char uniform_spacing_flag;
|
||||||
unsigned char num_tile_columns_minus1;
|
unsigned char num_tile_columns_minus1;
|
||||||
@ -503,7 +540,7 @@ typedef struct _CUVIDHEVCPICPARAMS
|
|||||||
|
|
||||||
unsigned short column_width_minus1[21];
|
unsigned short column_width_minus1[21];
|
||||||
unsigned short row_height_minus1[21];
|
unsigned short row_height_minus1[21];
|
||||||
unsigned int reserved3[15];
|
unsigned int reserved3[15];
|
||||||
|
|
||||||
// RefPicSets
|
// RefPicSets
|
||||||
int NumBitsForShortTermRPSInSlice;
|
int NumBitsForShortTermRPSInSlice;
|
||||||
@ -513,15 +550,15 @@ typedef struct _CUVIDHEVCPICPARAMS
|
|||||||
int NumPocStCurrAfter;
|
int NumPocStCurrAfter;
|
||||||
int NumPocLtCurr;
|
int NumPocLtCurr;
|
||||||
int CurrPicOrderCntVal;
|
int CurrPicOrderCntVal;
|
||||||
int RefPicIdx[16]; // [refpic] Indices of valid reference pictures (-1 if unused for reference)
|
int RefPicIdx[16]; // [refpic] Indices of valid reference pictures (-1 if unused for reference)
|
||||||
int PicOrderCntVal[16]; // [refpic]
|
int PicOrderCntVal[16]; // [refpic]
|
||||||
unsigned char IsLongTerm[16]; // [refpic] 0=not a long-term reference, 1=long-term reference
|
unsigned char IsLongTerm[16]; // [refpic] 0=not a long-term reference, 1=long-term reference
|
||||||
unsigned char RefPicSetStCurrBefore[8]; // [0..NumPocStCurrBefore-1] -> refpic (0..15)
|
unsigned char RefPicSetStCurrBefore[8]; // [0..NumPocStCurrBefore-1] -> refpic (0..15)
|
||||||
unsigned char RefPicSetStCurrAfter[8]; // [0..NumPocStCurrAfter-1] -> refpic (0..15)
|
unsigned char RefPicSetStCurrAfter[8]; // [0..NumPocStCurrAfter-1] -> refpic (0..15)
|
||||||
unsigned char RefPicSetLtCurr[8]; // [0..NumPocLtCurr-1] -> refpic (0..15)
|
unsigned char RefPicSetLtCurr[8]; // [0..NumPocLtCurr-1] -> refpic (0..15)
|
||||||
unsigned char RefPicSetInterLayer0[8];
|
unsigned char RefPicSetInterLayer0[8];
|
||||||
unsigned char RefPicSetInterLayer1[8];
|
unsigned char RefPicSetInterLayer1[8];
|
||||||
unsigned int reserved4[12];
|
unsigned int reserved4[12];
|
||||||
|
|
||||||
// scaling lists (diag order)
|
// scaling lists (diag order)
|
||||||
unsigned char ScalingList4x4[6][16]; // [matrixId][i]
|
unsigned char ScalingList4x4[6][16]; // [matrixId][i]
|
||||||
@ -533,10 +570,11 @@ typedef struct _CUVIDHEVCPICPARAMS
|
|||||||
} CUVIDHEVCPICPARAMS;
|
} CUVIDHEVCPICPARAMS;
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/***********************************************************/
|
||||||
* \struct CUVIDVP8PICPARAMS
|
//! \struct CUVIDVP8PICPARAMS
|
||||||
* VP8 Picture Parameters
|
//! VP8 picture parameters
|
||||||
*/
|
//! This structure is used in CUVIDPICPARAMS structure
|
||||||
|
/***********************************************************/
|
||||||
typedef struct _CUVIDVP8PICPARAMS
|
typedef struct _CUVIDVP8PICPARAMS
|
||||||
{
|
{
|
||||||
int width;
|
int width;
|
||||||
@ -555,15 +593,16 @@ typedef struct _CUVIDVP8PICPARAMS
|
|||||||
unsigned char Reserved2Bits : 2;
|
unsigned char Reserved2Bits : 2;
|
||||||
};
|
};
|
||||||
unsigned char wFrameTagFlags;
|
unsigned char wFrameTagFlags;
|
||||||
} tagflags;
|
};
|
||||||
unsigned char Reserved1[4];
|
unsigned char Reserved1[4];
|
||||||
unsigned int Reserved2[3];
|
unsigned int Reserved2[3];
|
||||||
} CUVIDVP8PICPARAMS;
|
} CUVIDVP8PICPARAMS;
|
||||||
|
|
||||||
/*!
|
/***********************************************************/
|
||||||
* \struct CUVIDVP9PICPARAMS
|
//! \struct CUVIDVP9PICPARAMS
|
||||||
* VP9 Picture Parameters
|
//! VP9 picture parameters
|
||||||
*/
|
//! This structure is used in CUVIDPICPARAMS structure
|
||||||
|
/***********************************************************/
|
||||||
typedef struct _CUVIDVP9PICPARAMS
|
typedef struct _CUVIDVP9PICPARAMS
|
||||||
{
|
{
|
||||||
unsigned int width;
|
unsigned int width;
|
||||||
@ -609,7 +648,7 @@ typedef struct _CUVIDVP9PICPARAMS
|
|||||||
|
|
||||||
|
|
||||||
unsigned char segmentFeatureEnable[8][4];
|
unsigned char segmentFeatureEnable[8][4];
|
||||||
short segmentFeatureData[8][4];
|
short segmentFeatureData[8][4];
|
||||||
unsigned char mb_segment_tree_probs[7];
|
unsigned char mb_segment_tree_probs[7];
|
||||||
unsigned char segment_pred_probs[3];
|
unsigned char segment_pred_probs[3];
|
||||||
unsigned char reservedSegment16Bits[2];
|
unsigned char reservedSegment16Bits[2];
|
||||||
@ -631,136 +670,163 @@ typedef struct _CUVIDVP9PICPARAMS
|
|||||||
} CUVIDVP9PICPARAMS;
|
} CUVIDVP9PICPARAMS;
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/******************************************************************************************/
|
||||||
* \struct CUVIDPICPARAMS
|
//! \struct CUVIDPICPARAMS
|
||||||
* Picture Parameters for Decoding
|
//! Picture parameters for decoding
|
||||||
*/
|
//! This structure is used in cuvidDecodePicture API
|
||||||
|
//! IN for cuvidDecodePicture
|
||||||
|
/******************************************************************************************/
|
||||||
typedef struct _CUVIDPICPARAMS
|
typedef struct _CUVIDPICPARAMS
|
||||||
{
|
{
|
||||||
int PicWidthInMbs; /**< Coded Frame Size */
|
int PicWidthInMbs; /**< IN: Coded frame size in macroblocks */
|
||||||
int FrameHeightInMbs; /**< Coded Frame Height */
|
int FrameHeightInMbs; /**< IN: Coded frame height in macroblocks */
|
||||||
int CurrPicIdx; /**< Output index of the current picture */
|
int CurrPicIdx; /**< IN: Output index of the current picture */
|
||||||
int field_pic_flag; /**< 0=frame picture, 1=field picture */
|
int field_pic_flag; /**< IN: 0=frame picture, 1=field picture */
|
||||||
int bottom_field_flag; /**< 0=top field, 1=bottom field (ignored if field_pic_flag=0) */
|
int bottom_field_flag; /**< IN: 0=top field, 1=bottom field (ignored if field_pic_flag=0) */
|
||||||
int second_field; /**< Second field of a complementary field pair */
|
int second_field; /**< IN: Second field of a complementary field pair */
|
||||||
// Bitstream data
|
// Bitstream data
|
||||||
unsigned int nBitstreamDataLen; /**< Number of bytes in bitstream data buffer */
|
unsigned int nBitstreamDataLen; /**< IN: Number of bytes in bitstream data buffer */
|
||||||
const unsigned char *pBitstreamData; /**< Ptr to bitstream data for this picture (slice-layer) */
|
const unsigned char *pBitstreamData; /**< IN: Ptr to bitstream data for this picture (slice-layer) */
|
||||||
unsigned int nNumSlices; /**< Number of slices in this picture */
|
unsigned int nNumSlices; /**< IN: Number of slices in this picture */
|
||||||
const unsigned int *pSliceDataOffsets; /**< nNumSlices entries, contains offset of each slice within the bitstream data buffer */
|
const unsigned int *pSliceDataOffsets; /**< IN: nNumSlices entries, contains offset of each slice within
|
||||||
int ref_pic_flag; /**< This picture is a reference picture */
|
the bitstream data buffer */
|
||||||
int intra_pic_flag; /**< This picture is entirely intra coded */
|
int ref_pic_flag; /**< IN: This picture is a reference picture */
|
||||||
unsigned int Reserved[30]; /**< Reserved for future use */
|
int intra_pic_flag; /**< IN: This picture is entirely intra coded */
|
||||||
// Codec-specific data
|
unsigned int Reserved[30]; /**< Reserved for future use */
|
||||||
|
// IN: Codec-specific data
|
||||||
union {
|
union {
|
||||||
CUVIDMPEG2PICPARAMS mpeg2; /**< Also used for MPEG-1 */
|
CUVIDMPEG2PICPARAMS mpeg2; /**< Also used for MPEG-1 */
|
||||||
CUVIDH264PICPARAMS h264;
|
CUVIDH264PICPARAMS h264;
|
||||||
CUVIDVC1PICPARAMS vc1;
|
CUVIDVC1PICPARAMS vc1;
|
||||||
CUVIDMPEG4PICPARAMS mpeg4;
|
CUVIDMPEG4PICPARAMS mpeg4;
|
||||||
CUVIDJPEGPICPARAMS jpeg;
|
CUVIDJPEGPICPARAMS jpeg;
|
||||||
CUVIDHEVCPICPARAMS hevc;
|
CUVIDHEVCPICPARAMS hevc;
|
||||||
CUVIDVP8PICPARAMS vp8;
|
CUVIDVP8PICPARAMS vp8;
|
||||||
CUVIDVP9PICPARAMS vp9;
|
CUVIDVP9PICPARAMS vp9;
|
||||||
unsigned int CodecReserved[1024];
|
unsigned int CodecReserved[1024];
|
||||||
} CodecSpecific;
|
} CodecSpecific;
|
||||||
} CUVIDPICPARAMS;
|
} CUVIDPICPARAMS;
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/******************************************************/
|
||||||
* \struct CUVIDPROCPARAMS
|
//! \struct CUVIDPROCPARAMS
|
||||||
* Picture Parameters for Postprocessing
|
//! Picture parameters for postprocessing
|
||||||
*/
|
//! This structure is used in cuvidMapVideoFrame API
|
||||||
|
/******************************************************/
|
||||||
typedef struct _CUVIDPROCPARAMS
|
typedef struct _CUVIDPROCPARAMS
|
||||||
{
|
{
|
||||||
int progressive_frame; /**< Input is progressive (deinterlace_mode will be ignored) */
|
int progressive_frame; /**< IN: Input is progressive (deinterlace_mode will be ignored) */
|
||||||
int second_field; /**< Output the second field (ignored if deinterlace mode is Weave) */
|
int second_field; /**< IN: Output the second field (ignored if deinterlace mode is Weave) */
|
||||||
int top_field_first; /**< Input frame is top field first (1st field is top, 2nd field is bottom) */
|
int top_field_first; /**< IN: Input frame is top field first (1st field is top, 2nd field is bottom) */
|
||||||
int unpaired_field; /**< Input only contains one field (2nd field is invalid) */
|
int unpaired_field; /**< IN: Input only contains one field (2nd field is invalid) */
|
||||||
// The fields below are used for raw YUV input
|
// The fields below are used for raw YUV input
|
||||||
unsigned int reserved_flags; /**< Reserved for future use (set to zero) */
|
unsigned int reserved_flags; /**< Reserved for future use (set to zero) */
|
||||||
unsigned int reserved_zero; /**< Reserved (set to zero) */
|
unsigned int reserved_zero; /**< Reserved (set to zero) */
|
||||||
unsigned long long raw_input_dptr; /**< Input CUdeviceptr for raw YUV extensions */
|
unsigned long long raw_input_dptr; /**< IN: Input CUdeviceptr for raw YUV extensions */
|
||||||
unsigned int raw_input_pitch; /**< pitch in bytes of raw YUV input (should be aligned appropriately) */
|
unsigned int raw_input_pitch; /**< IN: pitch in bytes of raw YUV input (should be aligned appropriately) */
|
||||||
unsigned int raw_input_format; /**< Reserved for future use (set to zero) */
|
unsigned int raw_input_format; /**< IN: Input YUV format (cudaVideoCodec_enum) */
|
||||||
unsigned long long raw_output_dptr; /**< Reserved for future use (set to zero) */
|
unsigned long long raw_output_dptr; /**< IN: Output CUdeviceptr for raw YUV extensions */
|
||||||
unsigned int raw_output_pitch; /**< Reserved for future use (set to zero) */
|
unsigned int raw_output_pitch; /**< IN: pitch in bytes of raw YUV output (should be aligned appropriately) */
|
||||||
unsigned int Reserved[48];
|
unsigned int Reserved1; /**< Reserved for future use (set to zero) */
|
||||||
void *Reserved3[3];
|
CUstream output_stream; /**< IN: stream object used by cuvidMapVideoFrame */
|
||||||
|
unsigned int Reserved[46]; /**< Reserved for future use (set to zero) */
|
||||||
|
void *Reserved2[2]; /**< Reserved for future use (set to zero) */
|
||||||
} CUVIDPROCPARAMS;
|
} CUVIDPROCPARAMS;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/***********************************************************************************************************/
|
||||||
*
|
//! VIDEO_DECODER
|
||||||
* In order to minimize decode latencies, there should be always at least 2 pictures in the decode
|
//!
|
||||||
* queue at any time, in order to make sure that all decode engines are always busy.
|
//! In order to minimize decode latencies, there should be always at least 2 pictures in the decode
|
||||||
*
|
//! queue at any time, in order to make sure that all decode engines are always busy.
|
||||||
* Overall data flow:
|
//!
|
||||||
* - cuvidCreateDecoder(...)
|
//! Overall data flow:
|
||||||
* For each picture:
|
//! - cuvidGetDecoderCaps(...)
|
||||||
* - cuvidDecodePicture(N)
|
//! - cuvidCreateDecoder(...)
|
||||||
* - cuvidMapVideoFrame(N-4)
|
//! - For each picture:
|
||||||
* - do some processing in cuda
|
//! + cuvidDecodePicture(N)
|
||||||
* - cuvidUnmapVideoFrame(N-4)
|
//! + cuvidMapVideoFrame(N-4)
|
||||||
* - cuvidDecodePicture(N+1)
|
//! + do some processing in cuda
|
||||||
* - cuvidMapVideoFrame(N-3)
|
//! + cuvidUnmapVideoFrame(N-4)
|
||||||
* ...
|
//! + cuvidDecodePicture(N+1)
|
||||||
* - cuvidDestroyDecoder(...)
|
//! + cuvidMapVideoFrame(N-3)
|
||||||
*
|
//! + ...
|
||||||
* NOTE:
|
//! - cuvidDestroyDecoder(...)
|
||||||
* - When the cuda context is created from a D3D device, the D3D device must also be created
|
//!
|
||||||
* with the D3DCREATE_MULTITHREADED flag.
|
//! NOTE:
|
||||||
* - There is a limit to how many pictures can be mapped simultaneously (ulNumOutputSurfaces)
|
//! - When the cuda context is created from a D3D device, the D3D device must also be created
|
||||||
* - cuVidDecodePicture may block the calling thread if there are too many pictures pending
|
//! with the D3DCREATE_MULTITHREADED flag.
|
||||||
* in the decode queue
|
//! - There is a limit to how many pictures can be mapped simultaneously (ulNumOutputSurfaces)
|
||||||
*/
|
//! - cuvidDecodePicture may block the calling thread if there are too many pictures pending
|
||||||
|
//! in the decode queue
|
||||||
|
/***********************************************************************************************************/
|
||||||
|
|
||||||
/**
|
|
||||||
* \fn CUresult CUDAAPI cuvidCreateDecoder(CUvideodecoder *phDecoder, CUVIDDECODECREATEINFO *pdci)
|
/**********************************************************************************************************************/
|
||||||
* Create the decoder object
|
//! \fn CUresult CUDAAPI cuvidGetDecoderCaps(CUVIDDECODECAPS *pdc)
|
||||||
*/
|
//! Queries decode capabilities of NVDEC-HW based on CodecType, ChromaFormat and BitDepthMinus8 parameters.
|
||||||
|
//! 1. Application fills IN parameters CodecType, ChromaFormat and BitDepthMinus8 of CUVIDDECODECAPS structure
|
||||||
|
//! 2. On calling cuvidGetDecoderCaps, driver fills OUT parameters if the IN parameters are supported
|
||||||
|
//! If IN parameters passed to the driver are not supported by NVDEC-HW, then all OUT params are set to 0.
|
||||||
|
//! E.g. on Geforce GTX 960:
|
||||||
|
//! App fills - eCodecType = cudaVideoCodec_H264; eChromaFormat = cudaVideoChromaFormat_420; nBitDepthMinus8 = 0;
|
||||||
|
//! Given IN parameters are supported, hence driver fills: bIsSupported = 1; nMinWidth = 48; nMinHeight = 16;
|
||||||
|
//! nMaxWidth = 4096; nMaxHeight = 4096; nMaxMBCount = 65536;
|
||||||
|
//! CodedWidth*CodedHeight/256 must be less than or equal to nMaxMBCount
|
||||||
|
/**********************************************************************************************************************/
|
||||||
|
typedef CUresult CUDAAPI tcuvidGetDecoderCaps(CUVIDDECODECAPS *pdc);
|
||||||
|
|
||||||
|
/********************************************************************************************************************/
|
||||||
|
//! \fn CUresult CUDAAPI cuvidCreateDecoder(CUvideodecoder *phDecoder, CUVIDDECODECREATEINFO *pdci)
|
||||||
|
//! Create the decoder object based on pdci. A handle to the created decoder is returned
|
||||||
|
/********************************************************************************************************************/
|
||||||
typedef CUresult CUDAAPI tcuvidCreateDecoder(CUvideodecoder *phDecoder, CUVIDDECODECREATEINFO *pdci);
|
typedef CUresult CUDAAPI tcuvidCreateDecoder(CUvideodecoder *phDecoder, CUVIDDECODECREATEINFO *pdci);
|
||||||
|
/********************************************************************************************************************/
|
||||||
/**
|
//! \fn CUresult CUDAAPI cuvidDestroyDecoder(CUvideodecoder hDecoder)
|
||||||
* \fn CUresult CUDAAPI cuvidDestroyDecoder(CUvideodecoder hDecoder)
|
//! Destroy the decoder object.
|
||||||
* Destroy the decoder object
|
/********************************************************************************************************************/
|
||||||
*/
|
|
||||||
typedef CUresult CUDAAPI tcuvidDestroyDecoder(CUvideodecoder hDecoder);
|
typedef CUresult CUDAAPI tcuvidDestroyDecoder(CUvideodecoder hDecoder);
|
||||||
|
|
||||||
/**
|
/********************************************************************************************************************/
|
||||||
* \fn CUresult CUDAAPI cuvidDecodePicture(CUvideodecoder hDecoder, CUVIDPICPARAMS *pPicParams)
|
//! \fn CUresult CUDAAPI cuvidDecodePicture(CUvideodecoder hDecoder, CUVIDPICPARAMS *pPicParams)
|
||||||
* Decode a single picture (field or frame)
|
//! Decode a single picture (field or frame)
|
||||||
*/
|
//! Kicks off HW decoding
|
||||||
|
/********************************************************************************************************************/
|
||||||
typedef CUresult CUDAAPI tcuvidDecodePicture(CUvideodecoder hDecoder, CUVIDPICPARAMS *pPicParams);
|
typedef CUresult CUDAAPI tcuvidDecodePicture(CUvideodecoder hDecoder, CUVIDPICPARAMS *pPicParams);
|
||||||
|
|
||||||
|
|
||||||
#if !defined(__CUVID_DEVPTR64) || defined(__CUVID_INTERNAL)
|
#if !defined(__CUVID_DEVPTR64) || defined(__CUVID_INTERNAL)
|
||||||
/**
|
/************************************************************************************************************************/
|
||||||
* \fn CUresult CUDAAPI cuvidMapVideoFrame(CUvideodecoder hDecoder, int nPicIdx, unsigned int *pDevPtr, unsigned int *pPitch, CUVIDPROCPARAMS *pVPP);
|
//! \fn CUresult CUDAAPI cuvidMapVideoFrame(CUvideodecoder hDecoder, int nPicIdx, unsigned int *pDevPtr,
|
||||||
* Post-process and map a video frame for use in cuda
|
//! unsigned int *pPitch, CUVIDPROCPARAMS *pVPP);
|
||||||
*/
|
//! Post-process and map video frame corresponding to nPicIdx for use in cuda. Returns cuda device pointer and associated
|
||||||
|
//! pitch of the video frame
|
||||||
|
/************************************************************************************************************************/
|
||||||
typedef CUresult CUDAAPI tcuvidMapVideoFrame(CUvideodecoder hDecoder, int nPicIdx,
|
typedef CUresult CUDAAPI tcuvidMapVideoFrame(CUvideodecoder hDecoder, int nPicIdx,
|
||||||
unsigned int *pDevPtr, unsigned int *pPitch,
|
unsigned int *pDevPtr, unsigned int *pPitch,
|
||||||
CUVIDPROCPARAMS *pVPP);
|
CUVIDPROCPARAMS *pVPP);
|
||||||
|
|
||||||
/**
|
/********************************************************************************************************************/
|
||||||
* \fn CUresult CUDAAPI cuvidUnmapVideoFrame(CUvideodecoder hDecoder, unsigned int DevPtr)
|
//! \fn CUresult CUDAAPI cuvidUnmapVideoFrame(CUvideodecoder hDecoder, unsigned int DevPtr)
|
||||||
* Unmap a previously mapped video frame
|
//! Unmap a previously mapped video frame
|
||||||
*/
|
/********************************************************************************************************************/
|
||||||
typedef CUresult CUDAAPI tcuvidUnmapVideoFrame(CUvideodecoder hDecoder, unsigned int DevPtr);
|
typedef CUresult CUDAAPI tcuvidUnmapVideoFrame(CUvideodecoder hDecoder, unsigned int DevPtr);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(WIN64) || defined(_WIN64) || defined(__x86_64) || defined(AMD64) || defined(_M_AMD64)
|
#if defined(_WIN64) || defined(__LP64__) || defined(__x86_64) || defined(AMD64) || defined(_M_AMD64)
|
||||||
/**
|
/************************************************************************************************************************/
|
||||||
* \fn CUresult CUDAAPI cuvidMapVideoFrame64(CUvideodecoder hDecoder, int nPicIdx, unsigned long long *pDevPtr, unsigned int *pPitch, CUVIDPROCPARAMS *pVPP);
|
//! \fn CUresult CUDAAPI cuvidMapVideoFrame64(CUvideodecoder hDecoder, int nPicIdx, unsigned long long *pDevPtr,
|
||||||
* map a video frame
|
//! unsigned int *pPitch, CUVIDPROCPARAMS *pVPP);
|
||||||
*/
|
//! Post-process and map video frame corresponding to nPicIdx for use in cuda. Returns cuda device pointer and associated
|
||||||
|
//! pitch of the video frame
|
||||||
|
/************************************************************************************************************************/
|
||||||
typedef CUresult CUDAAPI tcuvidMapVideoFrame64(CUvideodecoder hDecoder, int nPicIdx, unsigned long long *pDevPtr,
|
typedef CUresult CUDAAPI tcuvidMapVideoFrame64(CUvideodecoder hDecoder, int nPicIdx, unsigned long long *pDevPtr,
|
||||||
unsigned int *pPitch, CUVIDPROCPARAMS *pVPP);
|
unsigned int *pPitch, CUVIDPROCPARAMS *pVPP);
|
||||||
|
|
||||||
/**
|
/********************************************************************************************************************/
|
||||||
* \fn CUresult CUDAAPI cuvidUnmapVideoFrame64(CUvideodecoder hDecoder, unsigned long long DevPtr);
|
//! \fn CUresult CUDAAPI cuvidUnmapVideoFrame64(CUvideodecoder hDecoder, unsigned long long DevPtr);
|
||||||
* Unmap a previously mapped video frame
|
//! Unmap a previously mapped video frame
|
||||||
*/
|
/********************************************************************************************************************/
|
||||||
typedef CUresult CUDAAPI tcuvidUnmapVideoFrame64(CUvideodecoder hDecoder, unsigned long long DevPtr);
|
typedef CUresult CUDAAPI tcuvidUnmapVideoFrame64(CUvideodecoder hDecoder, unsigned long long DevPtr);
|
||||||
|
|
||||||
#if defined(__CUVID_DEVPTR64) && !defined(__CUVID_INTERNAL)
|
#if defined(__CUVID_DEVPTR64) && !defined(__CUVID_INTERNAL)
|
||||||
@ -770,43 +836,48 @@ typedef CUresult CUDAAPI tcuvidUnmapVideoFrame64(CUvideodecoder hDecoder, unsign
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* Context-locking: to facilitate multi-threaded implementations, the following 4 functions
|
|
||||||
* provide a simple mutex-style host synchronization. If a non-NULL context is specified
|
|
||||||
* in CUVIDDECODECREATEINFO, the codec library will acquire the mutex associated with the given
|
|
||||||
* context before making any cuda calls.
|
|
||||||
* A multi-threaded application could create a lock associated with a context handle so that
|
|
||||||
* multiple threads can safely share the same cuda context:
|
|
||||||
* - use cuCtxPopCurrent immediately after context creation in order to create a 'floating' context
|
|
||||||
* that can be passed to cuvidCtxLockCreate.
|
|
||||||
* - When using a floating context, all cuda calls should only be made within a cuvidCtxLock/cuvidCtxUnlock section.
|
|
||||||
*
|
|
||||||
* NOTE: This is a safer alternative to cuCtxPushCurrent and cuCtxPopCurrent, and is not related to video
|
|
||||||
* decoder in any way (implemented as a critical section associated with cuCtx{Push|Pop}Current calls).
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
/********************************************************************************************************************/
|
||||||
* \fn CUresult CUDAAPI cuvidCtxLockCreate(CUvideoctxlock *pLock, CUcontext ctx)
|
//!
|
||||||
*/
|
//! Context-locking: to facilitate multi-threaded implementations, the following 4 functions
|
||||||
|
//! provide a simple mutex-style host synchronization. If a non-NULL context is specified
|
||||||
|
//! in CUVIDDECODECREATEINFO, the codec library will acquire the mutex associated with the given
|
||||||
|
//! context before making any cuda calls.
|
||||||
|
//! A multi-threaded application could create a lock associated with a context handle so that
|
||||||
|
//! multiple threads can safely share the same cuda context:
|
||||||
|
//! - use cuCtxPopCurrent immediately after context creation in order to create a 'floating' context
|
||||||
|
//! that can be passed to cuvidCtxLockCreate.
|
||||||
|
//! - When using a floating context, all cuda calls should only be made within a cuvidCtxLock/cuvidCtxUnlock section.
|
||||||
|
//!
|
||||||
|
//! NOTE: This is a safer alternative to cuCtxPushCurrent and cuCtxPopCurrent, and is not related to video
|
||||||
|
//! decoder in any way (implemented as a critical section associated with cuCtx{Push|Pop}Current calls).
|
||||||
|
/********************************************************************************************************************/
|
||||||
|
|
||||||
|
/********************************************************************************************************************/
|
||||||
|
//! \fn CUresult CUDAAPI cuvidCtxLockCreate(CUvideoctxlock *pLock, CUcontext ctx)
|
||||||
|
//! This API is used to create CtxLock object
|
||||||
|
/********************************************************************************************************************/
|
||||||
typedef CUresult CUDAAPI tcuvidCtxLockCreate(CUvideoctxlock *pLock, CUcontext ctx);
|
typedef CUresult CUDAAPI tcuvidCtxLockCreate(CUvideoctxlock *pLock, CUcontext ctx);
|
||||||
|
|
||||||
/**
|
/********************************************************************************************************************/
|
||||||
* \fn CUresult CUDAAPI cuvidCtxLockDestroy(CUvideoctxlock lck)
|
//! \fn CUresult CUDAAPI cuvidCtxLockDestroy(CUvideoctxlock lck)
|
||||||
*/
|
//! This API is used to free CtxLock object
|
||||||
|
/********************************************************************************************************************/
|
||||||
typedef CUresult CUDAAPI tcuvidCtxLockDestroy(CUvideoctxlock lck);
|
typedef CUresult CUDAAPI tcuvidCtxLockDestroy(CUvideoctxlock lck);
|
||||||
|
|
||||||
/**
|
/********************************************************************************************************************/
|
||||||
* \fn CUresult CUDAAPI cuvidCtxLock(CUvideoctxlock lck, unsigned int reserved_flags)
|
//! \fn CUresult CUDAAPI cuvidCtxLock(CUvideoctxlock lck, unsigned int reserved_flags)
|
||||||
*/
|
//! This API is used to acquire ctxlock
|
||||||
|
/********************************************************************************************************************/
|
||||||
typedef CUresult CUDAAPI tcuvidCtxLock(CUvideoctxlock lck, unsigned int reserved_flags);
|
typedef CUresult CUDAAPI tcuvidCtxLock(CUvideoctxlock lck, unsigned int reserved_flags);
|
||||||
|
|
||||||
/**
|
/********************************************************************************************************************/
|
||||||
* \fn CUresult CUDAAPI cuvidCtxUnlock(CUvideoctxlock lck, unsigned int reserved_flags)
|
//! \fn CUresult CUDAAPI cuvidCtxUnlock(CUvideoctxlock lck, unsigned int reserved_flags)
|
||||||
*/
|
//! This API is used to release ctxlock
|
||||||
|
/********************************************************************************************************************/
|
||||||
typedef CUresult CUDAAPI tcuvidCtxUnlock(CUvideoctxlock lck, unsigned int reserved_flags);
|
typedef CUresult CUDAAPI tcuvidCtxUnlock(CUvideoctxlock lck, unsigned int reserved_flags);
|
||||||
|
|
||||||
/** @} */ /* End VIDEO_DECODER */
|
/**********************************************************************************************/
|
||||||
|
|
||||||
#if defined(__cplusplus)
|
#if defined(__cplusplus)
|
||||||
}
|
}
|
||||||
|
@ -125,6 +125,7 @@ typedef struct CudaFunctions CudaFunctions;
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
typedef struct CuvidFunctions {
|
typedef struct CuvidFunctions {
|
||||||
|
tcuvidGetDecoderCaps *cuvidGetDecoderCaps;
|
||||||
tcuvidCreateDecoder *cuvidCreateDecoder;
|
tcuvidCreateDecoder *cuvidCreateDecoder;
|
||||||
tcuvidDestroyDecoder *cuvidDestroyDecoder;
|
tcuvidDestroyDecoder *cuvidDestroyDecoder;
|
||||||
tcuvidDecodePicture *cuvidDecodePicture;
|
tcuvidDecodePicture *cuvidDecodePicture;
|
||||||
@ -201,6 +202,7 @@ static inline int cuvid_load_functions(CuvidFunctions **functions)
|
|||||||
{
|
{
|
||||||
GENERIC_LOAD_FUNC_PREAMBLE(CuvidFunctions, cuvid, NVCUVID_LIBNAME);
|
GENERIC_LOAD_FUNC_PREAMBLE(CuvidFunctions, cuvid, NVCUVID_LIBNAME);
|
||||||
|
|
||||||
|
LOAD_SYMBOL(cuvidGetDecoderCaps, "cuvidGetDecoderCaps");
|
||||||
LOAD_SYMBOL(cuvidCreateDecoder, "cuvidCreateDecoder");
|
LOAD_SYMBOL(cuvidCreateDecoder, "cuvidCreateDecoder");
|
||||||
LOAD_SYMBOL(cuvidDestroyDecoder, "cuvidDestroyDecoder");
|
LOAD_SYMBOL(cuvidDestroyDecoder, "cuvidDestroyDecoder");
|
||||||
LOAD_SYMBOL(cuvidDecodePicture, "cuvidDecodePicture");
|
LOAD_SYMBOL(cuvidDecodePicture, "cuvidDecodePicture");
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* This copyright notice applies to this header file only:
|
* This copyright notice applies to this header file only:
|
||||||
*
|
*
|
||||||
* Copyright (c) 2010-2016 NVIDIA Corporation
|
* Copyright (c) 2010-2017 NVIDIA Corporation
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person
|
* Permission is hereby granted, free of charge, to any person
|
||||||
* obtaining a copy of this software and associated documentation
|
* obtaining a copy of this software and associated documentation
|
||||||
@ -25,12 +25,12 @@
|
|||||||
* OTHER DEALINGS IN THE SOFTWARE.
|
* OTHER DEALINGS IN THE SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/********************************************************************************************************************/
|
||||||
* \file nvcuvid.h
|
//! \file nvcuvid.h
|
||||||
* NvCuvid API provides Video Decoding interface to NVIDIA GPU devices.
|
//! NVDECODE API provides video decoding interface to NVIDIA GPU devices.
|
||||||
* \date 2015-2015
|
//! \date 2015-2017
|
||||||
* This file contains the interface constants, structure definitions and function prototypes.
|
//! This file contains the interface constants, structure definitions and function prototypes.
|
||||||
*/
|
/********************************************************************************************************************/
|
||||||
|
|
||||||
#if !defined(__NVCUVID_H__)
|
#if !defined(__NVCUVID_H__)
|
||||||
#define __NVCUVID_H__
|
#define __NVCUVID_H__
|
||||||
@ -41,78 +41,87 @@
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif /* __cplusplus */
|
#endif /* __cplusplus */
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////////////////////
|
/*********************************
|
||||||
//
|
** Initialization
|
||||||
// High-level helper APIs for video sources
|
*********************************/
|
||||||
//
|
CUresult CUDAAPI cuvidInit(unsigned int Flags);
|
||||||
|
|
||||||
|
/***********************************************/
|
||||||
|
//!
|
||||||
|
//! High-level helper APIs for video sources
|
||||||
|
//!
|
||||||
|
/***********************************************/
|
||||||
|
|
||||||
typedef void *CUvideosource;
|
typedef void *CUvideosource;
|
||||||
typedef void *CUvideoparser;
|
typedef void *CUvideoparser;
|
||||||
typedef long long CUvideotimestamp;
|
typedef long long CUvideotimestamp;
|
||||||
|
|
||||||
/**
|
|
||||||
* \addtogroup VIDEO_PARSER Video Parser
|
|
||||||
* @{
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*!
|
/************************************************************************/
|
||||||
* \enum cudaVideoState
|
//! \enum cudaVideoState
|
||||||
* Video Source State
|
//! Video source state enums
|
||||||
*/
|
//! Used in cuvidSetVideoSourceState and cuvidGetVideoSourceState APIs
|
||||||
|
/************************************************************************/
|
||||||
typedef enum {
|
typedef enum {
|
||||||
cudaVideoState_Error = -1, /**< Error state (invalid source) */
|
cudaVideoState_Error = -1, /**< Error state (invalid source) */
|
||||||
cudaVideoState_Stopped = 0, /**< Source is stopped (or reached end-of-stream) */
|
cudaVideoState_Stopped = 0, /**< Source is stopped (or reached end-of-stream) */
|
||||||
cudaVideoState_Started = 1 /**< Source is running and delivering data */
|
cudaVideoState_Started = 1 /**< Source is running and delivering data */
|
||||||
} cudaVideoState;
|
} cudaVideoState;
|
||||||
|
|
||||||
/*!
|
/************************************************************************/
|
||||||
* \enum cudaAudioCodec
|
//! \enum cudaAudioCodec
|
||||||
* Audio compression
|
//! Audio compression enums
|
||||||
*/
|
//! Used in CUAUDIOFORMAT structure
|
||||||
|
/************************************************************************/
|
||||||
typedef enum {
|
typedef enum {
|
||||||
cudaAudioCodec_MPEG1=0, /**< MPEG-1 Audio */
|
cudaAudioCodec_MPEG1=0, /**< MPEG-1 Audio */
|
||||||
cudaAudioCodec_MPEG2, /**< MPEG-2 Audio */
|
cudaAudioCodec_MPEG2, /**< MPEG-2 Audio */
|
||||||
cudaAudioCodec_MP3, /**< MPEG-1 Layer III Audio */
|
cudaAudioCodec_MP3, /**< MPEG-1 Layer III Audio */
|
||||||
cudaAudioCodec_AC3, /**< Dolby Digital (AC3) Audio */
|
cudaAudioCodec_AC3, /**< Dolby Digital (AC3) Audio */
|
||||||
cudaAudioCodec_LPCM /**< PCM Audio */
|
cudaAudioCodec_LPCM, /**< PCM Audio */
|
||||||
|
cudaAudioCodec_AAC, /**< AAC Audio */
|
||||||
} cudaAudioCodec;
|
} cudaAudioCodec;
|
||||||
|
|
||||||
/*!
|
/************************************************************************************************/
|
||||||
* \struct CUVIDEOFORMAT
|
//! \ingroup STRUCTS
|
||||||
* Video format
|
//! \struct CUVIDEOFORMAT
|
||||||
*/
|
//! Video format
|
||||||
|
//! Used in cuvidGetSourceVideoFormat API
|
||||||
|
/************************************************************************************************/
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
cudaVideoCodec codec; /**< Compression format */
|
cudaVideoCodec codec; /**< OUT: Compression format */
|
||||||
/**
|
/**
|
||||||
* frame rate = numerator / denominator (for example: 30000/1001)
|
* OUT: frame rate = numerator / denominator (for example: 30000/1001)
|
||||||
*/
|
*/
|
||||||
struct {
|
struct {
|
||||||
unsigned int numerator; /**< frame rate numerator (0 = unspecified or variable frame rate) */
|
/**< OUT: frame rate numerator (0 = unspecified or variable frame rate) */
|
||||||
unsigned int denominator; /**< frame rate denominator (0 = unspecified or variable frame rate) */
|
unsigned int numerator;
|
||||||
|
/**< OUT: frame rate denominator (0 = unspecified or variable frame rate) */
|
||||||
|
unsigned int denominator;
|
||||||
} frame_rate;
|
} frame_rate;
|
||||||
unsigned char progressive_sequence; /**< 0=interlaced, 1=progressive */
|
unsigned char progressive_sequence; /**< OUT: 0=interlaced, 1=progressive */
|
||||||
unsigned char bit_depth_luma_minus8; /**< high bit depth Luma */
|
unsigned char bit_depth_luma_minus8; /**< OUT: high bit depth luma. E.g, 2 for 10-bitdepth, 4 for 12-bitdepth */
|
||||||
unsigned char bit_depth_chroma_minus8; /**< high bit depth Chroma */
|
unsigned char bit_depth_chroma_minus8; /**< OUT: high bit depth chroma. E.g, 2 for 10-bitdepth, 4 for 12-bitdepth */
|
||||||
unsigned char reserved1; /**< Reserved for future use */
|
unsigned char reserved1; /**< Reserved for future use */
|
||||||
unsigned int coded_width; /**< coded frame width */
|
unsigned int coded_width; /**< OUT: coded frame width in pixels */
|
||||||
unsigned int coded_height; /**< coded frame height */
|
unsigned int coded_height; /**< OUT: coded frame height in pixels */
|
||||||
/**
|
/**
|
||||||
* area of the frame that should be displayed
|
* area of the frame that should be displayed
|
||||||
* typical example:
|
* typical example:
|
||||||
* coded_width = 1920, coded_height = 1088
|
* coded_width = 1920, coded_height = 1088
|
||||||
* display_area = { 0,0,1920,1080 }
|
* display_area = { 0,0,1920,1080 }
|
||||||
*/
|
*/
|
||||||
struct {
|
struct {
|
||||||
int left; /**< left position of display rect */
|
int left; /**< OUT: left position of display rect */
|
||||||
int top; /**< top position of display rect */
|
int top; /**< OUT: top position of display rect */
|
||||||
int right; /**< right position of display rect */
|
int right; /**< OUT: right position of display rect */
|
||||||
int bottom; /**< bottom position of display rect */
|
int bottom; /**< OUT: bottom position of display rect */
|
||||||
} display_area;
|
} display_area;
|
||||||
cudaVideoChromaFormat chroma_format; /**< Chroma format */
|
cudaVideoChromaFormat chroma_format; /**< OUT: Chroma format */
|
||||||
unsigned int bitrate; /**< video bitrate (bps, 0=unknown) */
|
unsigned int bitrate; /**< OUT: video bitrate (bps, 0=unknown) */
|
||||||
/**
|
/**
|
||||||
* Display Aspect Ratio = x:y (4:3, 16:9, etc)
|
* OUT: Display Aspect Ratio = x:y (4:3, 16:9, etc)
|
||||||
*/
|
*/
|
||||||
struct {
|
struct {
|
||||||
int x;
|
int x;
|
||||||
@ -120,192 +129,223 @@ typedef struct
|
|||||||
} display_aspect_ratio;
|
} display_aspect_ratio;
|
||||||
/**
|
/**
|
||||||
* Video Signal Description
|
* Video Signal Description
|
||||||
|
* Refer section E.2.1 (VUI parameters semantics) of H264 spec file
|
||||||
*/
|
*/
|
||||||
struct {
|
struct {
|
||||||
unsigned char video_format : 3;
|
unsigned char video_format : 3; /**< OUT: 0-Component, 1-PAL, 2-NTSC, 3-SECAM, 4-MAC, 5-Unspecified */
|
||||||
unsigned char video_full_range_flag : 1;
|
unsigned char video_full_range_flag : 1; /**< OUT: indicates the black level and luma and chroma range */
|
||||||
unsigned char reserved_zero_bits : 4;
|
unsigned char reserved_zero_bits : 4; /**< Reserved bits */
|
||||||
unsigned char color_primaries;
|
unsigned char color_primaries; /**< OUT: chromaticity coordinates of source primaries */
|
||||||
unsigned char transfer_characteristics;
|
unsigned char transfer_characteristics; /**< OUT: opto-electronic transfer characteristic of the source picture */
|
||||||
unsigned char matrix_coefficients;
|
unsigned char matrix_coefficients; /**< OUT: used in deriving luma and chroma signals from RGB primaries */
|
||||||
} video_signal_description;
|
} video_signal_description;
|
||||||
unsigned int seqhdr_data_length; /**< Additional bytes following (CUVIDEOFORMATEX) */
|
unsigned int seqhdr_data_length; /**< OUT: Additional bytes following (CUVIDEOFORMATEX) */
|
||||||
} CUVIDEOFORMAT;
|
} CUVIDEOFORMAT;
|
||||||
|
|
||||||
/*!
|
/****************************************************************/
|
||||||
* \struct CUVIDEOFORMATEX
|
//! \ingroup STRUCTS
|
||||||
* Video format including raw sequence header information
|
//! \struct CUVIDEOFORMATEX
|
||||||
*/
|
//! Video format including raw sequence header information
|
||||||
|
//! Used in cuvidGetSourceVideoFormat API
|
||||||
|
/****************************************************************/
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
CUVIDEOFORMAT format;
|
CUVIDEOFORMAT format; /**< OUT: CUVIDEOFORMAT structure */
|
||||||
unsigned char raw_seqhdr_data[1024];
|
unsigned char raw_seqhdr_data[1024]; /**< OUT: Sequence header data */
|
||||||
} CUVIDEOFORMATEX;
|
} CUVIDEOFORMATEX;
|
||||||
|
|
||||||
/*!
|
/****************************************************************/
|
||||||
* \struct CUAUDIOFORMAT
|
//! \ingroup STRUCTS
|
||||||
* Audio Formats
|
//! \struct CUAUDIOFORMAT
|
||||||
*/
|
//! Audio formats
|
||||||
|
//! Used in cuvidGetSourceAudioFormat API
|
||||||
|
/****************************************************************/
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
cudaAudioCodec codec; /**< Compression format */
|
cudaAudioCodec codec; /**< OUT: Compression format */
|
||||||
unsigned int channels; /**< number of audio channels */
|
unsigned int channels; /**< OUT: number of audio channels */
|
||||||
unsigned int samplespersec; /**< sampling frequency */
|
unsigned int samplespersec; /**< OUT: sampling frequency */
|
||||||
unsigned int bitrate; /**< For uncompressed, can also be used to determine bits per sample */
|
unsigned int bitrate; /**< OUT: For uncompressed, can also be used to determine bits per sample */
|
||||||
unsigned int reserved1; /**< Reserved for future use */
|
unsigned int reserved1; /**< Reserved for future use */
|
||||||
unsigned int reserved2; /**< Reserved for future use */
|
unsigned int reserved2; /**< Reserved for future use */
|
||||||
} CUAUDIOFORMAT;
|
} CUAUDIOFORMAT;
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/***************************************************************/
|
||||||
* \enum CUvideopacketflags
|
//! \enum CUvideopacketflags
|
||||||
* Data packet flags
|
//! Data packet flags
|
||||||
*/
|
//! Used in CUVIDSOURCEDATAPACKET structure
|
||||||
|
/***************************************************************/
|
||||||
typedef enum {
|
typedef enum {
|
||||||
CUVID_PKT_ENDOFSTREAM = 0x01, /**< Set when this is the last packet for this stream */
|
CUVID_PKT_ENDOFSTREAM = 0x01, /**< Set when this is the last packet for this stream */
|
||||||
CUVID_PKT_TIMESTAMP = 0x02, /**< Timestamp is valid */
|
CUVID_PKT_TIMESTAMP = 0x02, /**< Timestamp is valid */
|
||||||
CUVID_PKT_DISCONTINUITY = 0x04 /**< Set when a discontinuity has to be signalled */
|
CUVID_PKT_DISCONTINUITY = 0x04, /**< Set when a discontinuity has to be signalled */
|
||||||
|
CUVID_PKT_ENDOFPICTURE = 0x08, /**< Set when the packet contains exactly one frame */
|
||||||
} CUvideopacketflags;
|
} CUvideopacketflags;
|
||||||
|
|
||||||
/*!
|
/*****************************************************************************/
|
||||||
* \struct CUVIDSOURCEDATAPACKET
|
//! \ingroup STRUCTS
|
||||||
* Data Packet
|
//! \struct CUVIDSOURCEDATAPACKET
|
||||||
*/
|
//! Data Packet
|
||||||
|
//! Used in cuvidParseVideoData API
|
||||||
|
//! IN for cuvidParseVideoData
|
||||||
|
/*****************************************************************************/
|
||||||
typedef struct _CUVIDSOURCEDATAPACKET
|
typedef struct _CUVIDSOURCEDATAPACKET
|
||||||
{
|
{
|
||||||
tcu_ulong flags; /**< Combination of CUVID_PKT_XXX flags */
|
tcu_ulong flags; /**< IN: Combination of CUVID_PKT_XXX flags */
|
||||||
tcu_ulong payload_size; /**< number of bytes in the payload (may be zero if EOS flag is set) */
|
tcu_ulong payload_size; /**< IN: number of bytes in the payload (may be zero if EOS flag is set) */
|
||||||
const unsigned char *payload; /**< Pointer to packet payload data (may be NULL if EOS flag is set) */
|
const unsigned char *payload; /**< IN: Pointer to packet payload data (may be NULL if EOS flag is set) */
|
||||||
CUvideotimestamp timestamp; /**< Presentation timestamp (10MHz clock), only valid if CUVID_PKT_TIMESTAMP flag is set */
|
CUvideotimestamp timestamp; /**< IN: Presentation time stamp (10MHz clock), only valid if
|
||||||
|
CUVID_PKT_TIMESTAMP flag is set */
|
||||||
} CUVIDSOURCEDATAPACKET;
|
} CUVIDSOURCEDATAPACKET;
|
||||||
|
|
||||||
// Callback for packet delivery
|
// Callback for packet delivery
|
||||||
typedef int (CUDAAPI *PFNVIDSOURCECALLBACK)(void *, CUVIDSOURCEDATAPACKET *);
|
typedef int (CUDAAPI *PFNVIDSOURCECALLBACK)(void *, CUVIDSOURCEDATAPACKET *);
|
||||||
|
|
||||||
/*!
|
/**************************************************************************************************************************/
|
||||||
* \struct CUVIDSOURCEPARAMS
|
//! \ingroup STRUCTS
|
||||||
* Source Params
|
//! \struct CUVIDSOURCEPARAMS
|
||||||
*/
|
//! Describes parameters needed in cuvidCreateVideoSource API
|
||||||
|
//! NVDECODE API is intended for HW accelerated video decoding so CUvideosource doesn't have audio demuxer for all supported
|
||||||
|
//! containers. It's recommended to clients to use their own or third party demuxer if audio support is needed.
|
||||||
|
/**************************************************************************************************************************/
|
||||||
typedef struct _CUVIDSOURCEPARAMS
|
typedef struct _CUVIDSOURCEPARAMS
|
||||||
{
|
{
|
||||||
unsigned int ulClockRate; /**< Timestamp units in Hz (0=default=10000000Hz) */
|
unsigned int ulClockRate; /**< IN: Time stamp units in Hz (0=default=10000000Hz) */
|
||||||
unsigned int uReserved1[7]; /**< Reserved for future use - set to zero */
|
unsigned int uReserved1[7]; /**< Reserved for future use - set to zero */
|
||||||
void *pUserData; /**< Parameter passed in to the data handlers */
|
void *pUserData; /**< IN: User private data passed in to the data handlers */
|
||||||
PFNVIDSOURCECALLBACK pfnVideoDataHandler; /**< Called to deliver audio packets */
|
PFNVIDSOURCECALLBACK pfnVideoDataHandler; /**< IN: Called to deliver video packets */
|
||||||
PFNVIDSOURCECALLBACK pfnAudioDataHandler; /**< Called to deliver video packets */
|
PFNVIDSOURCECALLBACK pfnAudioDataHandler; /**< IN: Called to deliver audio packets. */
|
||||||
void *pvReserved2[8]; /**< Reserved for future use - set to NULL */
|
void *pvReserved2[8]; /**< Reserved for future use - set to NULL */
|
||||||
} CUVIDSOURCEPARAMS;
|
} CUVIDSOURCEPARAMS;
|
||||||
|
|
||||||
/*!
|
|
||||||
* \enum CUvideosourceformat_flags
|
/**********************************************/
|
||||||
* CUvideosourceformat_flags
|
//! \ingroup ENUMS
|
||||||
*/
|
//! \enum CUvideosourceformat_flags
|
||||||
|
//! CUvideosourceformat_flags
|
||||||
|
//! Used in cuvidGetSourceVideoFormat API
|
||||||
|
/**********************************************/
|
||||||
typedef enum {
|
typedef enum {
|
||||||
CUVID_FMT_EXTFORMATINFO = 0x100 /**< Return extended format structure (CUVIDEOFORMATEX) */
|
CUVID_FMT_EXTFORMATINFO = 0x100 /**< Return extended format structure (CUVIDEOFORMATEX) */
|
||||||
} CUvideosourceformat_flags;
|
} CUvideosourceformat_flags;
|
||||||
|
|
||||||
#if !defined(__APPLE__)
|
#if !defined(__APPLE__)
|
||||||
/**
|
/**************************************************************************************************************************/
|
||||||
* \fn CUresult CUDAAPI cuvidCreateVideoSource(CUvideosource *pObj, const char *pszFileName, CUVIDSOURCEPARAMS *pParams)
|
//! \fn CUresult CUDAAPI cuvidCreateVideoSource(CUvideosource *pObj, const char *pszFileName, CUVIDSOURCEPARAMS *pParams)
|
||||||
* Create Video Source
|
//! Create CUvideosource object. CUvideosource spawns demultiplexer thread that provides two callbacks:
|
||||||
*/
|
//! pfnVideoDataHandler() and pfnAudioDataHandler()
|
||||||
|
//! NVDECODE API is intended for HW accelerated video decoding so CUvideosource doesn't have audio demuxer for all supported
|
||||||
|
//! containers. It's recommended to clients to use their own or third party demuxer if audio support is needed.
|
||||||
|
/**************************************************************************************************************************/
|
||||||
typedef CUresult CUDAAPI tcuvidCreateVideoSource(CUvideosource *pObj, const char *pszFileName, CUVIDSOURCEPARAMS *pParams);
|
typedef CUresult CUDAAPI tcuvidCreateVideoSource(CUvideosource *pObj, const char *pszFileName, CUVIDSOURCEPARAMS *pParams);
|
||||||
|
|
||||||
/**
|
/****************************************************************************************************************************/
|
||||||
* \fn CUresult CUDAAPI cuvidCreateVideoSourceW(CUvideosource *pObj, const wchar_t *pwszFileName, CUVIDSOURCEPARAMS *pParams)
|
//! \fn CUresult CUDAAPI cuvidCreateVideoSourceW(CUvideosource *pObj, const wchar_t *pwszFileName, CUVIDSOURCEPARAMS *pParams)
|
||||||
* Create Video Source
|
//! Create video source object and initialize
|
||||||
*/
|
/****************************************************************************************************************************/
|
||||||
typedef CUresult CUDAAPI tcuvidCreateVideoSourceW(CUvideosource *pObj, const wchar_t *pwszFileName, CUVIDSOURCEPARAMS *pParams);
|
typedef CUresult CUDAAPI tcuvidCreateVideoSourceW(CUvideosource *pObj, const wchar_t *pwszFileName, CUVIDSOURCEPARAMS *pParams);
|
||||||
|
|
||||||
/**
|
/*********************************************************************/
|
||||||
* \fn CUresult CUDAAPI cuvidDestroyVideoSource(CUvideosource obj)
|
//! \fn CUresult CUDAAPI cuvidDestroyVideoSource(CUvideosource obj)
|
||||||
* Destroy Video Source
|
//! Destroy video source
|
||||||
*/
|
/*********************************************************************/
|
||||||
typedef CUresult CUDAAPI tcuvidDestroyVideoSource(CUvideosource obj);
|
typedef CUresult CUDAAPI tcuvidDestroyVideoSource(CUvideosource obj);
|
||||||
|
|
||||||
/**
|
/******************************************************************************************/
|
||||||
* \fn CUresult CUDAAPI cuvidSetVideoSourceState(CUvideosource obj, cudaVideoState state)
|
//! \fn CUresult CUDAAPI cuvidSetVideoSourceState(CUvideosource obj, cudaVideoState state)
|
||||||
* Set Video Source state
|
//! Set video source state
|
||||||
*/
|
/******************************************************************************************/
|
||||||
typedef CUresult CUDAAPI tcuvidSetVideoSourceState(CUvideosource obj, cudaVideoState state);
|
typedef CUresult CUDAAPI tcuvidSetVideoSourceState(CUvideosource obj, cudaVideoState state);
|
||||||
|
|
||||||
/**
|
/******************************************************************************************/
|
||||||
* \fn cudaVideoState CUDAAPI cuvidGetVideoSourceState(CUvideosource obj)
|
//! \fn cudaVideoState CUDAAPI cuvidGetVideoSourceState(CUvideosource obj)
|
||||||
* Get Video Source state
|
//! Get video source state
|
||||||
*/
|
/******************************************************************************************/
|
||||||
typedef cudaVideoState CUDAAPI tcuvidGetVideoSourceState(CUvideosource obj);
|
typedef cudaVideoState CUDAAPI tcuvidGetVideoSourceState(CUvideosource obj);
|
||||||
|
|
||||||
/**
|
/****************************************************************************************************************/
|
||||||
* \fn CUresult CUDAAPI cuvidGetSourceVideoFormat(CUvideosource obj, CUVIDEOFORMAT *pvidfmt, unsigned int flags)
|
//! \fn CUresult CUDAAPI cuvidGetSourceVideoFormat(CUvideosource obj, CUVIDEOFORMAT *pvidfmt, unsigned int flags)
|
||||||
* Get Video Source Format
|
//! Gets details of video stream in pvidfmt
|
||||||
*/
|
/****************************************************************************************************************/
|
||||||
typedef CUresult CUDAAPI tcuvidGetSourceVideoFormat(CUvideosource obj, CUVIDEOFORMAT *pvidfmt, unsigned int flags);
|
typedef CUresult CUDAAPI tcuvidGetSourceVideoFormat(CUvideosource obj, CUVIDEOFORMAT *pvidfmt, unsigned int flags);
|
||||||
|
|
||||||
/**
|
/****************************************************************************************************************/
|
||||||
* \fn CUresult CUDAAPI cuvidGetSourceAudioFormat(CUvideosource obj, CUAUDIOFORMAT *paudfmt, unsigned int flags)
|
//! \fn CUresult CUDAAPI cuvidGetSourceAudioFormat(CUvideosource obj, CUAUDIOFORMAT *paudfmt, unsigned int flags)
|
||||||
* Set Video Source state
|
//! Get audio source format
|
||||||
*/
|
//! NVDECODE API is intended for HW accelarated video decoding so CUvideosource doesn't have audio demuxer for all suppported
|
||||||
|
//! containers. It's recommended to clients to use their own or third party demuxer if audio support is needed.
|
||||||
|
/****************************************************************************************************************/
|
||||||
typedef CUresult CUDAAPI tcuvidGetSourceAudioFormat(CUvideosource obj, CUAUDIOFORMAT *paudfmt, unsigned int flags);
|
typedef CUresult CUDAAPI tcuvidGetSourceAudioFormat(CUvideosource obj, CUAUDIOFORMAT *paudfmt, unsigned int flags);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
/**********************************************************************************/
|
||||||
/**
|
//! \ingroup STRUCTS
|
||||||
* \struct CUVIDPARSERDISPINFO
|
//! \struct CUVIDPARSERDISPINFO
|
||||||
*/
|
//! Used in cuvidParseVideoData API with PFNVIDDISPLAYCALLBACK pfnDisplayPicture
|
||||||
|
/**********************************************************************************/
|
||||||
typedef struct _CUVIDPARSERDISPINFO
|
typedef struct _CUVIDPARSERDISPINFO
|
||||||
{
|
{
|
||||||
int picture_index; /**< */
|
int picture_index; /**< OUT: Index of the current picture */
|
||||||
int progressive_frame; /**< */
|
int progressive_frame; /**< OUT: 1 if progressive frame; 0 otherwise */
|
||||||
int top_field_first; /**< */
|
int top_field_first; /**< OUT: 1 if top field is displayed first; 0 otherwise */
|
||||||
int repeat_first_field; /**< Number of additional fields (1=ivtc, 2=frame doubling, 4=frame tripling, -1=unpaired field) */
|
int repeat_first_field; /**< OUT: Number of additional fields (1=ivtc, 2=frame doubling, 4=frame tripling,
|
||||||
CUvideotimestamp timestamp; /**< */
|
-1=unpaired field) */
|
||||||
|
CUvideotimestamp timestamp; /**< OUT: Presentation time stamp */
|
||||||
} CUVIDPARSERDISPINFO;
|
} CUVIDPARSERDISPINFO;
|
||||||
|
|
||||||
//
|
/***********************************************************************************************************************/
|
||||||
// Parser callbacks
|
//! Parser callbacks
|
||||||
// The parser will call these synchronously from within cuvidParseVideoData(), whenever a picture is ready to
|
//! The parser will call these synchronously from within cuvidParseVideoData(), whenever a picture is ready to
|
||||||
// be decoded and/or displayed.
|
//! be decoded and/or displayed. First argument in functions is "void *pUserData" member of structure CUVIDSOURCEPARAMS
|
||||||
//
|
/***********************************************************************************************************************/
|
||||||
typedef int (CUDAAPI *PFNVIDSEQUENCECALLBACK)(void *, CUVIDEOFORMAT *);
|
typedef int (CUDAAPI *PFNVIDSEQUENCECALLBACK)(void *, CUVIDEOFORMAT *);
|
||||||
typedef int (CUDAAPI *PFNVIDDECODECALLBACK)(void *, CUVIDPICPARAMS *);
|
typedef int (CUDAAPI *PFNVIDDECODECALLBACK)(void *, CUVIDPICPARAMS *);
|
||||||
typedef int (CUDAAPI *PFNVIDDISPLAYCALLBACK)(void *, CUVIDPARSERDISPINFO *);
|
typedef int (CUDAAPI *PFNVIDDISPLAYCALLBACK)(void *, CUVIDPARSERDISPINFO *);
|
||||||
|
|
||||||
/**
|
/**************************************/
|
||||||
* \struct CUVIDPARSERPARAMS
|
//! \ingroup STRUCTS
|
||||||
*/
|
//! \struct CUVIDPARSERPARAMS
|
||||||
|
//! Used in cuvidCreateVideoParser API
|
||||||
|
/**************************************/
|
||||||
typedef struct _CUVIDPARSERPARAMS
|
typedef struct _CUVIDPARSERPARAMS
|
||||||
{
|
{
|
||||||
cudaVideoCodec CodecType; /**< cudaVideoCodec_XXX */
|
cudaVideoCodec CodecType; /**< IN: cudaVideoCodec_XXX */
|
||||||
unsigned int ulMaxNumDecodeSurfaces; /**< Max # of decode surfaces (parser will cycle through these) */
|
unsigned int ulMaxNumDecodeSurfaces; /**< IN: Max # of decode surfaces (parser will cycle through these) */
|
||||||
unsigned int ulClockRate; /**< Timestamp units in Hz (0=default=10000000Hz) */
|
unsigned int ulClockRate; /**< IN: Timestamp units in Hz (0=default=10000000Hz) */
|
||||||
unsigned int ulErrorThreshold; /**< % Error threshold (0-100) for calling pfnDecodePicture (100=always call pfnDecodePicture even if picture bitstream is fully corrupted) */
|
unsigned int ulErrorThreshold; /**< IN: % Error threshold (0-100) for calling pfnDecodePicture (100=always
|
||||||
unsigned int ulMaxDisplayDelay; /**< Max display queue delay (improves pipelining of decode with display) - 0=no delay (recommended values: 2..4) */
|
IN: call pfnDecodePicture even if picture bitstream is fully corrupted) */
|
||||||
unsigned int uReserved1[5]; /**< Reserved for future use - set to 0 */
|
unsigned int ulMaxDisplayDelay; /**< IN: Max display queue delay (improves pipelining of decode with display)
|
||||||
void *pUserData; /**< User data for callbacks */
|
0=no delay (recommended values: 2..4) */
|
||||||
PFNVIDSEQUENCECALLBACK pfnSequenceCallback; /**< Called before decoding frames and/or whenever there is a format change */
|
unsigned int uReserved1[5]; /**< IN: Reserved for future use - set to 0 */
|
||||||
PFNVIDDECODECALLBACK pfnDecodePicture; /**< Called when a picture is ready to be decoded (decode order) */
|
void *pUserData; /**< IN: User data for callbacks */
|
||||||
PFNVIDDISPLAYCALLBACK pfnDisplayPicture; /**< Called whenever a picture is ready to be displayed (display order) */
|
PFNVIDSEQUENCECALLBACK pfnSequenceCallback; /**< IN: Called before decoding frames and/or whenever there is a fmt change */
|
||||||
void *pvReserved2[7]; /**< Reserved for future use - set to NULL */
|
PFNVIDDECODECALLBACK pfnDecodePicture; /**< IN: Called when a picture is ready to be decoded (decode order) */
|
||||||
CUVIDEOFORMATEX *pExtVideoInfo; /**< [Optional] sequence header data from system layer */
|
PFNVIDDISPLAYCALLBACK pfnDisplayPicture; /**< IN: Called whenever a picture is ready to be displayed (display order) */
|
||||||
|
void *pvReserved2[7]; /**< Reserved for future use - set to NULL */
|
||||||
|
CUVIDEOFORMATEX *pExtVideoInfo; /**< IN: [Optional] sequence header data from system layer */
|
||||||
} CUVIDPARSERPARAMS;
|
} CUVIDPARSERPARAMS;
|
||||||
|
|
||||||
/**
|
/************************************************************************************************/
|
||||||
* \fn CUresult CUDAAPI cuvidCreateVideoParser(CUvideoparser *pObj, CUVIDPARSERPARAMS *pParams)
|
//! \fn CUresult CUDAAPI cuvidCreateVideoParser(CUvideoparser *pObj, CUVIDPARSERPARAMS *pParams)
|
||||||
*/
|
//! Create video parser object and initialize
|
||||||
|
/************************************************************************************************/
|
||||||
typedef CUresult CUDAAPI tcuvidCreateVideoParser(CUvideoparser *pObj, CUVIDPARSERPARAMS *pParams);
|
typedef CUresult CUDAAPI tcuvidCreateVideoParser(CUvideoparser *pObj, CUVIDPARSERPARAMS *pParams);
|
||||||
|
|
||||||
/**
|
/************************************************************************************************/
|
||||||
* \fn CUresult CUDAAPI cuvidParseVideoData(CUvideoparser obj, CUVIDSOURCEDATAPACKET *pPacket)
|
//! \fn CUresult CUDAAPI cuvidParseVideoData(CUvideoparser obj, CUVIDSOURCEDATAPACKET *pPacket)
|
||||||
*/
|
//! Parse the video data from source data packet in pPacket
|
||||||
|
//! Extracts parameter sets like SPS, PPS, bitstream etc. from pPacket and
|
||||||
|
//! calls back pfnDecodePicture with CUVIDPICPARAMS data for kicking of HW decoding
|
||||||
|
/************************************************************************************************/
|
||||||
typedef CUresult CUDAAPI tcuvidParseVideoData(CUvideoparser obj, CUVIDSOURCEDATAPACKET *pPacket);
|
typedef CUresult CUDAAPI tcuvidParseVideoData(CUvideoparser obj, CUVIDSOURCEDATAPACKET *pPacket);
|
||||||
|
|
||||||
/**
|
/*******************************************************************/
|
||||||
* \fn CUresult CUDAAPI cuvidDestroyVideoParser(CUvideoparser obj)
|
//! \fn CUresult CUDAAPI cuvidDestroyVideoParser(CUvideoparser obj)
|
||||||
*/
|
/*******************************************************************/
|
||||||
typedef CUresult CUDAAPI tcuvidDestroyVideoParser(CUvideoparser obj);
|
typedef CUresult CUDAAPI tcuvidDestroyVideoParser(CUvideoparser obj);
|
||||||
|
|
||||||
/** @} */ /* END VIDEO_PARSER */
|
/**********************************************************************************************/
|
||||||
////////////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
#if defined(__cplusplus)
|
#if defined(__cplusplus)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user