diff options
author | wm4 <wm4@nowhere> | 2017-05-24 15:07:45 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2017-05-24 15:25:48 +0200 |
commit | 83a9b0bc4840c1bb203c23194c5f07f898999034 (patch) | |
tree | 0b7047c9623e8da03b31929c84febf69abe64bed /video/out/opengl/hwdec_ios.m | |
parent | 2426f95e0fc232b01228457e5116b592c56b1f7f (diff) | |
download | mpv-83a9b0bc4840c1bb203c23194c5f07f898999034.tar.bz2 mpv-83a9b0bc4840c1bb203c23194c5f07f898999034.tar.xz |
videotoolbox: support new libavcodec API
The new API has literally no advantages (other than that we can drop
mp_vt_download_image and other things later), but it's sort-of uniform
with the other hwaccels.
"--videotoolbox-format=no" is not supported with the new API, because it
doesn't "fit in". Probably could be added later again.
The iOS code change is untested (no way to test).
Diffstat (limited to 'video/out/opengl/hwdec_ios.m')
-rw-r--r-- | video/out/opengl/hwdec_ios.m | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/video/out/opengl/hwdec_ios.m b/video/out/opengl/hwdec_ios.m index 3ab532ed02..6cf1b803bd 100644 --- a/video/out/opengl/hwdec_ios.m +++ b/video/out/opengl/hwdec_ios.m @@ -23,6 +23,10 @@ #include <CoreVideo/CoreVideo.h> #include <OpenGLES/EAGL.h> +#include <libavutil/hwcontext.h> + +#include "config.h" + #include "video/mp_image_pool.h" #include "video/vt.h" #include "formats.h" @@ -77,6 +81,12 @@ static int create_hwdec(struct gl_hwdec *hw) .download_image = mp_vt_download_image, .ctx = &p->hwctx, }; + +#if HAVE_VIDEOTOOLBOX_HWACCEL_NEW + av_hwdevice_ctx_create(&p->hwctx.av_device_ref, AV_HWDEVICE_TYPE_VIDEOTOOLBOX, + NULL, NULL, 0); +#endif + hwdec_devices_add(hw->devs, &p->hwctx); return 0; @@ -200,6 +210,8 @@ static void destroy(struct gl_hwdec *hw) CFRelease(p->gl_texture_cache); p->gl_texture_cache = NULL; + av_buffer_unref(&p->hwctx.av_device_ref); + hwdec_devices_remove(hw->devs, &p->hwctx); } |