Commit 85fd3054 authored by Steve Lhomme's avatar Steve Lhomme Committed by Jean-Baptiste Kempf

d3d11_fmt: add a helper function to find the actual picture_sys_t to use

the decoder and filters fill context but the vout uses picture_sys_t by default
Signed-off-by: Jean-Baptiste Kempf's avatarJean-Baptiste Kempf <jb@videolan.org>
parent bf34e5ab
......@@ -50,6 +50,12 @@ struct picture_sys_t
#include "../codec/avcodec/va_surface.h"
static inline picture_sys_t *ActivePictureSys(picture_t *p_pic)
{
struct va_pic_context *pic_ctx = (struct va_pic_context*)p_pic->context;
return pic_ctx ? &pic_ctx->picsys : p_pic->p_sys;
}
/* index to use for texture/resource that use a known DXGI format
* (ie not DXGI_FORMAT_UNKNWON) */
#define KNOWN_DXGI_INDEX 0
......
......@@ -1112,8 +1112,7 @@ static void Prepare(vout_display_t *vd, picture_t *picture, subpicture_t *subpic
if( sys->context_lock != INVALID_HANDLE_VALUE )
WaitForSingleObjectEx( sys->context_lock, INFINITE, FALSE );
#endif
struct va_pic_context *pic_ctx = (struct va_pic_context*)picture->context;
picture_sys_t *p_sys = pic_ctx ? &pic_ctx->picsys : picture->p_sys;
picture_sys_t *p_sys = ActivePictureSys(picture);
if (!is_d3d11_opaque(picture->format.i_chroma) || sys->legacy_shader) {
D3D11_TEXTURE2D_DESC texDesc;
if (!is_d3d11_opaque(picture->format.i_chroma))
......@@ -1208,8 +1207,7 @@ static void Display(vout_display_t *vd, picture_t *picture, subpicture_t *subpic
if (!is_d3d11_opaque(picture->format.i_chroma) || sys->legacy_shader)
DisplayD3DPicture(sys, &sys->picQuad, sys->stagingSys.resourceView);
else {
struct va_pic_context *pic_ctx = (struct va_pic_context*)picture->context;
picture_sys_t *p_sys = pic_ctx ? &pic_ctx->picsys : picture->p_sys;
picture_sys_t *p_sys = ActivePictureSys(picture);
DisplayD3DPicture(sys, &sys->picQuad, p_sys->resourceView);
}
......
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