Update cuvid/nvdec headers to SDK 8.1 n8.1.24.0
authorTimo Rothenpieler <timo@rothenpieler.org>
Wed, 11 Apr 2018 11:11:55 +0000 (13:11 +0200)
committerTimo Rothenpieler <timo@rothenpieler.org>
Wed, 11 Apr 2018 11:11:55 +0000 (13:11 +0200)
include/ffnvcodec/dynlink_cuviddec.h
include/ffnvcodec/dynlink_nvcuvid.h

index 4af78a186baa80d57559867d3aebc0b1b3e0e194..7eab79c5ae623c3f0ee5047babaebf3b09abc972 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This copyright notice applies to this header file only:
  *
- * Copyright (c) 2010-2017 NVIDIA Corporation
+ * Copyright (c) 2010-2018 NVIDIA Corporation
  *
  * Permission is hereby granted, free of charge, to any person
  * obtaining a copy of this software and associated documentation
@@ -28,7 +28,7 @@
 /*****************************************************************************************************/
 //! \file cuviddec.h
 //! NVDECODE API provides video decoding interface to NVIDIA GPU devices.
-//! \date 2015-2017
+//! \date 2015-2018
 //! This file contains constants, structure definitions and function prototypes used for decoding.
 /*****************************************************************************************************/
 
 #endif
 #endif
 
+#define NVDECAPI_MAJOR_VERSION 8
+#define NVDECAPI_MINOR_VERSION 1
+
+#define NVDECAPI_VERSION (NVDECAPI_MAJOR_VERSION | (NVDECAPI_MINOR_VERSION << 24))
+
 #if defined(__cplusplus)
 extern "C" {
 #endif /* __cplusplus */
@@ -499,7 +504,12 @@ typedef struct _CUVIDHEVCPICPARAMS
 
     unsigned char bit_depth_luma_minus8;
     unsigned char bit_depth_chroma_minus8;
-    unsigned char reserved1[14];
+    //sps/pps extension fields
+    unsigned char log2_max_transform_skip_block_size_minus2;
+    unsigned char log2_sao_offset_scale_luma;
+    unsigned char log2_sao_offset_scale_chroma;
+    unsigned char high_precision_offsets_enabled_flag;
+    unsigned char reserved1[10];
 
     // pps
     unsigned char dependent_slice_segments_enabled_flag;
@@ -776,57 +786,57 @@ typedef struct _CUVIDPROCPARAMS
 /**********************************************************************************************************************/
 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);
-/********************************************************************************************************************/
+
+/*****************************************************************************************************/
 //! \fn CUresult CUDAAPI cuvidDestroyDecoder(CUvideodecoder hDecoder)
-//! Destroy the decoder object.
-/********************************************************************************************************************/
+//! Destroy the decoder object
+/*****************************************************************************************************/
 typedef CUresult CUDAAPI tcuvidDestroyDecoder(CUvideodecoder hDecoder);
 
-/********************************************************************************************************************/
+/*****************************************************************************************************/
 //! \fn CUresult CUDAAPI cuvidDecodePicture(CUvideodecoder hDecoder, CUVIDPICPARAMS *pPicParams)
 //! Decode a single picture (field or frame)
 //! Kicks off HW decoding
-/********************************************************************************************************************/
+/*****************************************************************************************************/
 typedef CUresult CUDAAPI tcuvidDecodePicture(CUvideodecoder hDecoder, CUVIDPICPARAMS *pPicParams);
 
-
 #if !defined(__CUVID_DEVPTR64) || defined(__CUVID_INTERNAL)
 /************************************************************************************************************************/
 //! \fn CUresult CUDAAPI cuvidMapVideoFrame(CUvideodecoder hDecoder, int nPicIdx, unsigned int *pDevPtr,
-//!                                         unsigned int  *pPitch, CUVIDPROCPARAMS *pVPP);
+//!                                         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,
-                                           unsigned int *pDevPtr, unsigned int *pPitch,
-                                           CUVIDPROCPARAMS *pVPP);
+                                             unsigned int *pDevPtr, unsigned int *pPitch,
+                                             CUVIDPROCPARAMS *pVPP);
 
