diff options
author | wm4 <wm4@nowhere> | 2014-12-09 17:47:02 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2014-12-09 17:59:04 +0100 |
commit | fb855b86593ad2a9db71cce3aa652ace93af38b5 (patch) | |
tree | ffca8eb74c8cf58dc5e97e0fac2c519b958b7cf7 /video/out/gl_video.h | |
parent | d38bc531cc7ce9c90b74145e2be2e24cb48e501a (diff) | |
download | mpv-fb855b86593ad2a9db71cce3aa652ace93af38b5.tar.bz2 mpv-fb855b86593ad2a9db71cce3aa652ace93af38b5.tar.xz |
client API: expose OpenGL renderer
This adds API to libmpv that lets host applications use the mpv opengl
renderer. This is a more flexible (and possibly more portable) option to
foreign window embedding (via --wid).
This assumes that methods like context sharing and multithreaded OpenGL
rendering are infeasible, and that a way is needed to integrate it with
an application that uses a single thread to render everything.
Add an example that does this with QtQuick/qml. The example is
relatively lazy, but still shows how relatively simple the integration
is. The FBO indirection could probably be avoided, but would require
more work (and would probably lead to worse QtQuick integration, because
it would have to ignore transformations like rotation).
Because this makes mpv directly use the host application's OpenGL
context, there is no platform specific code involved in mpv, except
for hw decoding interop.
main.qml is derived from some Qt example.
The following things are still missing:
- a way to do better video timing
- expose GL renderer options, allow changing them at runtime
- support for color equalizer controls
- support for screenshots
Diffstat (limited to 'video/out/gl_video.h')
-rw-r--r-- | video/out/gl_video.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/video/out/gl_video.h b/video/out/gl_video.h index bba24e364a..3d733c8a80 100644 --- a/video/out/gl_video.h +++ b/video/out/gl_video.h @@ -69,7 +69,7 @@ void gl_video_render_frame(struct gl_video *p, int fbo); struct mp_image *gl_video_download_image(struct gl_video *p); void gl_video_resize(struct gl_video *p, struct mp_rect *window, struct mp_rect *src, struct mp_rect *dst, - struct mp_osd_res *osd); + struct mp_osd_res *osd, bool vflip); void gl_video_get_colorspace(struct gl_video *p, struct mp_image_params *params); bool gl_video_set_equalizer(struct gl_video *p, const char *name, int val); bool gl_video_get_equalizer(struct gl_video *p, const char *name, int *val); @@ -77,6 +77,9 @@ bool gl_video_get_equalizer(struct gl_video *p, const char *name, int *val); void gl_video_set_debug(struct gl_video *p, bool enable); void gl_video_resize_redraw(struct gl_video *p, int w, int h); +void gl_video_set_gl_state(struct gl_video *p); +void gl_video_unset_gl_state(struct gl_video *p); + struct gl_hwdec; void gl_video_set_hwdec(struct gl_video *p, struct gl_hwdec *hwdec); |