[vlc-commits] direct3d11: use a local video_format_t to match the incoming texture
Steve Lhomme
git at videolan.org
Wed Jul 15 16:44:46 CEST 2020
vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Wed Jul 15 16:39:14 2020 +0200| [9ac34b89626823aad7ac2542dc145adea5cf24ee] | committer: Steve Lhomme
direct3d11: use a local video_format_t to match the incoming texture
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=9ac34b89626823aad7ac2542dc145adea5cf24ee
---
modules/video_output/win32/direct3d11.c | 16 +++++++++-------
1 file changed, 9 insertions(+), 7 deletions(-)
diff --git a/modules/video_output/win32/direct3d11.c b/modules/video_output/win32/direct3d11.c
index e302b3b521..af02d3f571 100644
--- a/modules/video_output/win32/direct3d11.c
+++ b/modules/video_output/win32/direct3d11.c
@@ -89,6 +89,7 @@ struct vout_display_sys_t
{
vout_display_sys_win32_t sys; /* only use if sys.event is not NULL */
display_win32_area_t area;
+ video_format_t texture_fmt;
/* Sensors */
void *p_sensors;
@@ -297,6 +298,7 @@ static int Open(vout_display_t *vd, const vout_display_cfg_t *cfg,
goto error;
CommonInit(vd, &sys->area, cfg);
+ sys->texture_fmt = vd->source;
sys->outside_opaque = var_InheritAddress( vd, "vout-cb-opaque" );
sys->updateOutputCb = var_InheritAddress( vd, "vout-cb-update-output" );
@@ -614,8 +616,8 @@ static void PreparePicture(vout_display_t *vd, picture_t *picture, subpicture_t
{
/* the decoder produced different sizes than the vout, we need to
* adjust the vertex */
- sys->area.texture_source.i_width = sys->picQuad.i_height = texDesc.Height;
- sys->area.texture_source.i_height = sys->picQuad.i_width = texDesc.Width;
+ sys->texture_fmt.i_width = sys->picQuad.i_height = texDesc.Height;
+ sys->texture_fmt.i_height = sys->picQuad.i_width = texDesc.Width;
CommonPlacePicture(VLC_OBJECT(vd), &sys->area, &sys->sys);
UpdateSize(vd);
@@ -820,8 +822,8 @@ static int Direct3D11Open(vout_display_t *vd, video_format_t *fmtp, vlc_video_co
sys->picQuad.i_height = (sys->picQuad.i_height + 0x01) & ~0x01;
}
- sys->area.texture_source.i_width = sys->picQuad.i_width;
- sys->area.texture_source.i_height = sys->picQuad.i_height;
+ sys->texture_fmt.i_width = sys->picQuad.i_width;
+ sys->texture_fmt.i_height = sys->picQuad.i_height;
CommonPlacePicture(VLC_OBJECT(vd), &sys->area, &sys->sys);
@@ -1092,7 +1094,7 @@ static int Direct3D11CreateFormatResources(vout_display_t *vd, const video_forma
.top = vd->source.i_y_offset,
.bottom = vd->source.i_y_offset + vd->source.i_visible_height,
};
- if (D3D11_SetupQuad( vd, sys->d3d_dev, &sys->area.texture_source, &sys->picQuad, &sys->display,
+ if (D3D11_SetupQuad( vd, sys->d3d_dev, &sys->texture_fmt, &sys->picQuad, &sys->display,
&source_rect,
vd->source.orientation ) != VLC_SUCCESS) {
msg_Err(vd, "Could not Create the main quad picture.");
@@ -1118,9 +1120,9 @@ static int Direct3D11CreateFormatResources(vout_display_t *vd, const video_forma
/* we need a staging texture */
ID3D11Texture2D *textures[D3D11_MAX_SHADER_VIEW] = {0};
if (!is_d3d11_opaque(fmt->i_chroma))
- sys->area.texture_source.i_chroma = sys->picQuad.textureFormat->fourcc;
+ sys->texture_fmt.i_chroma = sys->picQuad.textureFormat->fourcc;
- if (AllocateTextures(vd, sys->d3d_dev, sys->picQuad.textureFormat, &sys->area.texture_source, 1, textures, sys->stagingPlanes))
+ if (AllocateTextures(vd, sys->d3d_dev, sys->picQuad.textureFormat, &sys->texture_fmt, 1, textures, sys->stagingPlanes))
{
msg_Err(vd, "Failed to allocate the staging texture");
return VLC_EGENERIC;
More information about the vlc-commits
mailing list