diff options
author | Rodger Combs <rodger.combs@gmail.com> | 2018-02-02 20:50:13 -0600 |
---|---|---|
committer | Aman Gupta <aman@tmm1.net> | 2018-03-08 14:04:25 -0800 |
commit | 63d875772d265a885808532889f094f80afaac7a (patch) | |
tree | 6ab1253b1566169f149cf3c04aec8b430ba5ce05 /libavcodec/vt_internal.h | |
parent | 9fe61b61074b013bc0a9289a207efce2107bfbcf (diff) | |
download | ffmpeg-63d875772d265a885808532889f094f80afaac7a.tar.gz |
lavc/videotoolbox: fix threaded decoding
AVHWAccel.end_frame can run on a worker thread. The assumption of the
frame threading code is that the worker thread will change the AVFrame
image data, not the AVFrame fields. So the AVFrame fields are not synced
back to the main thread. But this breaks videotoolbox due to its special
requirements (everything else is fine). It actually wants to update
AVFrame fields.
The actual videotoolbox frame is now stored in the dummy AVBufferRef, so
it mimics what happens in non-videotoolbox cases. (Changing the
AVBufferRef contents is a bit like changing the image data.) The
post_process callback copies that reference to the proper AVFrame field.
Based on a patch by wm4.
Signed-off-by: Aman Gupta <aman@tmm1.net>
Diffstat (limited to 'libavcodec/vt_internal.h')
-rw-r--r-- | libavcodec/vt_internal.h | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/libavcodec/vt_internal.h b/libavcodec/vt_internal.h index 929fe423fc..fb64735b8c 100644 --- a/libavcodec/vt_internal.h +++ b/libavcodec/vt_internal.h @@ -46,7 +46,6 @@ typedef struct VTContext { int ff_videotoolbox_alloc_frame(AVCodecContext *avctx, AVFrame *frame); int ff_videotoolbox_uninit(AVCodecContext *avctx); -int ff_videotoolbox_buffer_create(VTContext *vtctx, AVFrame *frame); int ff_videotoolbox_h264_start_frame(AVCodecContext *avctx, const uint8_t *buffer, uint32_t size); |