From fb855b86593ad2a9db71cce3aa652ace93af38b5 Mon Sep 17 00:00:00 2001
From: wm4 <wm4@nowhere>
Date: Tue, 9 Dec 2014 17:47:02 +0100
Subject: 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
---
 libmpv/mpv.def | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

(limited to 'libmpv/mpv.def')

diff --git a/libmpv/mpv.def b/libmpv/mpv.def
index e8dc65db58..83ad9b315b 100644
--- a/libmpv/mpv.def
+++ b/libmpv/mpv.def
@@ -15,11 +15,16 @@ mpv_get_property
 mpv_get_property_async
 mpv_get_property_osd_string
 mpv_get_property_string
+mpv_get_sub_api
 mpv_get_time_us
 mpv_get_wakeup_pipe
 mpv_initialize
 mpv_load_config_file
 mpv_observe_property
+mpv_opengl_cb_init_gl
+mpv_opengl_cb_render
+mpv_opengl_cb_set_update_callback
+mpv_opengl_cb_uninit_gl
 mpv_request_event
 mpv_request_log_messages
 mpv_resume
@@ -33,4 +38,4 @@ mpv_suspend
 mpv_terminate_destroy
 mpv_unobserve_property
 mpv_wait_event
-mpv_wakeup
+mpv_wakeup
\ No newline at end of file
-- 
cgit v1.2.3

