mirror of
https://github.com/nyanmisaka/ffmpeg-rockchip.git
synced 2025-10-29 19:52:03 +08:00
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).
This commit is contained in:
@@ -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,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user