From 0aac7533dc4b7f45ff21c1f1dab9c42c58fef994 Mon Sep 17 00:00:00 2001 From: wm4 Date: Sat, 28 Jan 2017 18:36:00 +0100 Subject: vaapi: improve a comment Try to actually explain what's up with this code. --- video/decode/hw_vaapi.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/video/decode/hw_vaapi.c b/video/decode/hw_vaapi.c index 2dba5a99bd..99c23f48c4 100644 --- a/video/decode/hw_vaapi.c +++ b/video/decode/hw_vaapi.c @@ -45,7 +45,13 @@ struct priv { static int init_decoder(struct lavc_ctx *ctx, int w, int h) { struct priv *p = ctx->hwdec_priv; - // From avconv_vaapi.c. Disgusting, but apparently this is the best we get. + // libavcodec has no way yet to communicate the exact surface format needed + // for the frame pool, or the required minimum size of the frame pool. + // Hopefully, this weakness in the libavcodec API will be fixed in the + // future. + // For the pixel format, we try to second-guess from what the libavcodec + // software decoder would require (sw_pix_fmt). It could break and require + // adjustment if new VAAPI surface formats are added. int sw_format = ctx->avctx->sw_pix_fmt == AV_PIX_FMT_YUV420P10 ? AV_PIX_FMT_P010 : AV_PIX_FMT_NV12; -- cgit v1.2.3