-/********************************************************************************************************************/
+/*****************************************************************************************************/
 //! \fn CUresult CUDAAPI cuvidUnmapVideoFrame(CUvideodecoder hDecoder, unsigned int DevPtr)
 //! Unmap a previously mapped video frame
-/********************************************************************************************************************/
+/*****************************************************************************************************/
 typedef CUresult CUDAAPI tcuvidUnmapVideoFrame(CUvideodecoder hDecoder, unsigned int DevPtr);
 #endif
 
 #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);
+//!                                           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,
-                                             unsigned int *pPitch, CUVIDPROCPARAMS *pVPP);
+                                               unsigned int *pPitch, CUVIDPROCPARAMS *pVPP);
 
-/********************************************************************************************************************/
+/**************************************************************************************************/
 //! \fn CUresult CUDAAPI cuvidUnmapVideoFrame64(CUvideodecoder hDecoder, unsigned long long DevPtr);
 //! Unmap a previously mapped video frame
-/********************************************************************************************************************/
+/**************************************************************************************************/
 typedef CUresult CUDAAPI tcuvidUnmapVideoFrame64(CUvideodecoder hDecoder, unsigned long long DevPtr);
 
 #if defined(__CUVID_DEVPTR64) && !defined(__CUVID_INTERNAL)
index b147efba2cb0307bd0d701611f7d65b841d74714..968337b05b0723feab91d05b6368e01a95d1433f 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This copyright notice applies to this header file only:
  *
- * Copyright (c) 2010-2017 NVIDIA Corporation
+ * Copyright (c) 2010-2018 NVIDIA Corporation
  *
  * Permission is hereby granted, free of charge, to any person
  * obtaining a copy of this software and associated documentation
@@ -28,7 +28,7 @@
 /********************************************************************************************************************/
 //! \file nvcuvid.h
 //!   NVDECODE API provides video decoding interface to NVIDIA GPU devices.
