Commit 43009bda authored by Steve Lhomme's avatar Steve Lhomme

directx_va: don't keep the directx_sys_t structure

It's only used for some callbacks on start.
parent 5a9906ea
......@@ -97,7 +97,6 @@ DEFINE_GUID(DXVA2_NoEncrypt, 0x1b81bed0, 0xa0c7, 0x11d3,
struct vlc_va_sys_t
{
directx_sys_t dx_sys;
UINT totalTextureSlices;
unsigned textureWidth;
unsigned textureHeight;
......@@ -307,7 +306,6 @@ static int Open(vlc_va_t *va, AVCodecContext *ctx, enum PixelFormat pix_fmt,
const es_format_t *fmt, void *picsys)
{
int err = VLC_EGENERIC;
directx_sys_t *dx_sys;
ctx->hwaccel_context = NULL;
......@@ -335,11 +333,6 @@ static int Open(vlc_va_t *va, AVCodecContext *ctx, enum PixelFormat pix_fmt,
if (err != VLC_SUCCESS)
goto error;
dx_sys = &sys->dx_sys;
dx_sys->pf_get_input_list = DxGetInputList;
dx_sys->pf_setup_output = DxSetupOutput;
va->sys = sys;
sys->d3d_dev.d3ddevice = NULL;
......@@ -389,7 +382,8 @@ static int Open(vlc_va_t *va, AVCodecContext *ctx, enum PixelFormat pix_fmt,
goto error;
video_format_t fmt_out;
err = directx_va_Setup(va, &sys->dx_sys, ctx, fmt, isXboxHardware(sys->d3d_dev.d3ddevice), &fmt_out, &sys->hw.surface_count, &sys->decoder_guid);
static const directx_sys_t dx_sys = { DxGetInputList, DxSetupOutput };
err = directx_va_Setup(va, &dx_sys, ctx, fmt, isXboxHardware(sys->d3d_dev.d3ddevice), &fmt_out, &sys->hw.surface_count, &sys->decoder_guid);
if (err != VLC_SUCCESS)
goto error;
......
......@@ -263,7 +263,7 @@ static const directx_va_mode_t DXVA_MODES[] = {
{ NULL, NULL, 0, NULL }
};
static int FindVideoServiceConversion(vlc_va_t *, directx_sys_t *, const es_format_t *, const AVCodecContext *, GUID *found_guid);
static int FindVideoServiceConversion(vlc_va_t *, const directx_sys_t *, const es_format_t *, const AVCodecContext *, GUID *found_guid);
char *directx_va_GetDecoderName(const GUID *guid)
{
......@@ -279,7 +279,7 @@ char *directx_va_GetDecoderName(const GUID *guid)
}
/* */
int directx_va_Setup(vlc_va_t *va, directx_sys_t *dx_sys, const AVCodecContext *avctx,
int directx_va_Setup(vlc_va_t *va, const directx_sys_t *dx_sys, const AVCodecContext *avctx,
const es_format_t *fmt, int flag_xbox,
video_format_t *fmt_out, unsigned *surfaces, GUID *found_guid)
{
......@@ -387,7 +387,7 @@ static bool profile_supported(const directx_va_mode_t *mode, const es_format_t *
/**
* Find the best suited decoder mode GUID and render format.
*/
static int FindVideoServiceConversion(vlc_va_t *va, directx_sys_t *dx_sys,
static int FindVideoServiceConversion(vlc_va_t *va, const directx_sys_t *dx_sys,
const es_format_t *fmt, const AVCodecContext *avctx,
GUID *found_guid)
{
......
......@@ -64,7 +64,7 @@ typedef struct
} directx_sys_t;
int directx_va_Setup(vlc_va_t *, directx_sys_t *, const AVCodecContext *avctx, const es_format_t *, int flag_xbox,
int directx_va_Setup(vlc_va_t *, const directx_sys_t *, const AVCodecContext *avctx, const es_format_t *, int flag_xbox,
video_format_t *fmt_out, unsigned *surface_count, GUID *found_guid);
char *directx_va_GetDecoderName(const GUID *guid);
bool directx_va_canUseDecoder(vlc_va_t *, UINT VendorId, UINT DeviceId, const GUID *pCodec, UINT driverBuild);
......
......@@ -106,8 +106,6 @@ static const d3d9_format_t *D3dFindFormat(D3DFORMAT format)
struct vlc_va_sys_t
{
directx_sys_t dx_sys;
/* Direct3D */
d3d9_handle_t hd3d;
d3d9_device_t d3d_dev;
......@@ -249,7 +247,6 @@ static int Open(vlc_va_t *va, AVCodecContext *ctx, enum PixelFormat pix_fmt,
const es_format_t *fmt, void *picsys)
{
int err = VLC_EGENERIC;
directx_sys_t *dx_sys;
if (pix_fmt != AV_PIX_FMT_DXVA2_VLD)
return VLC_EGENERIC;
......@@ -295,8 +292,6 @@ static int Open(vlc_va_t *va, AVCodecContext *ctx, enum PixelFormat pix_fmt,
return VLC_EGENERIC;
}
dx_sys = &sys->dx_sys;
static const struct va_pool_cfg pool_cfg = {
D3dCreateDevice,
D3dDestroyDevice,
......@@ -306,9 +301,6 @@ static int Open(vlc_va_t *va, AVCodecContext *ctx, enum PixelFormat pix_fmt,
NewSurfacePicContext,
};
dx_sys->pf_get_input_list = DxGetInputList;
dx_sys->pf_setup_output = DxSetupOutput;
va->sys = sys;
err = va_pool_Open(va, &pool_cfg, &sys->va_pool);
......@@ -316,7 +308,8 @@ static int Open(vlc_va_t *va, AVCodecContext *ctx, enum PixelFormat pix_fmt,
goto error;
video_format_t fmt_out;
err = directx_va_Setup(va, &sys->dx_sys, ctx, fmt, 0, &fmt_out, &sys->hw.surface_count, &sys->decoder_guid);
static const directx_sys_t dx_sys = { DxGetInputList, DxSetupOutput };
err = directx_va_Setup(va, &dx_sys, ctx, fmt, 0, &fmt_out, &sys->hw.surface_count, &sys->decoder_guid);
if (err != VLC_SUCCESS)
goto error;
......
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