diff options
author | wm4 <nfxjfg@googlemail.com> | 2017-05-15 11:27:24 +0200 |
---|---|---|
committer | wm4 <nfxjfg@googlemail.com> | 2017-05-15 11:30:36 +0200 |
commit | 532b23f079b52f4789be1f20ce232286ce4ffa13 (patch) | |
tree | 2d826fd0046a1c4f2feeb072971292348812b93b /libavcodec/vda_vt_internal.h | |
parent | 2c6179aa829e6f50eea6faf47b2b6efd7650a41d (diff) |
videotoolbox: add hwcontext support
This adds tons of code for no other benefit than making VideoToolbox
support conform with the new hwaccel API (using hw_device_ctx and
hw_frames_ctx).
Since VideoToolbox decoding does not actually require the user to
allocate frames, the new code does mostly nothing.
One benefit is that ffmpeg_videotoolbox.c can be dropped once generic
hwaccel support for ffmpeg.c is merged from Libav.
Does not consider VDA or VideoToolbox encoding.
Fun fact: the frame transfer functions are copied from vaapi, as the
mapping makes copying generic boilerplate. Mapping itself is not
exported by the VT code, because I don't know how to test.
Diffstat (limited to 'libavcodec/vda_vt_internal.h')
-rw-r--r-- | libavcodec/vda_vt_internal.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/libavcodec/vda_vt_internal.h b/libavcodec/vda_vt_internal.h index 9ff63ccc52..e55a813899 100644 --- a/libavcodec/vda_vt_internal.h +++ b/libavcodec/vda_vt_internal.h @@ -40,6 +40,13 @@ typedef struct VTContext { // The core video buffer CVImageBufferRef frame; + + // Current dummy frames context (depends on exact CVImageBufferRef params). + struct AVBufferRef *cached_hw_frames_ctx; + + // Non-NULL if the new hwaccel API is used. This is only a separate struct + // to ease compatibility with the old API. + struct AVVideotoolboxContext *vt_ctx; } VTContext; int ff_videotoolbox_alloc_frame(AVCodecContext *avctx, AVFrame *frame); |