diff options
Diffstat (limited to 'libavutil/hwcontext_vaapi.c')
-rw-r--r-- | libavutil/hwcontext_vaapi.c | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/libavutil/hwcontext_vaapi.c b/libavutil/hwcontext_vaapi.c index 9617979d7c..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 */ @@ -112,13 +112,15 @@ static struct { 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, |