]> git.sesse.net Git - ffmpeg/blobdiff - libavutil/cuda_check.h
avcodec/avcodec: Use avcodec_close() on avcodec_open2() failure
[ffmpeg] / libavutil / cuda_check.h
index ec1705b000b1875095c9b571398f6fcade47c06c..3aea085c07378ed8433743338752dfaebfcf234c 100644 (file)
 #ifndef AVUTIL_CUDA_CHECK_H
 #define AVUTIL_CUDA_CHECK_H
 
+#include "compat/cuda/dynlink_loader.h"
+
+typedef CUresult CUDAAPI cuda_check_GetErrorName(CUresult error, const char** pstr);
+typedef CUresult CUDAAPI cuda_check_GetErrorString(CUresult error, const char** pstr);
+
 /**
  * Wrap a CUDA function call and print error information if it fails.
  */
@@ -35,8 +40,8 @@ static inline int ff_cuda_check(void *avctx,
     if (err == CUDA_SUCCESS)
         return 0;
 
-    ((tcuGetErrorName *)cuGetErrorName_fn)(err, &err_name);
-    ((tcuGetErrorString *)cuGetErrorString_fn)(err, &err_string);
+    ((cuda_check_GetErrorName *)cuGetErrorName_fn)(err, &err_name);
+    ((cuda_check_GetErrorString *)cuGetErrorString_fn)(err, &err_string);
 
     av_log(avctx, AV_LOG_ERROR, "%s failed", func);
     if (err_name && err_string)