Skip to content

Commit

Permalink
va: remove the deprecated setup() callback
Browse files Browse the repository at this point in the history
Both DXVA2 and D3D11VA now only return opaque formats that are matching
vlc_va_GetChroma()

Signed-off-by: Jean-Baptiste Kempf <[email protected]>
  • Loading branch information
robUx4 authored and jbkempf committed Jun 22, 2017
1 parent 9c2a8de commit 7714193
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 62 deletions.
21 changes: 0 additions & 21 deletions modules/codec/avcodec/d3d11va.c
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ DEFINE_GUID(DXVA2_NoEncrypt, 0x1b81bed0, 0xa0c7, 0x11d3,
struct vlc_va_sys_t
{
directx_sys_t dx_sys;
vlc_fourcc_t i_chroma;
UINT totalTextureSlices;

#if !defined(NDEBUG) && defined(HAVE_DXGIDEBUG_H)
Expand Down Expand Up @@ -151,12 +150,6 @@ static int DxCreateDecoderSurfaces(vlc_va_t *, int codec_id,
static void DxDestroySurfaces(vlc_va_t *);
static void SetupAVCodecContext(vlc_va_t *);

/* */
static void Setup(vlc_va_t *va, vlc_fourcc_t *chroma)
{
*chroma = va->sys->i_chroma;
}

void SetupAVCodecContext(vlc_va_t *va)
{
vlc_va_sys_t *sys = va->sys;
Expand Down Expand Up @@ -323,17 +316,6 @@ static void Close(vlc_va_t *va, void **ctx)
free(sys);
}

static vlc_fourcc_t d3d11va_fourcc(enum PixelFormat swfmt)
{
switch (swfmt)
{
case AV_PIX_FMT_YUV420P10LE:
return VLC_CODEC_D3D11_OPAQUE_10B;
default:
return VLC_CODEC_D3D11_OPAQUE;
}
}

static int Open(vlc_va_t *va, AVCodecContext *ctx, enum PixelFormat pix_fmt,
const es_format_t *fmt, picture_sys_t *p_sys)
{
Expand Down Expand Up @@ -396,8 +378,6 @@ static int Open(vlc_va_t *va, AVCodecContext *ctx, enum PixelFormat pix_fmt,
}
}

sys->i_chroma = d3d11va_fourcc(ctx->sw_pix_fmt);

#if VLC_WINSTORE_APP
err = directx_va_Open(va, &sys->dx_sys, false);
#else
Expand All @@ -414,7 +394,6 @@ static int Open(vlc_va_t *va, AVCodecContext *ctx, enum PixelFormat pix_fmt,

/* TODO print the hardware name/vendor for debugging purposes */
va->description = DxDescribe(dx_sys);
va->setup = Setup;
va->get = Get;

return VLC_SUCCESS;
Expand Down
24 changes: 0 additions & 24 deletions modules/codec/avcodec/dxva2.c
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@ static const d3d_format_t *D3dFindFormat(D3DFORMAT format)
struct vlc_va_sys_t
{
directx_sys_t dx_sys;
vlc_fourcc_t i_chroma;

/* DLL */
HINSTANCE hd3d9_dll;
Expand Down Expand Up @@ -154,12 +153,6 @@ static void DxDestroyVideoDecoder(vlc_va_t *);
static int DxResetVideoDecoder(vlc_va_t *);
static void SetupAVCodecContext(vlc_va_t *);

/* */
static void Setup(vlc_va_t *va, vlc_fourcc_t *chroma)
{
*chroma = va->sys->i_chroma;
}

void SetupAVCodecContext(vlc_va_t *va)
{
vlc_va_sys_t *sys = va->sys;
Expand Down Expand Up @@ -251,20 +244,6 @@ static void Close(vlc_va_t *va, void **ctx)
free(sys);
}

static vlc_fourcc_t d3d9va_fourcc(enum PixelFormat swfmt)
{
switch (swfmt)
{
case AV_PIX_FMT_YUV420P10LE:
return VLC_CODEC_D3D9_OPAQUE_10B;
case AV_PIX_FMT_YUVJ420P:
case AV_PIX_FMT_YUV420P:
return VLC_CODEC_D3D9_OPAQUE;
default:
return VLC_CODEC_D3D9_OPAQUE;
}
}

static int Open(vlc_va_t *va, AVCodecContext *ctx, enum PixelFormat pix_fmt,
const es_format_t *fmt, picture_sys_t *p_sys)
{
Expand Down Expand Up @@ -314,8 +293,6 @@ static int Open(vlc_va_t *va, AVCodecContext *ctx, enum PixelFormat pix_fmt,
IDirect3DSurface9_GetDevice(p_sys->surface, &dx_sys->d3ddev );
}

sys->i_chroma = d3d9va_fourcc(ctx->sw_pix_fmt);

err = directx_va_Open(va, &sys->dx_sys, true);
if (err!=VLC_SUCCESS)
goto error;
Expand All @@ -328,7 +305,6 @@ static int Open(vlc_va_t *va, AVCodecContext *ctx, enum PixelFormat pix_fmt,

/* TODO print the hardware name/vendor for debugging purposes */
va->description = DxDescribe(sys);
va->setup = Setup;
va->get = Get;
return VLC_SUCCESS;

Expand Down
13 changes: 0 additions & 13 deletions modules/codec/avcodec/va.c
Original file line number Diff line number Diff line change
Expand Up @@ -128,19 +128,6 @@ vlc_va_t *vlc_va_New(vlc_object_t *obj, AVCodecContext *avctx,
if (va->module == NULL)
{
vlc_object_release(va);
#ifdef _WIN32
return NULL;
}

vlc_fourcc_t chroma;
vlc_fourcc_t expected = vlc_va_GetChroma( pix_fmt, avctx->sw_pix_fmt );
va->setup(va, &chroma);
if (chroma != expected)
{ /* Mismatch, cannot work, fail */
msg_Dbg( obj, "chroma mismatch %4.4s expected %4.4s",
(const char*)&chroma, (const char*) &expected );
vlc_va_Delete(va, &avctx->hwaccel_context);
#endif
va = NULL;
}
return va;
Expand Down
4 changes: 0 additions & 4 deletions modules/codec/avcodec/va.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,6 @@ struct vlc_va_t {
module_t *module;
const char *description;

#ifdef _WIN32
VLC_DEPRECATED
void (*setup)(vlc_va_t *, vlc_fourcc_t *output);
#endif
int (*get)(vlc_va_t *, picture_t *pic, uint8_t **data);
};

Expand Down

0 comments on commit 7714193

Please sign in to comment.