Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
85db1f97
Commit
85db1f97
authored
Oct 29, 2016
by
Matt Oliver
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avutil/hwcontext_dxva.c: Use new safe dlopen code.
Signed-off-by:
Matt Oliver
<
protogonoi@gmail.com
>
parent
85553b42
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
7 deletions
+8
-7
hwcontext_dxva2.c
libavutil/hwcontext_dxva2.c
+8
-7
No files found.
libavutil/hwcontext_dxva2.c
View file @
85db1f97
...
...
@@ -37,6 +37,7 @@
#include "imgutils.h"
#include "pixdesc.h"
#include "pixfmt.h"
#include "compat/w32dlfcn.h"
typedef
IDirect3D9
*
WINAPI
pDirect3DCreate9
(
UINT
);
typedef
HRESULT
WINAPI
pCreateDeviceManager9
(
UINT
*
,
IDirect3DDeviceManager9
**
);
...
...
@@ -318,10 +319,10 @@ static void dxva2_device_free(AVHWDeviceContext *ctx)
IDirect3D9_Release
(
priv
->
d3d9
);
if
(
priv
->
d3dlib
)
FreeLibrary
(
priv
->
d3dlib
);
dlclose
(
priv
->
d3dlib
);
if
(
priv
->
dxva2lib
)
FreeLibrary
(
priv
->
dxva2lib
);
dlclose
(
priv
->
dxva2lib
);
av_freep
(
&
ctx
->
user_opaque
);
}
...
...
@@ -352,24 +353,24 @@ static int dxva2_device_create(AVHWDeviceContext *ctx, const char *device,
priv
->
device_handle
=
INVALID_HANDLE_VALUE
;
priv
->
d3dlib
=
LoadLibrary
(
"d3d9.dll"
);
priv
->
d3dlib
=
dlopen
(
"d3d9.dll"
,
0
);
if
(
!
priv
->
d3dlib
)
{
av_log
(
ctx
,
AV_LOG_ERROR
,
"Failed to load D3D9 library
\n
"
);
return
AVERROR_UNKNOWN
;
}
priv
->
dxva2lib
=
LoadLibrary
(
"dxva2.dll"
);
priv
->
dxva2lib
=
dlopen
(
"dxva2.dll"
,
0
);
if
(
!
priv
->
dxva2lib
)
{
av_log
(
ctx
,
AV_LOG_ERROR
,
"Failed to load DXVA2 library
\n
"
);
return
AVERROR_UNKNOWN
;
}
createD3D
=
(
pDirect3DCreate9
*
)
GetProcAddress
(
priv
->
d3dlib
,
"Direct3DCreate9"
);
createD3D
=
(
pDirect3DCreate9
*
)
dlsym
(
priv
->
d3dlib
,
"Direct3DCreate9"
);
if
(
!
createD3D
)
{
av_log
(
ctx
,
AV_LOG_ERROR
,
"Failed to locate Direct3DCreate9
\n
"
);
return
AVERROR_UNKNOWN
;
}
createDeviceManager
=
(
pCreateDeviceManager9
*
)
GetProcAddress
(
priv
->
dxva2lib
,
"DXVA2CreateDirect3DDeviceManager9"
);
createDeviceManager
=
(
pCreateDeviceManager9
*
)
dlsym
(
priv
->
dxva2lib
,
"DXVA2CreateDirect3DDeviceManager9"
);
if
(
!
createDeviceManager
)
{
av_log
(
ctx
,
AV_LOG_ERROR
,
"Failed to locate DXVA2CreateDirect3DDeviceManager9
\n
"
);
return
AVERROR_UNKNOWN
;
...
...
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