Commit 0ce8fcae authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont
Browse files

va: mostly remove the setup callback

The coded video size is already fixed by the decoder when creating the
vidoe acceleration plugin, while the chroma is fixed by
vlc_va_GetChroma(). This callback is useless.
parent 3f50af6a
......@@ -109,6 +109,16 @@ 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;
va->setup(va, &chroma);
if (chroma != vlc_va_GetChroma(pix_fmt, AV_PIX_FMT_YUV420P))
{ /* Mismatch, cannot work, fail */
vlc_va_Delete(va, avctx);
#endif
va = NULL;
}
return va;
......
......@@ -36,7 +36,10 @@ 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);
void (*release)(void *pic, uint8_t *surface);
int (*extract)(vlc_va_t *, picture_t *pic, uint8_t *data);
......@@ -61,15 +64,6 @@ vlc_va_t *vlc_va_New(vlc_object_t *obj, AVCodecContext *,
enum PixelFormat, const es_format_t *fmt,
picture_sys_t *p_sys);
/**
* Initializes the acceleration video decoding back-end for libavcodec.
* @param output pointer to video chroma output by the back-end [OUT]
*/
static inline void vlc_va_Setup(vlc_va_t *va, vlc_fourcc_t *output)
{
va->setup(va, output);
}
/**
* Allocates a hardware video surface for a libavcodec frame.
* The surface will be used as output for the hardware decoder, and possibly
......
......@@ -187,11 +187,6 @@ static void Release( void *opaque, uint8_t *data )
(void) data;
}
static void Setup( vlc_va_t *va, vlc_fourcc_t *pi_chroma )
{
*pi_chroma = VLC_CODEC_YV12;
}
static void Delete( vlc_va_t *va, AVCodecContext *avctx )
{
vlc_va_sys_t *sys = va->sys;
......@@ -462,7 +457,6 @@ static int Create( vlc_va_t *va, AVCodecContext *ctx, enum PixelFormat pix_fmt,
ctx->hwaccel_context = &sys->hw_ctx;
va->sys = sys;
va->description = vaQueryVendorString(sys->hw_ctx.display);
va->setup = Setup;
va->get = Get;
va->release = Release;
va->extract = Extract;
......
......@@ -48,7 +48,6 @@
static int Open( vlc_va_t *, AVCodecContext *, enum PixelFormat,
const es_format_t *, picture_sys_t * );
static void Close( vlc_va_t * , AVCodecContext *);
static void Setup( vlc_va_t *, vlc_fourcc_t *);
static int Get( vlc_va_t *, picture_t *, uint8_t ** );
static int Extract( vlc_va_t *, picture_t *, uint8_t * );
static void Release( void *opaque, uint8_t *data );
......@@ -160,7 +159,6 @@ static int Open(vlc_va_t *va,
va->sys = sys;
va->description = (char *)"VDA";
va->setup = Setup;
va->get = Get;
va->release = Release;
va->extract = Extract;
......@@ -174,11 +172,6 @@ static void Close( vlc_va_t *va, AVCodecContext *avctx )
(void) va;
}
static void Setup( vlc_va_t *va, vlc_fourcc_t *pi_chroma )
{
*pi_chroma = VLC_CODEC_I420;
}
// Never called
static int Get( vlc_va_t *va, picture_t *p_picture, uint8_t **data )
{
......
......@@ -1133,8 +1133,6 @@ static enum PixelFormat ffmpeg_GetFormat( AVCodecContext *p_context,
picture_Release(test_pic);
if (va == NULL)
continue; /* Unsupported codec profile or such */
vlc_va_Setup(va, &p_dec->fmt_out.video.i_chroma);
post_mt(p_sys);
if (va->description != NULL)
......
......@@ -140,26 +140,6 @@ static int Copy(vlc_va_t *va, picture_t *pic, uint8_t *data)
return VLC_SUCCESS;
}
static void Setup(vlc_va_t *va, vlc_fourcc_t *chromap)
{
vlc_va_sys_t *sys = va->sys;
switch (sys->type)
{
case VDP_CHROMA_TYPE_420:
*chromap = VLC_CODEC_VDPAU_VIDEO_420;
break;
case VDP_CHROMA_TYPE_422:
*chromap = VLC_CODEC_VDPAU_VIDEO_422;
break;
case VDP_CHROMA_TYPE_444:
*chromap = VLC_CODEC_VDPAU_VIDEO_444;
break;
default:
vlc_assert_unreachable();
}
}
static int Open(vlc_va_t *va, AVCodecContext *avctx, enum PixelFormat pix_fmt,
const es_format_t *fmt, picture_sys_t *p_sys)
{
......@@ -336,7 +316,6 @@ static int Open(vlc_va_t *va, AVCodecContext *avctx, enum PixelFormat pix_fmt,
infos = "VDPAU";
va->description = infos;
va->setup = Setup;
va->get = Lock;
va->release = NULL;
va->extract = Copy;
......
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