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

dxva: move initialization from setup to open

parent 978dedc5
...@@ -147,10 +147,7 @@ static picture_t *DxAllocPicture(vlc_va_t *, const video_format_t *, unsigned in ...@@ -147,10 +147,7 @@ static picture_t *DxAllocPicture(vlc_va_t *, const video_format_t *, unsigned in
static int Setup(vlc_va_t *va, AVCodecContext *avctx, vlc_fourcc_t *chroma) static int Setup(vlc_va_t *va, AVCodecContext *avctx, vlc_fourcc_t *chroma)
{ {
vlc_va_sys_t *sys = va->sys; vlc_va_sys_t *sys = va->sys;
if (directx_va_Setup(va, &sys->dx_sys, avctx)!=VLC_SUCCESS)
return VLC_EGENERIC;
avctx->hwaccel_context = &sys->hw;
*chroma = sys->filter == NULL ? VLC_CODEC_D3D11_OPAQUE : VLC_CODEC_YV12; *chroma = sys->filter == NULL ? VLC_CODEC_D3D11_OPAQUE : VLC_CODEC_YV12;
return VLC_SUCCESS; return VLC_SUCCESS;
...@@ -361,6 +358,12 @@ static int Open(vlc_va_t *va, AVCodecContext *ctx, enum PixelFormat pix_fmt, ...@@ -361,6 +358,12 @@ static int Open(vlc_va_t *va, AVCodecContext *ctx, enum PixelFormat pix_fmt,
goto error; goto error;
} }
err = directx_va_Setup(va, &sys->dx_sys, ctx);
if (err != VLC_SUCCESS)
goto error;
ctx->hwaccel_context = &sys->hw;
/* TODO print the hardware name/vendor for debugging purposes */ /* TODO print the hardware name/vendor for debugging purposes */
va->description = DxDescribe(dx_sys); va->description = DxDescribe(dx_sys);
va->setup = Setup; va->setup = Setup;
......
...@@ -207,10 +207,7 @@ static filter_t *CreateFilter( vlc_object_t *p_this, const es_format_t *p_fmt_in ...@@ -207,10 +207,7 @@ static filter_t *CreateFilter( vlc_object_t *p_this, const es_format_t *p_fmt_in
static int Setup(vlc_va_t *va, AVCodecContext *avctx, vlc_fourcc_t *chroma) static int Setup(vlc_va_t *va, AVCodecContext *avctx, vlc_fourcc_t *chroma)
{ {
vlc_va_sys_t *sys = va->sys; vlc_va_sys_t *sys = va->sys;
if (directx_va_Setup(va, &sys->dx_sys, avctx)!=VLC_SUCCESS)
return VLC_EGENERIC;
avctx->hwaccel_context = &sys->hw;
*chroma = sys->filter == NULL ? VLC_CODEC_D3D9_OPAQUE : VLC_CODEC_YV12; *chroma = sys->filter == NULL ? VLC_CODEC_D3D9_OPAQUE : VLC_CODEC_YV12;
return VLC_SUCCESS; return VLC_SUCCESS;
...@@ -368,6 +365,12 @@ static int Open(vlc_va_t *va, AVCodecContext *ctx, enum PixelFormat pix_fmt, ...@@ -368,6 +365,12 @@ static int Open(vlc_va_t *va, AVCodecContext *ctx, enum PixelFormat pix_fmt,
goto error; goto error;
} }
err = directx_va_Setup(va, &sys->dx_sys, ctx);
if (err != VLC_SUCCESS)
goto error;
ctx->hwaccel_context = &sys->hw;
/* TODO print the hardware name/vendor for debugging purposes */ /* TODO print the hardware name/vendor for debugging purposes */
va->description = DxDescribe(sys); va->description = DxDescribe(sys);
va->setup = Setup; va->setup = Setup;
......
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