Commit 6a9df8ab authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

MSW/Direct3D: retain only picture_sys_t* instead of picture_resource_t

parent 81b4850d
...@@ -146,7 +146,7 @@ struct vout_display_sys_t ...@@ -146,7 +146,7 @@ struct vout_display_sys_t
int d3dregion_count; int d3dregion_count;
struct d3d_region_t *d3dregion; struct d3d_region_t *d3dregion;
picture_resource_t resource; picture_sys_t *picsys;
/* */ /* */
bool reset_device; bool reset_device;
......
...@@ -916,25 +916,25 @@ static int Direct3DCreatePool(vout_display_t *vd, video_format_t *fmt) ...@@ -916,25 +916,25 @@ static int Direct3DCreatePool(vout_display_t *vd, video_format_t *fmt)
IDirect3DDevice9_ColorFill(d3ddev, surface, NULL, D3DCOLOR_ARGB(0xFF, 0, 0, 0)); IDirect3DDevice9_ColorFill(d3ddev, surface, NULL, D3DCOLOR_ARGB(0xFF, 0, 0, 0));
/* Create the associated picture */ /* Create the associated picture */
picture_resource_t *rsc = &sys->resource; picture_sys_t *picsys = malloc(sizeof(*picsys));
rsc->p_sys = malloc(sizeof(*rsc->p_sys)); if (unlikely(picsys == NULL)) {
if (!rsc->p_sys) {
IDirect3DSurface9_Release(surface); IDirect3DSurface9_Release(surface);
return VLC_ENOMEM; return VLC_ENOMEM;
} }
rsc->p_sys->surface = surface; picsys->surface = surface;
rsc->p_sys->fallback = NULL; picsys->fallback = NULL;
for (int i = 0; i < PICTURE_PLANE_MAX; i++) {
rsc->p[i].p_pixels = NULL; picture_resource_t resource = { .p_sys = picsys };
rsc->p[i].i_pitch = 0; for (int i = 0; i < PICTURE_PLANE_MAX; i++)
rsc->p[i].i_lines = fmt->i_height / (i > 0 ? 2 : 1); resource.p[i].i_lines = fmt->i_height / (i > 0 ? 2 : 1);
}
picture_t *picture = picture_NewFromResource(fmt, rsc); picture_t *picture = picture_NewFromResource(fmt, &resource);
if (!picture) { if (!picture) {
IDirect3DSurface9_Release(surface); IDirect3DSurface9_Release(surface);
free(rsc->p_sys); free(picsys);
return VLC_ENOMEM; return VLC_ENOMEM;
} }
sys->picsys = picsys;
/* Wrap it into a picture pool */ /* Wrap it into a picture pool */
picture_pool_configuration_t pool_cfg; picture_pool_configuration_t pool_cfg;
...@@ -960,10 +960,10 @@ static void Direct3DDestroyPool(vout_display_t *vd) ...@@ -960,10 +960,10 @@ static void Direct3DDestroyPool(vout_display_t *vd)
vout_display_sys_t *sys = vd->sys; vout_display_sys_t *sys = vd->sys;
if (sys->pool) { if (sys->pool) {
picture_resource_t *rsc = &sys->resource; picture_sys_t *picsys = sys->picsys;
IDirect3DSurface9_Release(rsc->p_sys->surface); IDirect3DSurface9_Release(picsys->surface);
if (rsc->p_sys->fallback) if (picsys->fallback)
picture_Release(rsc->p_sys->fallback); picture_Release(picsys->fallback);
picture_pool_Delete(sys->pool); picture_pool_Delete(sys->pool);
} }
sys->pool = NULL; sys->pool = NULL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment