diff options
author | Timo Rothenpieler <timo@rothenpieler.org> | 2019-02-08 22:47:01 +0100 |
---|---|---|
committer | Timo Rothenpieler <timo@rothenpieler.org> | 2019-02-14 13:21:07 +0100 |
commit | 15c6390139096b7e7634bf0f6aaab1cd8b3aa509 (patch) | |
tree | eec1fdcb718d28e0a526aab37b27bdf3aac293f7 /libavutil | |
parent | dbfd042983eed8586d4048795c00af820f5b6b1f (diff) | |
download | ffmpeg-15c6390139096b7e7634bf0f6aaab1cd8b3aa509.tar.gz |
avutil/cuda_check: avoid pointlessly exporting same symbol from two libraries
Diffstat (limited to 'libavutil')
-rw-r--r-- | libavutil/Makefile | 2 | ||||
-rw-r--r-- | libavutil/cuda_check.c | 45 | ||||
-rw-r--r-- | libavutil/cuda_check.h | 24 |
3 files changed, 22 insertions, 49 deletions
diff --git a/libavutil/Makefile b/libavutil/Makefile index 7dcb92b06b..53208fc587 100644 --- a/libavutil/Makefile +++ b/libavutil/Makefile @@ -160,7 +160,7 @@ OBJS = adler32.o \ xtea.o \ tea.o \ -OBJS-$(CONFIG_CUDA) += hwcontext_cuda.o cuda_check.o +OBJS-$(CONFIG_CUDA) += hwcontext_cuda.o OBJS-$(CONFIG_D3D11VA) += hwcontext_d3d11va.o OBJS-$(CONFIG_DXVA2) += hwcontext_dxva2.o OBJS-$(CONFIG_LIBDRM) += hwcontext_drm.o diff --git a/libavutil/cuda_check.c b/libavutil/cuda_check.c deleted file mode 100644 index 95c0256d12..0000000000 --- a/libavutil/cuda_check.c +++ /dev/null @@ -1,45 +0,0 @@ -/* - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "compat/cuda/dynlink_loader.h" -#include "libavutil/cuda_check.h" - -int ff_cuda_check(void *avctx, - void *cuGetErrorName_fn, - void *cuGetErrorString_fn, - CUresult err, const char *func) -{ - const char *err_name; - const char *err_string; - - av_log(avctx, AV_LOG_TRACE, "Calling %s\n", func); - - if (err == CUDA_SUCCESS) - return 0; - - ((tcuGetErrorName *)cuGetErrorName_fn)(err, &err_name); - ((tcuGetErrorString *)cuGetErrorString_fn)(err, &err_string); - - av_log(avctx, AV_LOG_ERROR, "%s failed", func); - if (err_name && err_string) - av_log(avctx, AV_LOG_ERROR, " -> %s: %s", err_name, err_string); - av_log(avctx, AV_LOG_ERROR, "\n"); - - return AVERROR_EXTERNAL; -} - diff --git a/libavutil/cuda_check.h b/libavutil/cuda_check.h index b8e5f65cbb..ec1705b000 100644 --- a/libavutil/cuda_check.h +++ b/libavutil/cuda_check.h @@ -23,10 +23,28 @@ /** * Wrap a CUDA function call and print error information if it fails. */ +static inline int ff_cuda_check(void *avctx, + void *cuGetErrorName_fn, void *cuGetErrorString_fn, + CUresult err, const char *func) +{ + const char *err_name; + const char *err_string; -int ff_cuda_check(void *avctx, - void *cuGetErrorName_fn, void *cuGetErrorString_fn, - CUresult err, const char *func); + av_log(avctx, AV_LOG_TRACE, "Calling %s\n", func); + + if (err == CUDA_SUCCESS) + return 0; + + ((tcuGetErrorName *)cuGetErrorName_fn)(err, &err_name); + ((tcuGetErrorString *)cuGetErrorString_fn)(err, &err_string); + + av_log(avctx, AV_LOG_ERROR, "%s failed", func); + if (err_name && err_string) + av_log(avctx, AV_LOG_ERROR, " -> %s: %s", err_name, err_string); + av_log(avctx, AV_LOG_ERROR, "\n"); + + return AVERROR_EXTERNAL; +} /** * Convenience wrapper for ff_cuda_check when directly linking libcuda. |