Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
F
ffmpeg
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
ffmpeg
Commits
1dc483a6
Commit
1dc483a6
authored
Nov 18, 2017
by
Mark Thompson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
compat/cuda: Pass a logging context to load functions
Reviewed-by:
Timo Rothenpieler
<
timo@rothenpieler.org
>
parent
f7d77b41
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
14 additions
and
14 deletions
+14
-14
dynlink_loader.h
compat/cuda/dynlink_loader.h
+9
-9
cuviddec.c
libavcodec/cuviddec.c
+1
-1
nvdec.c
libavcodec/nvdec.c
+1
-1
nvenc.c
libavcodec/nvenc.c
+2
-2
hwcontext_cuda.c
libavutil/hwcontext_cuda.c
+1
-1
No files found.
compat/cuda/dynlink_loader.h
View file @
1dc483a6
...
...
@@ -59,29 +59,29 @@
#define LOAD_LIBRARY(l, path) \
do { \
if (!((l) = dlopen(path, RTLD_LAZY))) { \
av_log(
NULL
, AV_LOG_ERROR, "Cannot load %s\n", path); \
av_log(
logctx
, AV_LOG_ERROR, "Cannot load %s\n", path); \
ret = AVERROR_UNKNOWN; \
goto error; \
} \
av_log(
NULL
, AV_LOG_TRACE, "Loaded lib: %s\n", path); \
av_log(
logctx
, AV_LOG_TRACE, "Loaded lib: %s\n", path); \
} while (0)
#define LOAD_SYMBOL(fun, tp, symbol) \
do { \
if (!((f->fun) = (tp*)dlsym(f->lib, symbol))) { \
av_log(
NULL
, AV_LOG_ERROR, "Cannot load %s\n", symbol); \
av_log(
logctx
, AV_LOG_ERROR, "Cannot load %s\n", symbol); \
ret = AVERROR_UNKNOWN; \
goto error; \
} \
av_log(
NULL
, AV_LOG_TRACE, "Loaded sym: %s\n", symbol); \
av_log(
logctx
, AV_LOG_TRACE, "Loaded sym: %s\n", symbol); \
} while (0)
#define LOAD_SYMBOL_OPT(fun, tp, symbol) \
do { \
if (!((f->fun) = (tp*)dlsym(f->lib, symbol))) { \
av_log(
NULL
, AV_LOG_DEBUG, "Cannot load optional %s\n", symbol); \
av_log(
logctx
, AV_LOG_DEBUG, "Cannot load optional %s\n", symbol); \
} else { \
av_log(
NULL
, AV_LOG_TRACE, "Loaded sym: %s\n", symbol); \
av_log(
logctx
, AV_LOG_TRACE, "Loaded sym: %s\n", symbol); \
} \
} while (0)
...
...
@@ -187,7 +187,7 @@ static inline void nvenc_free_functions(NvencFunctions **functions)
}
#ifdef AV_COMPAT_DYNLINK_CUDA_H
static
inline
int
cuda_load_functions
(
CudaFunctions
**
functions
)
static
inline
int
cuda_load_functions
(
CudaFunctions
**
functions
,
void
*
logctx
)
{
GENERIC_LOAD_FUNC_PREAMBLE
(
CudaFunctions
,
cuda
,
CUDA_LIBNAME
);
...
...
@@ -210,7 +210,7 @@ static inline int cuda_load_functions(CudaFunctions **functions)
}
#endif
static
inline
int
cuvid_load_functions
(
CuvidFunctions
**
functions
)
static
inline
int
cuvid_load_functions
(
CuvidFunctions
**
functions
,
void
*
logctx
)
{
GENERIC_LOAD_FUNC_PREAMBLE
(
CuvidFunctions
,
cuvid
,
NVCUVID_LIBNAME
);
...
...
@@ -244,7 +244,7 @@ static inline int cuvid_load_functions(CuvidFunctions **functions)
GENERIC_LOAD_FUNC_FINALE
(
cuvid
);
}
static
inline
int
nvenc_load_functions
(
NvencFunctions
**
functions
)
static
inline
int
nvenc_load_functions
(
NvencFunctions
**
functions
,
void
*
logctx
)
{
GENERIC_LOAD_FUNC_PREAMBLE
(
NvencFunctions
,
nvenc
,
NVENC_LIBNAME
);
...
...
libavcodec/cuviddec.c
View file @
1dc483a6
...
...
@@ -835,7 +835,7 @@ static av_cold int cuvid_decode_init(AVCodecContext *avctx)
goto
error
;
}
ret
=
cuvid_load_functions
(
&
ctx
->
cvdl
);
ret
=
cuvid_load_functions
(
&
ctx
->
cvdl
,
avctx
);
if
(
ret
<
0
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"Failed loading nvcuvid.
\n
"
);
goto
error
;
...
...
libavcodec/nvdec.c
View file @
1dc483a6
...
...
@@ -176,7 +176,7 @@ static int nvdec_decoder_create(AVBufferRef **out, AVBufferRef *hw_device_ref,
decoder
->
cuda_ctx
=
device_hwctx
->
cuda_ctx
;
decoder
->
cudl
=
device_hwctx
->
internal
->
cuda_dl
;
ret
=
cuvid_load_functions
(
&
decoder
->
cvdl
);
ret
=
cuvid_load_functions
(
&
decoder
->
cvdl
,
logctx
);
if
(
ret
<
0
)
{
av_log
(
logctx
,
AV_LOG_ERROR
,
"Failed loading nvcuvid.
\n
"
);
goto
fail
;
...
...
libavcodec/nvenc.c
View file @
1dc483a6
...
...
@@ -133,11 +133,11 @@ static av_cold int nvenc_load_libraries(AVCodecContext *avctx)
uint32_t
nvenc_max_ver
;
int
ret
;
ret
=
cuda_load_functions
(
&
dl_fn
->
cuda_dl
);
ret
=
cuda_load_functions
(
&
dl_fn
->
cuda_dl
,
avctx
);
if
(
ret
<
0
)
return
ret
;
ret
=
nvenc_load_functions
(
&
dl_fn
->
nvenc_dl
);
ret
=
nvenc_load_functions
(
&
dl_fn
->
nvenc_dl
,
avctx
);
if
(
ret
<
0
)
{
nvenc_print_driver_requirement
(
avctx
,
AV_LOG_ERROR
);
return
ret
;
...
...
libavutil/hwcontext_cuda.c
View file @
1dc483a6
...
...
@@ -336,7 +336,7 @@ static int cuda_device_init(AVHWDeviceContext *ctx)
}
if
(
!
hwctx
->
internal
->
cuda_dl
)
{
ret
=
cuda_load_functions
(
&
hwctx
->
internal
->
cuda_dl
);
ret
=
cuda_load_functions
(
&
hwctx
->
internal
->
cuda_dl
,
ctx
);
if
(
ret
<
0
)
{
av_log
(
ctx
,
AV_LOG_ERROR
,
"Could not dynamically load CUDA
\n
"
);
goto
error
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment