summaryrefslogtreecommitdiffstats
path: root/DOCS
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-04-09 19:30:26 +0200
committerwm4 <wm4@nowhere>2015-04-09 19:30:26 +0200
commit8dc7156bc0271965ea1e6768cfc7bbe67cef1876 (patch)
tree3573cd6130ff7b71bf0c4d7f66e4f9ae53200b75 /DOCS
parent4e8ee522f4df73a74befc093640fdf60a43053ec (diff)
downloadmpv-8dc7156bc0271965ea1e6768cfc7bbe67cef1876.tar.bz2
mpv-8dc7156bc0271965ea1e6768cfc7bbe67cef1876.tar.xz
vo_opengl_cb: add a function to report vsync time
And also let vo.c know of it. Currently, this does not help much, but will facilitate future improvements.
Diffstat (limited to 'DOCS')
-rw-r--r--DOCS/client-api-changes.rst1
-rw-r--r--DOCS/client_api_examples/qml_direct/main.cpp7
-rw-r--r--DOCS/client_api_examples/qml_direct/main.h1
3 files changed, 9 insertions, 0 deletions
diff --git a/DOCS/client-api-changes.rst b/DOCS/client-api-changes.rst
index 258e9653e2..594cd42968 100644
--- a/DOCS/client-api-changes.rst
+++ b/DOCS/client-api-changes.rst
@@ -26,6 +26,7 @@ API changes
::
--- mpv 0.9.0 will be released ---
+ 1.16 - add mpv_opengl_cb_report_flip()
1.15 - mpv_initialize() will now load config files. This requires setting
the "config" and "config-dir" options. In particular, it will load
mpv.conf.
diff --git a/DOCS/client_api_examples/qml_direct/main.cpp b/DOCS/client_api_examples/qml_direct/main.cpp
index 5f1f1468cf..93a843dfd0 100644
--- a/DOCS/client_api_examples/qml_direct/main.cpp
+++ b/DOCS/client_api_examples/qml_direct/main.cpp
@@ -96,6 +96,8 @@ void MpvObject::handleWindowChanged(QQuickWindow *win)
this, &MpvObject::sync, Qt::DirectConnection);
connect(win, &QQuickWindow::sceneGraphInvalidated,
this, &MpvObject::cleanup, Qt::DirectConnection);
+ connect(win, &QQuickWindow::frameSwapped,
+ this, &MpvObject::swapped, Qt::DirectConnection);
win->setClearBeforeRendering(false);
}
@@ -110,6 +112,11 @@ void MpvObject::sync()
renderer->size = window()->size() * window()->devicePixelRatio();
}
+void MpvObject::swapped()
+{
+ mpv_opengl_cb_report_flip(mpv_gl, 0);
+}
+
void MpvObject::cleanup()
{
if (renderer) {
diff --git a/DOCS/client_api_examples/qml_direct/main.h b/DOCS/client_api_examples/qml_direct/main.h
index 66fe8c94a5..b0310ff0be 100644
--- a/DOCS/client_api_examples/qml_direct/main.h
+++ b/DOCS/client_api_examples/qml_direct/main.h
@@ -37,6 +37,7 @@ public:
public slots:
void command(const QVariant& params);
void sync();
+ void swapped();
void cleanup();
signals:
void onUpdate();