cuvid: Use bundled headers
authorPhilip Langdale <philipl@overt.org>
Wed, 21 Sep 2016 04:36:00 +0000 (21:36 -0700)
committerPhilip Langdale <philipl@overt.org>
Fri, 23 Sep 2016 01:38:51 +0000 (18:38 -0700)
We need to remove the dynlink fanciness and replace it with normal
function prototypes and update the include paths and configure logic.

We don't need to explicitly check for PICPARMS now - they're going
to be there.

compat/cuda/cuviddec.h
compat/cuda/nvcuvid.h
configure
libavcodec/cuvid.c

index 6ef95bd..a66826f 100644 (file)
@@ -35,9 +35,9 @@
 #if !defined(__CUDA_VIDEO_H__)\r
 #define __CUDA_VIDEO_H__\r
 \r
-#ifndef __dynlink_cuda_h__\r
-#include "dynlink_cuda.h"\r
-#endif // __dynlink_cuda_h__\r
+#ifndef __cuda_cuda_h__\r
+#include <cuda.h>\r
+#endif // __cuda_cuda_h__\r
 \r
 #if defined(__x86_64) || defined(AMD64) || defined(_M_AMD64)\r
 #if (CUDA_VERSION >= 3020) && (!defined(CUDA_FORCE_API_VERSION) || (CUDA_FORCE_API_VERSION >= 3020))\r
@@ -715,19 +715,19 @@ typedef struct _CUVIDPROCPARAMS
  * \fn CUresult CUDAAPI cuvidCreateDecoder(CUvideodecoder *phDecoder, CUVIDDECODECREATEINFO *pdci)\r
  * Create the decoder object\r
  */\r
-typedef CUresult CUDAAPI tcuvidCreateDecoder(CUvideodecoder *phDecoder, CUVIDDECODECREATEINFO *pdci);\r
+CUresult CUDAAPI cuvidCreateDecoder(CUvideodecoder *phDecoder, CUVIDDECODECREATEINFO *pdci);\r
 \r
 /**\r
  * \fn CUresult CUDAAPI cuvidDestroyDecoder(CUvideodecoder hDecoder)\r
  * Destroy the decoder object\r
  */\r
-typedef CUresult CUDAAPI tcuvidDestroyDecoder(CUvideodecoder hDecoder);\r
+CUresult CUDAAPI cuvidDestroyDecoder(CUvideodecoder hDecoder);\r
 \r
 /**\r
  * \fn CUresult CUDAAPI cuvidDecodePicture(CUvideodecoder hDecoder, CUVIDPICPARAMS *pPicParams)\r
  * Decode a single picture (field or frame)\r
  */\r
-typedef CUresult CUDAAPI tcuvidDecodePicture(CUvideodecoder hDecoder, CUVIDPICPARAMS *pPicParams);\r
+CUresult CUDAAPI cuvidDecodePicture(CUvideodecoder hDecoder, CUVIDPICPARAMS *pPicParams);\r
 \r
 \r
 #if !defined(__CUVID_DEVPTR64) || defined(__CUVID_INTERNAL)\r
