From 2b5577901d43841fcb7930db62ff881becbcc4de Mon Sep 17 00:00:00 2001 From: wm4 Date: Fri, 17 Feb 2017 13:54:17 +0100 Subject: videotoolbox: remove weird format-negotiation between VO and decoder Originally, there was probably some sort of intention to restrict it to formats supported by the interop, or something. But in the end it was overcomplicated nonsense. In the future, we could use mp_hwdec_ctx.supported_formats or other mechanisms to handle this in a better way. mp_hwdec_ctx.ctx is not set to a dummy pointer - hwdec_devices_load() is only used to detect whether to vo_opengl interop is present, and the common hwdec code expects that the .ctx field is not NULL. This also changes videotoolbox-copy to use --videotoolbox-format, instead of the FFmpeg-set default. --- video/out/opengl/hwdec_osx.c | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) (limited to 'video/out/opengl/hwdec_osx.c') diff --git a/video/out/opengl/hwdec_osx.c b/video/out/opengl/hwdec_osx.c index ecceab658a..aa350209ec 100644 --- a/video/out/opengl/hwdec_osx.c +++ b/video/out/opengl/hwdec_osx.c @@ -27,8 +27,6 @@ #include "video/mp_image_pool.h" #include "video/vt.h" #include "hwdec.h" -#include "common/global.h" -#include "options/options.h" struct vt_gl_plane_format { GLenum gl_format; @@ -46,7 +44,6 @@ struct vt_format { struct priv { struct mp_hwdec_ctx hwctx; - struct mp_vt_ctx vtctx; CVPixelBufferRef pbuf; GLuint gl_planes[MP_MAX_PLANES]; @@ -123,14 +120,6 @@ static bool check_hwdec(struct gl_hwdec *hw) return true; } -static uint32_t get_vt_fmt(struct mp_vt_ctx *vtctx) -{ - struct gl_hwdec *hw = vtctx->priv; - struct vt_format *f = - vt_get_gl_format_from_imgfmt(hw->global->opts->videotoolbox_format); - return f ? f->cvpixfmt : (uint32_t)-1; -} - static int create(struct gl_hwdec *hw) { if (!check_hwdec(hw)) @@ -141,14 +130,10 @@ static int create(struct gl_hwdec *hw) hw->gl->GenTextures(MP_MAX_PLANES, p->gl_planes); - p->vtctx = (struct mp_vt_ctx){ - .priv = hw, - .get_vt_fmt = get_vt_fmt, - }; p->hwctx = (struct mp_hwdec_ctx){ .type = HWDEC_VIDEOTOOLBOX, .download_image = mp_vt_download_image, - .ctx = &p->vtctx, + .ctx = &p->hwctx, }; hwdec_devices_add(hw->devs, &p->hwctx); -- cgit v1.2.3