summaryrefslogtreecommitdiffstats
path: root/video/out/opengl/hwdec_osx.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2017-02-17 13:54:17 +0100
committerwm4 <wm4@nowhere>2017-02-17 14:14:22 +0100
commit2b5577901d43841fcb7930db62ff881becbcc4de (patch)
tree3cff406a0384be62580ad2c08a9dacc72bc7207f /video/out/opengl/hwdec_osx.c
parentb5bbcc9f930eaf61e149a6cd7cc61712107f50ed (diff)
downloadmpv-2b5577901d43841fcb7930db62ff881becbcc4de.tar.bz2
mpv-2b5577901d43841fcb7930db62ff881becbcc4de.tar.xz
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.
Diffstat (limited to 'video/out/opengl/hwdec_osx.c')
-rw-r--r--video/out/opengl/hwdec_osx.c17
1 files changed, 1 insertions, 16 deletions
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);