-//! \date 2015-2017
+//! \date 2015-2018
 //!  This file contains the interface constants, structure definitions and function prototypes.
 /********************************************************************************************************************/
 
 extern "C" {
 #endif /* __cplusplus */
 
-/*********************************
-** Initialization
-*********************************/
-CUresult  CUDAAPI cuvidInit(unsigned int Flags);
 
 /***********************************************/
 //!
@@ -231,51 +227,65 @@ typedef enum {
 } CUvideosourceformat_flags;
 
 #if !defined(__APPLE__)
-/**************************************************************************************************************************/
+/***************************************************************************************************************************/
+//! \ingroup FUNCTS
 //! \fn CUresult CUDAAPI cuvidCreateVideoSource(CUvideosource *pObj, const char *pszFileName, CUVIDSOURCEPARAMS *pParams)
 //! 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);
 
-/****************************************************************************************************************************/
+/***************************************************************************************************************************/
+//! \ingroup FUNCTS
 //! \fn CUresult CUDAAPI cuvidCreateVideoSourceW(CUvideosource *pObj, const wchar_t *pwszFileName, CUVIDSOURCEPARAMS *pParams)
-//! Create video source object and initialize
-/****************************************************************************************************************************/
+//! Create video source
+/***************************************************************************************************************************/
 typedef CUresult CUDAAPI tcuvidCreateVideoSourceW(CUvideosource *pObj, const wchar_t *pwszFileName, CUVIDSOURCEPARAMS *pParams);
 
-/*********************************************************************/
+/********************************************************************/
+//! \ingroup FUNCTS
 //! \fn CUresult CUDAAPI cuvidDestroyVideoSource(CUvideosource obj)
 //! Destroy video source
-/*********************************************************************/
+/********************************************************************/
 typedef CUresult CUDAAPI tcuvidDestroyVideoSource(CUvideosource obj);
 
 /******************************************************************************************/
+//! \ingroup FUNCTS
 //! \fn CUresult CUDAAPI cuvidSetVideoSourceState(CUvideosource obj, cudaVideoState state)
-//! Set video source state
+//! Set video source state to:
+//! cudaVideoState_Started - to signal the source to run and deliver data
+//! cudaVideoState_Stopped - to stop the source from delivering the data
+//! cudaVideoState_Error   - invalid source
 /******************************************************************************************/
 typedef CUresult CUDAAPI tcuvidSetVideoSourceState(CUvideosource obj, cudaVideoState state);
 
 /******************************************************************************************/
+//! \ingroup FUNCTS
 //! \fn cudaVideoState CUDAAPI cuvidGetVideoSourceState(CUvideosource obj)
 //! Get video source state
+//! Returns:
+//! cudaVideoState_Started - if Source is running and delivering data
+//! cudaVideoState_Stopped - if Source is stopped or reached end-of-stream
+//! cudaVideoState_Error   - if Source is in error state
 /******************************************************************************************/
 typedef cudaVideoState CUDAAPI tcuvidGetVideoSourceState(CUvideosource obj);
 
-/****************************************************************************************************************/
+/******************************************************************************************************************/
+//! \ingroup FUNCTS
 //! \fn CUresult CUDAAPI cuvidGetSourceVideoFormat(CUvideosource obj, CUVIDEOFORMAT *pvidfmt, unsigned int flags)
-//! Gets details of video stream in pvidfmt
-/****************************************************************************************************************/
+//! Gets video source format in pvidfmt, flags is set to combination of CUvideosourceformat_flags as per requirement
+/******************************************************************************************************************/
 typedef CUresult CUDAAPI tcuvidGetSourceVideoFormat(CUvideosource obj, CUVIDEOFORMAT *pvidfmt, unsigned int flags);
 
-/****************************************************************************************************************/
+/**************************************************************************************************************************/
+//! \ingroup FUNCTS
 //! \fn CUresult CUDAAPI cuvidGetSourceAudioFormat(CUvideosource obj, CUAUDIOFORMAT *paudfmt, unsigned int flags)
 //! Get audio source format
-//! NVDECODE API is intended for HW accelarated video decoding so CUvideosource doesn't have audio demuxer for all suppported
+//! 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 tcuvidGetSourceAudioFormat(CUvideosource obj, CUAUDIOFORMAT *paudfmt, unsigned int flags);
 
 #endif
@@ -327,22 +337,29 @@ typedef struct _CUVIDPARSERPARAMS
 } CUVIDPARSERPARAMS;
 
 /************************************************************************************************/
+//! \ingroup FUNCTS
 //! \fn CUresult CUDAAPI cuvidCreateVideoParser(CUvideoparser *pObj, CUVIDPARSERPARAMS *pParams)
 //! Create video parser object and initialize
 /************************************************************************************************/
 typedef CUresult CUDAAPI tcuvidCreateVideoParser(CUvideoparser *pObj, CUVIDPARSERPARAMS *pParams);
 
 /************************************************************************************************/
+//! \ingroup FUNCTS
 //! \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
+//! calls back pfnSequenceCallback with CUVIDEOFORMAT data for initial sequence header or when
+//! the decoder encounters a video format change
+//! calls back pfnDisplayPicture with CUVIDPARSERDISPINFO data to display a video frame
 /************************************************************************************************/
 typedef CUresult CUDAAPI tcuvidParseVideoData(CUvideoparser obj, CUVIDSOURCEDATAPACKET *pPacket);
 
-/*******************************************************************/
+/************************************************************************************************/
+//! \ingroup FUNCTS
 //! \fn CUresult CUDAAPI cuvidDestroyVideoParser(CUvideoparser obj)
-/*******************************************************************/
+//! Destroy the video parser
+/************************************************************************************************/
 typedef CUresult CUDAAPI tcuvidDestroyVideoParser(CUvideoparser obj);
 
 /**********************************************************************************************/