Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Open sidebar
Steve Lhomme
VLC
Commits
8e00a861
Commit
8e00a861
authored
Nov 18, 2017
by
Steve Lhomme
Committed by
Jean-Baptiste Kempf
Nov 20, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3d9_fmt: add D3D9_ReleaseDevice() to match D3D9_CreateDevice()
Signed-off-by:
Jean-Baptiste Kempf
<
jb@videolan.org
>
parent
efa18c59
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
12 deletions
+14
-12
modules/video_chroma/d3d9_fmt.c
modules/video_chroma/d3d9_fmt.c
+9
-0
modules/video_chroma/d3d9_fmt.h
modules/video_chroma/d3d9_fmt.h
+2
-0
modules/video_output/win32/direct3d9.c
modules/video_output/win32/direct3d9.c
+3
-12
No files found.
modules/video_chroma/d3d9_fmt.c
View file @
8e00a861
...
...
@@ -125,6 +125,15 @@ HRESULT D3D9_CreateDevice(vlc_object_t *o, d3d9_handle_t *hd3d, HWND hwnd,
return
hr
;
}
void
D3D9_ReleaseDevice
(
d3d9_device_t
*
d3d_dev
)
{
if
(
d3d_dev
->
dev
)
{
IDirect3DDevice9_Release
(
d3d_dev
->
dev
);
d3d_dev
->
dev
=
NULL
;
}
}
/**
* It setup vout_display_sys_t::d3dpp and vout_display_sys_t::rect_display
* from the default adapter.
...
...
modules/video_chroma/d3d9_fmt.h
View file @
8e00a861
...
...
@@ -76,6 +76,8 @@ HRESULT D3D9_CreateDevice(vlc_object_t *, d3d9_handle_t *, HWND,
const
video_format_t
*
,
d3d9_device_t
*
out
);
#define D3D9_CreateDevice(a,b,c,d,e) D3D9_CreateDevice( VLC_OBJECT(a), b, c, d, e )
void
D3D9_ReleaseDevice
(
d3d9_device_t
*
);
int
D3D9_FillPresentationParameters
(
vlc_object_t
*
,
d3d9_handle_t
*
,
UINT
AdapterToUse
,
HWND
,
const
video_format_t
*
,
d3d9_device_t
*
out
);
...
...
modules/video_output/win32/direct3d9.c
View file @
8e00a861
...
...
@@ -805,15 +805,6 @@ static void Direct3D9Destroy(vlc_object_t *o, struct d3dctx *d3dctx)
static
int
Direct3D9CreateResources
(
vout_display_t
*
,
video_format_t
*
);
static
void
Direct3D9DestroyResources
(
vout_display_t
*
);
static
void
Direct3D9DestroyDevice
(
vlc_object_t
*
o
,
struct
d3dctx
*
d3dctx
)
{
VLC_UNUSED
(
o
);
if
(
d3dctx
->
d3d_dev
.
dev
)
IDirect3DDevice9_Release
(
d3dctx
->
d3d_dev
.
dev
);
d3dctx
->
d3d_dev
.
dev
=
NULL
;
}
/**
* It creates a Direct3D9 device and the associated resources.
*/
...
...
@@ -865,7 +856,7 @@ static int Direct3D9Open(vout_display_t *vd, video_format_t *fmt)
return
VLC_SUCCESS
;
error:
D
irect3D9DestroyDevice
(
VLC_OBJECT
(
vd
),
&
sys
->
d3dctx
);
D
3D9_ReleaseDevice
(
&
sys
->
d3dctx
.
d3d_dev
);
return
VLC_EGENERIC
;
}
...
...
@@ -877,7 +868,7 @@ static void Direct3D9Close(vout_display_t *vd)
vout_display_sys_t
*
sys
=
vd
->
sys
;
Direct3D9DestroyResources
(
vd
);
D
irect3D9DestroyDevice
(
VLC_OBJECT
(
vd
),
&
sys
->
d3dctx
);
D
3D9_ReleaseDevice
(
&
sys
->
d3dctx
.
d3d_dev
);
}
/**
...
...
@@ -1976,7 +1967,7 @@ GLConvClose(vlc_object_t *obj)
if
(
priv
->
dx_render
)
IDirect3DSurface9_Release
(
priv
->
dx_render
);
D
irect3D9Destroy
Device
(
obj
,
&
priv
->
d3dctx
);
D
3D9_Release
Device
(
&
priv
->
d3dctx
.
d3d_dev
);
Direct3D9Destroy
(
obj
,
&
priv
->
d3dctx
);
free
(
tc
->
priv
);
}
...
...
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