pthread_frame: do not run hwaccel decoding asynchronously unless it's safe
authorAnton Khirnov <anton@khirnov.net>
Thu, 24 Nov 2016 14:14:22 +0000 (15:14 +0100)
committerAnton Khirnov <anton@khirnov.net>
Mon, 19 Dec 2016 07:10:22 +0000 (08:10 +0100)
commitd4a91e65343be5d79a4afa61c791191e1b57499a
treeb6a191f872f3162949018d145d2d706f106fd8b9
parent8dfba25ce89b62c80ba83e2116d549176c376144
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).
14 files changed:
libavcodec/avcodec.h
libavcodec/hwaccel.h [new file with mode: 0644]
libavcodec/pthread_frame.c
libavcodec/vaapi_h264.c
libavcodec/vaapi_mpeg2.c
libavcodec/vaapi_mpeg4.c
libavcodec/vaapi_vc1.c
libavcodec/vaapi_vp8.c
libavcodec/vdpau_h264.c
libavcodec/vdpau_hevc.c
libavcodec/vdpau_mpeg12.c
libavcodec/vdpau_mpeg4.c
libavcodec/vdpau_vc1.c
libavcodec/version.h