summaryrefslogtreecommitdiffstats
path: root/DOCS/client_api_examples/qml
Commit message (Collapse)AuthorAgeFilesLines
* DOCS/client_api_examples: don't throw char* in C++ codewm42015-01-011-4/+6
| | | | | | | C++ is the worst language ever, and allows throwing any type, even if it doesn't make sense. In this case, we were throwing char*, which the runtime typically treats as opaque, instead of printing it as message if such an exception was not caught.
* vo_opengl_cb: simplify API uninitializationwm42014-12-311-9/+3
| | | | | | | | | | | Until now, calling mpv_opengl_cb_uninit_gl() at a "bad moment" could make the whole thing to explode. The API user was asked to avoid such situations by calling it only in "good moments". But this was probably a bit too subtle and could easily be overlooked. Integrate the approach the qml example uses directly into the implementation. If the OpenGL context is to be unitialized, forcefully disable video, and block until this is done.
* DOCS/client_api_examples: qtquick: fix destructionwm42014-12-304-38/+35
| | | | | | | | | | | | | | | | Destruction (e.g. when closing the window) was a bit broken. This commit fixes some possible crashes, and should make lifetime management relatively sane. (Still a bit complex, though. Maybe this code should be moved into a tiny library.) QtQuick runs the renderer on a separate thread. This thread is rather loosely connected to the main thread. The loose separation is enforced by the API, which also makes coordination of initialization and destruction harder. Throw refcounting at the problem, which fixes it. The refcounting wrapper introduced in the previous commit is used for this. Also contains some general cleanups.
* DOCS/client_api_examples: remove nonsensewm42014-12-092-4/+3
| | | | | | | I thought setSamples() was some funky abstraction to set the number of components, but it's actually something else. Also fix the include paths.
* client API: expose OpenGL rendererwm42014-12-096-0/+232
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