diff options
author | wm4 <wm4@nowhere> | 2015-07-07 14:53:58 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2015-07-07 15:05:32 +0200 |
commit | 92727e7332cd8c9237552675fd8e8dba9b1a4127 (patch) | |
tree | ca66eb301794513652a994eeb3bd0eb56cb4b1c0 /video/out/vo_opengl.c | |
parent | 1d29177c5c150e700cace0c875185c6fa5e92d3c (diff) | |
download | mpv-92727e7332cd8c9237552675fd8e8dba9b1a4127.tar.bz2 mpv-92727e7332cd8c9237552675fd8e8dba9b1a4127.tar.xz |
vo_opengl_cb, vo_opengl: add option for preloading hwdec context
See manpage additions. This is mainly useful for vo_opengl_cb, but can
also be applied to vo_opengl.
On a side note, gl_hwdec_load_api() should stop using a name string, and
instead always use the IDs. This should be cleaned up another time.
Diffstat (limited to 'video/out/vo_opengl.c')
-rw-r--r-- | video/out/vo_opengl.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/video/out/vo_opengl.c b/video/out/vo_opengl.c index 043ddaa836..b25d162d7b 100644 --- a/video/out/vo_opengl.c +++ b/video/out/vo_opengl.c @@ -440,6 +440,14 @@ static int preinit(struct vo *vo) p->hwdec_info.load_api = call_request_hwdec_api; p->hwdec_info.load_api_ctx = vo; + if (vo->opts->hwdec_preload_api != HWDEC_NONE) { + p->hwdec = + gl_hwdec_load_api_id(p->vo->log, p->gl, vo->opts->hwdec_preload_api); + gl_video_set_hwdec(p->renderer, p->hwdec); + if (p->hwdec) + p->hwdec_info.hwctx = p->hwdec->hwctx; + } + return 0; err_out: |