Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Open sidebar
Steve Lhomme
VLC
Commits
af9f93f9
Commit
af9f93f9
authored
May 11, 2017
by
Steve Lhomme
Committed by
Jean-Baptiste Kempf
May 12, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3d11_fmt: share the code to release the picture_sys_t data
Signed-off-by:
Jean-Baptiste Kempf
<
jb@videolan.org
>
parent
21c6d05e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
29 deletions
+29
-29
modules/video_chroma/d3d11_fmt.h
modules/video_chroma/d3d11_fmt.h
+26
-0
modules/video_output/win32/direct3d11.c
modules/video_output/win32/direct3d11.c
+3
-29
No files found.
modules/video_chroma/d3d11_fmt.h
View file @
af9f93f9
...
...
@@ -48,4 +48,30 @@ struct picture_sys_t
* (ie not DXGI_FORMAT_UNKNWON) */
#define KNOWN_DXGI_INDEX 0
static
inline
void
ReleasePictureSys
(
picture_sys_t
*
p_sys
)
{
for
(
int
i
=
0
;
i
<
D3D11_MAX_SHADER_VIEW
;
i
++
)
{
if
(
p_sys
->
resourceView
[
i
])
{
ID3D11ShaderResourceView_Release
(
p_sys
->
resourceView
[
i
]);
p_sys
->
resourceView
[
i
]
=
NULL
;
}
if
(
p_sys
->
texture
[
i
])
{
ID3D11Texture2D_Release
(
p_sys
->
texture
[
i
]);
p_sys
->
texture
[
i
]
=
NULL
;
}
}
if
(
p_sys
->
context
)
{
ID3D11DeviceContext_Release
(
p_sys
->
context
);
p_sys
->
context
=
NULL
;
}
if
(
p_sys
->
decoder
)
{
ID3D11VideoDecoderOutputView_Release
(
p_sys
->
decoder
);
p_sys
->
decoder
=
NULL
;
}
if
(
p_sys
->
processorInput
)
{
ID3D11VideoProcessorInputView_Release
(
p_sys
->
processorInput
);
p_sys
->
processorInput
=
NULL
;
}
}
#endif
/* include-guard */
modules/video_output/win32/direct3d11.c
View file @
af9f93f9
...
...
@@ -855,36 +855,10 @@ error:
return
sys
->
sys
.
pool
;
}
static
void
ReleasePictureResources
(
picture_sys_t
*
p_sys
)
{
for
(
int
i
=
0
;
i
<
D3D11_MAX_SHADER_VIEW
;
i
++
)
{
if
(
p_sys
->
resourceView
[
i
])
{
ID3D11ShaderResourceView_Release
(
p_sys
->
resourceView
[
i
]);
p_sys
->
resourceView
[
i
]
=
NULL
;
}
if
(
p_sys
->
texture
[
i
])
{
ID3D11Texture2D_Release
(
p_sys
->
texture
[
i
]);
p_sys
->
texture
[
i
]
=
NULL
;
}
}
if
(
p_sys
->
context
)
{
ID3D11DeviceContext_Release
(
p_sys
->
context
);
p_sys
->
context
=
NULL
;
}
if
(
p_sys
->
decoder
)
{
ID3D11VideoDecoderOutputView_Release
(
p_sys
->
decoder
);
p_sys
->
decoder
=
NULL
;
}
if
(
p_sys
->
processorInput
)
{
ID3D11VideoProcessorInputView_Release
(
p_sys
->
processorInput
);
p_sys
->
processorInput
=
NULL
;
}
}
static
void
DestroyDisplayPoolPicture
(
picture_t
*
picture
)
{
picture_sys_t
*
p_sys
=
picture
->
p_sys
;
ReleasePicture
Resource
s
(
p_sys
);
ReleasePicture
Sy
s
(
p_sys
);
free
(
p_sys
);
free
(
picture
);
}
...
...
@@ -2640,7 +2614,7 @@ static void ReleaseQuad(d3d_quad_t *quad)
ID3D11Buffer_Release
(
quad
->
pVertexShaderConstants
);
quad
->
pVertexShaderConstants
=
NULL
;
}
ReleasePicture
Resource
s
(
&
quad
->
picSys
);
ReleasePicture
Sy
s
(
&
quad
->
picSys
);
}
static
void
Direct3D11DestroyResources
(
vout_display_t
*
vd
)
...
...
@@ -2653,7 +2627,7 @@ static void Direct3D11DestroyResources(vout_display_t *vd)
Direct3D11DeleteRegions
(
sys
->
d3dregion_count
,
sys
->
d3dregions
);
sys
->
d3dregion_count
=
0
;
ReleasePicture
Resource
s
(
&
sys
->
stagingSys
);
ReleasePicture
Sy
s
(
&
sys
->
stagingSys
);
if
(
sys
->
flatVSShader
)
{
...
...
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