summaryrefslogtreecommitdiff
path: root/libavutil/hwcontext_vaapi.c
diff options
context:
space:
mode:
Diffstat (limited to 'libavutil/hwcontext_vaapi.c')
-rw-r--r--libavutil/hwcontext_vaapi.c24
1 files changed, 15 insertions, 9 deletions
diff --git a/libavutil/hwcontext_vaapi.c b/libavutil/hwcontext_vaapi.c
index cd7d43eb8d..da15f89130 100644
--- a/libavutil/hwcontext_vaapi.c
+++ b/libavutil/hwcontext_vaapi.c
@@ -1,18 +1,18 @@
/*
- * This file is part of Libav.
+ * This file is part of FFmpeg.
*
- * Libav is free software; you can redistribute it and/or
+ * FFmpeg is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
- * Libav is distributed in the hope that it will be useful,
+ * FFmpeg is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
- * License along with Libav; if not, write to the Free Software
+ * License along with FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
@@ -109,16 +109,18 @@ static struct {
MAP(YUY2, YUV422, YUYV422),
MAP(Y800, YUV400, GRAY8),
#ifdef VA_FOURCC_P010
- //MAP(P010, YUV420_10BPP, P010),
+ MAP(P010, YUV420_10BPP, P010),
#endif
MAP(BGRA, RGB32, BGRA),
- //MAP(BGRX, RGB32, BGR0),
+ MAP(BGRX, RGB32, BGR0),
MAP(RGBA, RGB32, RGBA),
- //MAP(RGBX, RGB32, RGB0),
+ MAP(RGBX, RGB32, RGB0),
+#ifdef VA_FOURCC_ABGR
MAP(ABGR, RGB32, ABGR),
- //MAP(XBGR, RGB32, 0BGR),
+ MAP(XBGR, RGB32, 0BGR),
+#endif
MAP(ARGB, RGB32, ARGB),
- //MAP(XRGB, RGB32, 0RGB),
+ MAP(XRGB, RGB32, 0RGB),
};
#undef MAP
@@ -395,6 +397,10 @@ static AVBufferRef *vaapi_pool_alloc(void *opaque, int size)
VAStatus vas;
AVBufferRef *ref;
+ if (hwfc->initial_pool_size > 0 &&
+ avfc->nb_surfaces >= hwfc->initial_pool_size)
+ return NULL;
+
vas = vaCreateSurfaces(hwctx->display, ctx->rt_format,
hwfc->width, hwfc->height,
&surface_id, 1,