vlc/vlc-3.0 | branch: master | Steve Lhomme <[email protected]> | Wed Feb 21 14:03:44 2018 +0100| [d0a7aee4ddbf38ecfc4f88aa137589fdf6867efe] | committer: Steve Lhomme
d3d11_fmt: simplify AllocateTextures() calls (cherry picked from commit fdcd44202a89352f080def8723f14b041e277030) > http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=d0a7aee4ddbf38ecfc4f88aa137589fdf6867efe --- modules/hw/d3d11/d3d11_deinterlace.c | 2 +- modules/video_chroma/d3d11_fmt.c | 1 + modules/video_chroma/d3d11_fmt.h | 6 +++--- modules/video_output/win32/direct3d11.c | 6 +++--- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/modules/hw/d3d11/d3d11_deinterlace.c b/modules/hw/d3d11/d3d11_deinterlace.c index 3c4a992c7c..71482648b8 100644 --- a/modules/hw/d3d11/d3d11_deinterlace.c +++ b/modules/hw/d3d11/d3d11_deinterlace.c @@ -306,7 +306,7 @@ static picture_t *NewOutputPicture( filter_t *p_filter ) video_format_t fmt = p_filter->fmt_out.video; fmt.i_width = dstDesc.Width; fmt.i_height = dstDesc.Height; - if (AllocateTextures(VLC_OBJECT(p_filter), &p_filter->p_sys->d3d_dev, cfg, + if (AllocateTextures(p_filter, &p_filter->p_sys->d3d_dev, cfg, &fmt, 1, pic->p_sys->texture) != VLC_SUCCESS) { free(pic->p_sys); diff --git a/modules/video_chroma/d3d11_fmt.c b/modules/video_chroma/d3d11_fmt.c index f43407a075..7a728f9dfb 100644 --- a/modules/video_chroma/d3d11_fmt.c +++ b/modules/video_chroma/d3d11_fmt.c @@ -531,6 +531,7 @@ const d3d_format_t *FindD3D11Format(vlc_object_t *o, return NULL; } +#undef AllocateTextures int AllocateTextures( vlc_object_t *obj, d3d11_device_t *d3d_dev, const d3d_format_t *cfg, const video_format_t *fmt, unsigned pool_size, ID3D11Texture2D *textures[] ) diff --git a/modules/video_chroma/d3d11_fmt.h b/modules/video_chroma/d3d11_fmt.h index ce1fd8231c..49ac0313b1 100644 --- a/modules/video_chroma/d3d11_fmt.h +++ b/modules/video_chroma/d3d11_fmt.h @@ -136,9 +136,9 @@ const d3d_format_t *FindD3D11Format(vlc_object_t *, UINT supportFlags); #define FindD3D11Format(a,b,c,d,e,f,g) FindD3D11Format(VLC_OBJECT(a),b,c,d,e,f,g) -int AllocateTextures(vlc_object_t *obj, d3d11_device_t *d3d_dev, - const d3d_format_t *cfg, const video_format_t *fmt, - unsigned pool_size, ID3D11Texture2D *textures[]); +int AllocateTextures(vlc_object_t *, d3d11_device_t *, const d3d_format_t *, + const video_format_t *, unsigned pool_size, ID3D11Texture2D *textures[]); +#define AllocateTextures(a,b,c,d,e,f) AllocateTextures(VLC_OBJECT(a),b,c,d,e,f) #ifndef NDEBUG void D3D11_LogProcessorSupport(vlc_object_t*, ID3D11VideoProcessorEnumerator*); diff --git a/modules/video_output/win32/direct3d11.c b/modules/video_output/win32/direct3d11.c index 68f630c5d6..348d84fff3 100644 --- a/modules/video_output/win32/direct3d11.c +++ b/modules/video_output/win32/direct3d11.c @@ -388,7 +388,7 @@ static picture_pool_t *Pool(vout_display_t *vd, unsigned pool_size) /* only provide enough for the filters, we can still do direct rendering */ slices = __MIN(slices, 6); - if (AllocateTextures(VLC_OBJECT(vd), &sys->d3d_dev, sys->picQuad.formatInfo, &surface_fmt, slices, textures)) + if (AllocateTextures(vd, &sys->d3d_dev, sys->picQuad.formatInfo, &surface_fmt, slices, textures)) goto error; pictures = calloc(pool_size, sizeof(*pictures)); @@ -1483,7 +1483,7 @@ static int Direct3D11CreateFormatResources(vout_display_t *vd, const video_forma surface_fmt.i_width = sys->picQuad.i_width; surface_fmt.i_height = sys->picQuad.i_height; - if (AllocateTextures(VLC_OBJECT(vd), &sys->d3d_dev, sys->picQuad.formatInfo, &surface_fmt, 1, textures)) + if (AllocateTextures(vd, &sys->d3d_dev, sys->picQuad.formatInfo, &surface_fmt, 1, textures)) { msg_Err(vd, "Failed to allocate the staging texture"); return VLC_EGENERIC; @@ -1785,7 +1785,7 @@ static int Direct3D11MapSubpicture(vout_display_t *vd, int *subpicture_region_co if (unlikely(d3dquad==NULL)) { continue; } - if (AllocateTextures(VLC_OBJECT(vd), &sys->d3d_dev, sys->d3dregion_format, &r->p_picture->format, 1, d3dquad->picSys.texture)) { + if (AllocateTextures(vd, &sys->d3d_dev, sys->d3dregion_format, &r->p_picture->format, 1, d3dquad->picSys.texture)) { msg_Err(vd, "Failed to allocate %dx%d texture for OSD", r->fmt.i_visible_width, r->fmt.i_visible_height); for (int j=0; j<D3D11_MAX_SHADER_VIEW; j++) _______________________________________________ vlc-commits mailing list [email protected] https://mailman.videolan.org/listinfo/vlc-commits
