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.
This commit is contained in:
wm4
2017-05-15 11:27:24 +02:00
parent 2c6179aa82
commit 532b23f079
11 changed files with 493 additions and 13 deletions

View File

@@ -43,6 +43,9 @@ static const HWContextType *hw_table[] = {
#endif
#if CONFIG_VDPAU
&ff_hwcontext_type_vdpau,
#endif
#if CONFIG_VIDEOTOOLBOX
&ff_hwcontext_type_videotoolbox,
#endif
NULL,
};