@@ -735,7 +735,7 @@ typedef CUresult CUDAAPI tcuvidDecodePicture(CUvideodecoder hDecoder, CUVIDPICPA
  * \fn CUresult CUDAAPI cuvidMapVideoFrame(CUvideodecoder hDecoder, int nPicIdx, unsigned int *pDevPtr, unsigned int *pPitch, CUVIDPROCPARAMS *pVPP);\r
  * Post-process and map a video frame for use in cuda\r
  */\r
-typedef CUresult CUDAAPI tcuvidMapVideoFrame(CUvideodecoder hDecoder, int nPicIdx,\r
+CUresult CUDAAPI cuvidMapVideoFrame(CUvideodecoder hDecoder, int nPicIdx,\r
                                            unsigned int *pDevPtr, unsigned int *pPitch,\r
                                            CUVIDPROCPARAMS *pVPP);\r
 \r
@@ -743,7 +743,7 @@ typedef CUresult CUDAAPI tcuvidMapVideoFrame(CUvideodecoder hDecoder, int nPicId
  * \fn CUresult CUDAAPI cuvidUnmapVideoFrame(CUvideodecoder hDecoder, unsigned int DevPtr)\r
  * Unmap a previously mapped video frame\r
  */\r
-typedef CUresult CUDAAPI tcuvidUnmapVideoFrame(CUvideodecoder hDecoder, unsigned int DevPtr);\r
+CUresult CUDAAPI cuvidUnmapVideoFrame(CUvideodecoder hDecoder, unsigned int DevPtr);\r
 #endif\r
 \r
 #if defined(WIN64) || defined(_WIN64) || defined(__x86_64) || defined(AMD64) || defined(_M_AMD64)\r
@@ -751,18 +751,18 @@ typedef CUresult CUDAAPI tcuvidUnmapVideoFrame(CUvideodecoder hDecoder, unsigned
  * \fn CUresult CUDAAPI cuvidMapVideoFrame64(CUvideodecoder hDecoder, int nPicIdx, unsigned long long *pDevPtr, unsigned int *pPitch, CUVIDPROCPARAMS *pVPP);\r
  * map a video frame\r
  */\r
-typedef CUresult CUDAAPI tcuvidMapVideoFrame64(CUvideodecoder hDecoder, int nPicIdx, unsigned long long *pDevPtr,\r
+CUresult CUDAAPI cuvidMapVideoFrame64(CUvideodecoder hDecoder, int nPicIdx, unsigned long long *pDevPtr,\r
                                              unsigned int *pPitch, CUVIDPROCPARAMS *pVPP);\r
 \r
 /**\r
  * \fn CUresult CUDAAPI cuvidUnmapVideoFrame64(CUvideodecoder hDecoder, unsigned long long DevPtr);\r
  * Unmap a previously mapped video frame\r
  */\r
-typedef CUresult CUDAAPI tcuvidUnmapVideoFrame64(CUvideodecoder hDecoder, unsigned long long DevPtr);\r
+CUresult CUDAAPI cuvidUnmapVideoFrame64(CUvideodecoder hDecoder, unsigned long long DevPtr);\r
 \r
 #if defined(__CUVID_DEVPTR64) && !defined(__CUVID_INTERNAL)\r
-#define tcuvidMapVideoFrame      tcuvidMapVideoFrame64\r
-#define tcuvidUnmapVideoFrame    tcuvidUnmapVideoFrame64\r
+#define cuvidMapVideoFrame      cuvidMapVideoFrame64\r
+#define cuvidUnmapVideoFrame    cuvidUnmapVideoFrame64\r
 #endif\r
 #endif\r
 \r
@@ -787,26 +787,28 @@ typedef CUresult CUDAAPI tcuvidUnmapVideoFrame64(CUvideodecoder hDecoder, unsign
 /**\r
  * \fn CUresult CUDAAPI cuvidCtxLockCreate(CUvideoctxlock *pLock, CUcontext ctx)\r
  */\r
-typedef CUresult CUDAAPI tcuvidCtxLockCreate(CUvideoctxlock *pLock, CUcontext ctx);\r
+CUresult CUDAAPI cuvidCtxLockCreate(CUvideoctxlock *pLock, CUcontext ctx);\r
 \r
 /**\r
  * \fn CUresult CUDAAPI cuvidCtxLockDestroy(CUvideoctxlock lck)\r
  */\r
-typedef CUresult CUDAAPI tcuvidCtxLockDestroy(CUvideoctxlock lck);\r
+CUresult CUDAAPI cuvidCtxLockDestroy(CUvideoctxlock lck);\r
 \r
 /**\r
  * \fn CUresult CUDAAPI cuvidCtxLock(CUvideoctxlock lck, unsigned int reserved_flags)\r
  */\r
-typedef CUresult CUDAAPI tcuvidCtxLock(CUvideoctxlock lck, unsigned int reserved_flags);\r
+CUresult CUDAAPI cuvidCtxLock(CUvideoctxlock lck, unsigned int reserved_flags);\r
 \r
 /**\r
  * \fn CUresult CUDAAPI cuvidCtxUnlock(CUvideoctxlock lck, unsigned int reserved_flags)\r
  */\r
-typedef CUresult CUDAAPI tcuvidCtxUnlock(CUvideoctxlock lck, unsigned int reserved_flags);\r
+CUresult CUDAAPI cuvidCtxUnlock(CUvideoctxlock lck, unsigned int reserved_flags);\r
 \r
 /** @} */  /* End VIDEO_DECODER */\r
 ////////////////////////////////////////////////////////////////////////////////////////////////\r
 \r
+#if defined(__cplusplus)\r
+\r
 // Auto-lock helper for C++ applications\r
 class CCtxAutoLock\r
 {\r
@@ -817,25 +819,6 @@ public:
     ~CCtxAutoLock();\r
 };\r
 \r
-extern tcuvidCreateDecoder        *cuvidCreateDecoder;\r
-extern tcuvidDestroyDecoder       *cuvidDestroyDecoder;\r
-extern tcuvidDecodePicture        *cuvidDecodePicture;\r
-extern tcuvidMapVideoFrame        *cuvidMapVideoFrame;\r
-extern tcuvidUnmapVideoFrame      *cuvidUnmapVideoFrame;\r
-\r
-#if defined(__x86_64) || defined(AMD64) || defined(_M_AMD64)\r
-extern tcuvidMapVideoFrame64      *cuvidMapVideoFrame64;\r
-extern tcuvidUnmapVideoFrame64    *cuvidUnmapVideoFrame64;\r
-#endif\r
-\r
-//extern tcuvidGetVideoFrameSurface *cuvidGetVideoFrameSurface;\r
-\r
-extern tcuvidCtxLockCreate        *cuvidCtxLockCreate;\r
-extern tcuvidCtxLockDestroy       *cuvidCtxLockDestroy;\r
-extern tcuvidCtxLock              *cuvidCtxLock;\r
-extern tcuvidCtxUnlock            *cuvidCtxUnlock;\r
-\r
-#if defined(__cplusplus)\r
 }\r
 \r
 #endif /* __cplusplus */\r
index 228da53..61d66ce 100644 (file)
@@ -35,7 +35,7 @@
 #if !defined(__NVCUVID_H__)\r
 #define __NVCUVID_H__\r
 \r
-#include "dynlink_cuviddec.h"\r
+#include "compat/cuda/cuviddec.h"\r
 \r
 #if defined(__cplusplus)\r
 extern "C" {\r
@@ -214,43 +214,43 @@ typedef enum {
  * \fn CUresult CUDAAPI cuvidCreateVideoSource(CUvideosource *pObj, const char *pszFileName, CUVIDSOURCEPARAMS *pParams)\r
  * Create Video Source\r
  */\r
-typedef CUresult CUDAAPI tcuvidCreateVideoSource(CUvideosource *pObj, const char *pszFileName, CUVIDSOURCEPARAMS *pParams);\r
+CUresult CUDAAPI cuvidCreateVideoSource(CUvideosource *pObj, const char *pszFileName, CUVIDSOURCEPARAMS *pParams);\r
 \r
 /**\r
  * \fn CUresult CUDAAPI cuvidCreateVideoSourceW(CUvideosource *pObj, const wchar_t *pwszFileName, CUVIDSOURCEPARAMS *pParams)\r
  * Create Video Source\r
  */\r
-typedef CUresult CUDAAPI tcuvidCreateVideoSourceW(CUvideosource *pObj, const wchar_t *pwszFileName, CUVIDSOURCEPARAMS *pParams);\r
+CUresult CUDAAPI cuvidCreateVideoSourceW(CUvideosource *pObj, const wchar_t *pwszFileName, CUVIDSOURCEPARAMS *pParams);\r
 \r
 /**\r
  * \fn CUresult CUDAAPI cuvidDestroyVideoSource(CUvideosource obj)\r
  * Destroy Video Source\r
  */\r
-typedef CUresult CUDAAPI tcuvidDestroyVideoSource(CUvideosource obj);\r
+CUresult CUDAAPI cuvidDestroyVideoSource(CUvideosource obj);\r
 \r
 /**\r
  * \fn CUresult CUDAAPI cuvidSetVideoSourceState(CUvideosource obj, cudaVideoState state)\r
  * Set Video Source state\r
  */\r
-typedef CUresult CUDAAPI tcuvidSetVideoSourceState(CUvideosource obj, cudaVideoState state);\r
+CUresult CUDAAPI cuvidSetVideoSourceState(CUvideosource obj, cudaVideoState state);\r
 \r
 /**\r
  * \fn cudaVideoState CUDAAPI cuvidGetVideoSourceState(CUvideosource obj)\r
  * Get Video Source state\r
  */\r
-typedef cudaVideoState CUDAAPI tcuvidGetVideoSourceState(CUvideosource obj);\r
+cudaVideoState CUDAAPI cuvidGetVideoSourceState(CUvideosource obj);\r
 \r
 /**\r
  * \fn CUresult CUDAAPI cuvidGetSourceVideoFormat(CUvideosource obj, CUVIDEOFORMAT *pvidfmt, unsigned int flags)\r
  * Get Video Source Format\r
  */\r
-typedef CUresult CUDAAPI tcuvidGetSourceVideoFormat(CUvideosource obj, CUVIDEOFORMAT *pvidfmt, unsigned int flags);\r
+CUresult CUDAAPI cuvidGetSourceVideoFormat(CUvideosource obj, CUVIDEOFORMAT *pvidfmt, unsigned int flags);\r
 \r
 /**\r
  * \fn CUresult CUDAAPI cuvidGetSourceAudioFormat(CUvideosource obj, CUAUDIOFORMAT *paudfmt, unsigned int flags)\r
  * Set Video Source state\r
  */\r
-typedef CUresult CUDAAPI tcuvidGetSourceAudioFormat(CUvideosource obj, CUAUDIOFORMAT *paudfmt, unsigned int flags);\r
+CUresult CUDAAPI cuvidGetSourceAudioFormat(CUvideosource obj, CUAUDIOFORMAT *paudfmt, unsigned int flags);\r
 \r
 #endif\r
 \r
@@ -297,29 +297,17 @@ typedef struct _CUVIDPARSERPARAMS
 /**\r
  * \fn CUresult CUDAAPI cuvidCreateVideoParser(CUvideoparser *pObj, CUVIDPARSERPARAMS *pParams)\r
  */\r
-typedef CUresult CUDAAPI tcuvidCreateVideoParser(CUvideoparser *pObj, CUVIDPARSERPARAMS *pParams);\r
+CUresult CUDAAPI cuvidCreateVideoParser(CUvideoparser *pObj, CUVIDPARSERPARAMS *pParams);\r
 \r
 /**\r
  * \fn CUresult CUDAAPI cuvidParseVideoData(CUvideoparser obj, CUVIDSOURCEDATAPACKET *pPacket)\r
  */\r
-typedef CUresult CUDAAPI tcuvidParseVideoData(CUvideoparser obj, CUVIDSOURCEDATAPACKET *pPacket);\r
+CUresult CUDAAPI cuvidParseVideoData(CUvideoparser obj, CUVIDSOURCEDATAPACKET *pPacket);\r
 \r
 /**\r
  * \fn CUresult CUDAAPI cuvidDestroyVideoParser(CUvideoparser obj)\r
  */\r
-typedef CUresult CUDAAPI tcuvidDestroyVideoParser(CUvideoparser obj);\r
-\r
-extern tcuvidCreateVideoSource               *cuvidCreateVideoSource;\r
-extern tcuvidCreateVideoSourceW              *cuvidCreateVideoSourceW;\r
-extern tcuvidDestroyVideoSource              *cuvidDestroyVideoSource;\r
-extern tcuvidSetVideoSourceState             *cuvidSetVideoSourceState;\r
-extern tcuvidGetVideoSourceState             *cuvidGetVideoSourceState;\r
-extern tcuvidGetSourceVideoFormat            *cuvidGetSourceVideoFormat;\r
-extern tcuvidGetSourceAudioFormat            *cuvidGetSourceAudioFormat;\r
-\r
-extern tcuvidCreateVideoParser               *cuvidCreateVideoParser;\r
-extern tcuvidParseVideoData                  *cuvidParseVideoData;\r
-extern tcuvidDestroyVideoParser              *cuvidDestroyVideoParser;\r
+CUresult CUDAAPI cuvidDestroyVideoParser(CUvideoparser obj);\r
 \r
 /** @} */  /* END VIDEO_PARSER */\r
 ////////////////////////////////////////////////////////////////////////////////////////////////\r
index af3fbf4..c0c1c8a 100755 (executable)
--- a/configure
+++ b/configure
@@ -2549,13 +2549,13 @@ videotoolbox_hwaccel_deps="videotoolbox pthreads"
 videotoolbox_hwaccel_extralibs="-framework QuartzCore"
 xvmc_deps="X11_extensions_XvMClib_h"
 
-h263_cuvid_hwaccel_deps="cuda cuvid CUVIDMPEG4PICPARAMS"
+h263_cuvid_hwaccel_deps="cuda cuvid"
 h263_vaapi_hwaccel_deps="vaapi"
 h263_vaapi_hwaccel_select="h263_decoder"
 h263_videotoolbox_hwaccel_deps="videotoolbox"
 h263_videotoolbox_hwaccel_select="h263_decoder"
 h264_crystalhd_decoder_select="crystalhd h264_mp4toannexb_bsf h264_parser"
-h264_cuvid_hwaccel_deps="cuda cuvid CUVIDH264PICPARAMS"
+h264_cuvid_hwaccel_deps="cuda cuvid"
 h264_d3d11va_hwaccel_deps="d3d11va"
 h264_d3d11va_hwaccel_select="h264_decoder"
 h264_dxva2_hwaccel_deps="dxva2"
@@ -2582,7 +2582,7 @@ h264_vdpau_hwaccel_deps="vdpau"
 h264_vdpau_hwaccel_select="h264_decoder"
 h264_videotoolbox_hwaccel_deps="videotoolbox"
 h264_videotoolbox_hwaccel_select="h264_decoder"
-hevc_cuvid_hwaccel_deps="cuda cuvid CUVIDHEVCPICPARAMS"
+hevc_cuvid_hwaccel_deps="cuda cuvid"
 hevc_d3d11va_hwaccel_deps="d3d11va DXVA_PicParams_HEVC"
 hevc_d3d11va_hwaccel_select="hevc_decoder"
 hevc_mediacodec_decoder_deps="mediacodec"
@@ -2595,12 +2595,12 @@ hevc_vaapi_hwaccel_deps="vaapi VAPictureParameterBufferHEVC"
 hevc_vaapi_hwaccel_select="hevc_decoder"
 hevc_vdpau_hwaccel_deps="vdpau VdpPictureInfoHEVC"
 hevc_vdpau_hwaccel_select="hevc_decoder"
-mjpeg_cuvid_hwaccel_deps="cuda cuvid CUVIDJPEGPICPARAMS"
+mjpeg_cuvid_hwaccel_deps="cuda cuvid"
 mpeg_vdpau_decoder_deps="vdpau"
 mpeg_vdpau_decoder_select="mpeg2video_decoder"
 mpeg_xvmc_hwaccel_deps="xvmc"
 mpeg_xvmc_hwaccel_select="mpeg2video_decoder"
-mpeg1_cuvid_hwaccel_deps="cuda cuvid CUVIDMPEG2PICPARAMS"
+mpeg1_cuvid_hwaccel_deps="cuda cuvid"
 mpeg1_vdpau_decoder_deps="vdpau"
 mpeg1_vdpau_decoder_select="mpeg1video_decoder"
 mpeg1_vdpau_hwaccel_deps="vdpau"
@@ -2610,7 +2610,7 @@ mpeg1_videotoolbox_hwaccel_select="mpeg1video_decoder"
 mpeg1_xvmc_hwaccel_deps="xvmc"
 mpeg1_xvmc_hwaccel_select="mpeg1video_decoder"
 mpeg2_crystalhd_decoder_select="crystalhd"
-mpeg2_cuvid_hwaccel_deps="cuda cuvid CUVIDMPEG2PICPARAMS"
+mpeg2_cuvid_hwaccel_deps="cuda cuvid"
 mpeg2_d3d11va_hwaccel_deps="d3d11va"
 mpeg2_d3d11va_hwaccel_select="mpeg2video_decoder"
 mpeg2_dxva2_hwaccel_deps="dxva2"
@@ -2629,7 +2629,7 @@ mpeg2_videotoolbox_hwaccel_select="mpeg2video_decoder"
 mpeg2_xvmc_hwaccel_deps="xvmc"
 mpeg2_xvmc_hwaccel_select="mpeg2video_decoder"
 mpeg4_crystalhd_decoder_select="crystalhd"
-mpeg4_cuvid_hwaccel_deps="cuda cuvid CUVIDMPEG4PICPARAMS"
+mpeg4_cuvid_hwaccel_deps="cuda cuvid"
 mpeg4_mmal_decoder_deps="mmal"
 mpeg4_mmal_decoder_select="mmal"
 mpeg4_mmal_hwaccel_deps="mmal"
@@ -2644,7 +2644,7 @@ mpeg4_videotoolbox_hwaccel_deps="videotoolbox"
 mpeg4_videotoolbox_hwaccel_select="mpeg4_decoder"
 msmpeg4_crystalhd_decoder_select="crystalhd"
 vc1_crystalhd_decoder_select="crystalhd"
-vc1_cuvid_hwaccel_deps="cuda cuvid CUVIDVC1PICPARAMS"
+vc1_cuvid_hwaccel_deps="cuda cuvid"
 vc1_d3d11va_hwaccel_deps="d3d11va"
 vc1_d3d11va_hwaccel_select="vc1_decoder"
 vc1_dxva2_hwaccel_deps="dxva2"
@@ -2660,8 +2660,8 @@ vc1_vdpau_decoder_deps="vdpau"
 vc1_vdpau_decoder_select="vc1_decoder"
 vc1_vdpau_hwaccel_deps="vdpau"
 vc1_vdpau_hwaccel_select="vc1_decoder"
-vp8_cuvid_hwaccel_deps="cuda cuvid CUVIDVP9PICPARAMS"
-vp9_cuvid_hwaccel_deps="cuda cuvid CUVIDVP9PICPARAMS"
+vp8_cuvid_hwaccel_deps="cuda cuvid"
+vp9_cuvid_hwaccel_deps="cuda cuvid"
 vp9_d3d11va_hwaccel_deps="d3d11va DXVA_PicParams_VP9"
 vp9_d3d11va_hwaccel_select="vp9_decoder"
 vp9_dxva2_hwaccel_deps="dxva2 DXVA_PicParams_VP9"
@@ -2687,9 +2687,9 @@ scale_npp_filter_deps="cuda libnpp"
 
 nvenc_deps_any="dlopen LoadLibrary"
 nvenc_encoder_deps="nvenc"
-h263_cuvid_decoder_deps="cuda cuvid CUVIDMPEG4PICPARAMS"
+h263_cuvid_decoder_deps="cuda cuvid"
 h263_cuvid_decoder_select="h263_cuvid_hwaccel"
-h264_cuvid_decoder_deps="cuda cuvid CUVIDH264PICPARAMS"
+h264_cuvid_decoder_deps="cuda cuvid"
 h264_cuvid_decoder_select="h264_mp4toannexb_bsf h264_cuvid_hwaccel"
 h264_nvenc_encoder_deps="nvenc"
 h264_qsv_decoder_deps="libmfx"
@@ -2699,7 +2699,7 @@ h264_qsv_encoder_select="qsvenc"
 h264_vaapi_encoder_deps="VAEncPictureParameterBufferH264"
 h264_vaapi_encoder_select="vaapi_encode golomb"
 
-hevc_cuvid_decoder_deps="cuda cuvid CUVIDHEVCPICPARAMS"
+hevc_cuvid_decoder_deps="cuda cuvid"
 hevc_cuvid_decoder_select="hevc_mp4toannexb_bsf hevc_cuvid_hwaccel"
 hevc_nvenc_encoder_deps="nvenc"
 hevc_qsv_decoder_deps="libmfx"
@@ -2708,26 +2708,26 @@ hevc_qsv_encoder_deps="libmfx"
 hevc_qsv_encoder_select="qsvenc"
 hevc_vaapi_encoder_deps="VAEncPictureParameterBufferHEVC"
 hevc_vaapi_encoder_select="vaapi_encode golomb"
-mjpeg_cuvid_decoder_deps="cuda cuvid CUVIDJPEGPICPARAMS"
+mjpeg_cuvid_decoder_deps="cuda cuvid"
 mjpeg_cuvid_decoder_select="mjpeg_cuvid_hwaccel"
-mpeg1_cuvid_decoder_deps="cuda cuvid CUVIDMPEG2PICPARAMS"
+mpeg1_cuvid_decoder_deps="cuda cuvid"
 mpeg1_cuvid_decoder_select="mpeg1_cuvid_hwaccel"
-mpeg2_cuvid_decoder_deps="cuda cuvid CUVIDMPEG2PICPARAMS"
+mpeg2_cuvid_decoder_deps="cuda cuvid"
 mpeg2_cuvid_decoder_select="mpeg2_cuvid_hwaccel"
 mpeg2_qsv_decoder_deps="libmfx"
 mpeg2_qsv_decoder_select="qsvdec mpeg2_qsv_hwaccel"
 mpeg2_qsv_encoder_deps="libmfx"
 mpeg2_qsv_encoder_select="qsvenc"
-mpeg4_cuvid_decoder_deps="cuda cuvid CUVIDMPEG4PICPARAMS"
+mpeg4_cuvid_decoder_deps="cuda cuvid"
 mpeg4_cuvid_decoder_select="mpeg4_cuvid_hwaccel"
 nvenc_h264_encoder_deps="nvenc"
 nvenc_hevc_encoder_deps="nvenc"
 
-vc1_cuvid_decoder_deps="cuda cuvid CUVIDVC1PICPARAMS"
+vc1_cuvid_decoder_deps="cuda cuvid"
 vc1_cuvid_decoder_select="vc1_cuvid_hwaccel"
-vp8_cuvid_decoder_deps="cuda cuvid CUVIDVP9PICPARAMS"
+vp8_cuvid_decoder_deps="cuda cuvid"
 vp8_cuvid_decoder_select="vp8_cuvid_hwaccel"
-vp9_cuvid_decoder_deps="cuda cuvid CUVIDVP9PICPARAMS"
+vp9_cuvid_decoder_deps="cuda cuvid"
 vp9_cuvid_decoder_select="vp9_cuvid_hwaccel"
 
 # parsers
@@ -5578,14 +5578,6 @@ check_type "va/va.h va/va_enc_jpeg.h" "VAEncPictureParameterBufferJPEG"
 
 check_type "vdpau/vdpau.h" "VdpPictureInfoHEVC"
 
-check_type "cuviddec.h" "CUVIDH264PICPARAMS"
-check_type "cuviddec.h" "CUVIDHEVCPICPARAMS"
-check_type "cuviddec.h" "CUVIDJPEGPICPARAMS"
-check_type "cuviddec.h" "CUVIDMPEG2PICPARAMS"
-check_type "cuviddec.h" "CUVIDMPEG4PICPARAMS"
-check_type "cuviddec.h" "CUVIDVC1PICPARAMS"
-check_type "cuviddec.h" "CUVIDVP9PICPARAMS"
-
 check_cpp_condition windows.h "!WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)" && enable winrt || disable winrt
 
 if ! disabled w32threads && ! enabled pthreads; then
@@ -5663,7 +5655,8 @@ enabled avisynth          && { { check_lib2 "windows.h" LoadLibrary; } ||
                                die "ERROR: LoadLibrary/dlopen not found for avisynth"; }
 enabled cuda              && { check_lib cuda.h cuInit -lcuda ||
                                die "ERROR: CUDA not found"; }
-enabled cuvid             && { check_lib cuviddec.h cuvidCreateDecoder -lnvcuvid ||
+enabled cuvid             && { add_cflags -I$source_path;
+                               check_lib "compat/cuda/cuviddec.h" cuvidCreateDecoder -lnvcuvid ||
                                die "ERROR: CUVID not found"; } &&
                              { enabled cuda ||
                                die "ERROR: CUVID requires CUDA"; }
index db96ac6..2570848 100644 (file)
@@ -30,7 +30,7 @@
 #include "avcodec.h"
 #include "internal.h"
 
-#include <nvcuvid.h>
+#include "compat/cuda/nvcuvid.h"
 
 #define MAX_FRAME_COUNT 25