diff options
author | Anton Khirnov <anton@khirnov.net> | 2016-11-24 17:14:22 +0300 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2016-12-19 10:10:22 +0300 |
commit | d4a91e65343be5d79a4afa61c791191e1b57499a (patch) | |
tree | b6a191f872f3162949018d145d2d706f106fd8b9 /libavcodec/vaapi_h264.c | |
parent | 8dfba25ce89b62c80ba83e2116d549176c376144 (diff) |
pthread_frame: do not run hwaccel decoding asynchronously unless it's safe
Certain hardware decoding APIs are not guaranteed to be thread-safe, so
having the user access decoded hardware surfaces while the decoder is
running in another thread can cause failures (this is mainly known to
happen with DXVA2).
For such hwaccels, only allow the decoding thread to run while the user
is inside a lavc decode call (avcodec_send_packet/receive_frame).
Diffstat (limited to 'libavcodec/vaapi_h264.c')
-rw-r--r-- | libavcodec/vaapi_h264.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libavcodec/vaapi_h264.c b/libavcodec/vaapi_h264.c index 7d8dc34d63..f765523005 100644 --- a/libavcodec/vaapi_h264.c +++ b/libavcodec/vaapi_h264.c @@ -22,6 +22,7 @@ #include "h264dec.h" #include "h264_ps.h" +#include "hwaccel.h" #include "vaapi_decode.h" /** @@ -399,4 +400,5 @@ AVHWAccel ff_h264_vaapi_hwaccel = { .init = &ff_vaapi_decode_init, .uninit = &ff_vaapi_decode_uninit, .priv_data_size = sizeof(VAAPIDecodeContext), + .caps_internal = HWACCEL_CAP_ASYNC_SAFE, }; |