client API: update outdated recommendations about window embedding

Basically, the opengl-cb API causes fewer issues, even if it's a bit
harder on the API user.

See #4197.
This commit is contained in:
wm4 2017-03-02 05:53:05 +01:00
parent 9080e4d468
commit 8fb0d2ee27
2 changed files with 18 additions and 21 deletions

View File

@ -161,23 +161,19 @@ extern "C" {
* Embedding the video window * Embedding the video window
* -------------------------- * --------------------------
* *
* Currently you have to get the raw window handle, and set it as "wid" option. * Using the opengl-cb API (in opengl_cb.h) is recommended. This API requires
* This works on X11, win32, and OSX only. In addition, it works with a few VOs * you to create and maintain an OpenGL context, to which you can render
* only, and VOs which do not support this will just create a freestanding * video using a specific API call. This API does not include keyboard or mouse
* window. * input directly.
* *
* Both on X11 and win32, the player will fill the window referenced by the * There is an older way to embed the native mpv window into your own. You have
* "wid" option fully and letterbox the video (i.e. add black bars if the * to get the raw window handle, and set it as "wid" option. This works on X11,
* aspect ratio of the window and the video mismatch). * win32, and OSX only. It's much easier to use than the opengl-cb API, but
* also has various problems.
* *
* Setting the "input-vo-keyboard" may be required to get keyboard input * Also see client API examples and the mpv manpage. There is an extensive
* through the embedded window, if this is desired. * discussion here:
* * https://github.com/mpv-player/mpv-examples/tree/master/libmpv#methods-of-embedding-the-video-window
* For OpenGL integration (e.g. rendering video to a texture), a separate API
* is available. Look at opengl_cb.h. This API does not include keyboard or
* mouse input directly.
*
* Also see client API examples and the mpv manpage.
* *
* Compatibility * Compatibility
* ------------- * -------------

View File

@ -31,22 +31,23 @@ extern "C" {
#endif #endif
/** /**
* Warning: this API is not stable yet.
* *
* Overview * Overview
* -------- * --------
* *
* This API can be used to make mpv render into a foreign OpenGL context. It * This API can be used to make mpv render into a foreign OpenGL context. It
* can be used to handle video display. Be aware that using this API is not * can be used to handle video display.
* required: you can embed the mpv window by setting the mpv "wid" option to
* a native window handle (see "Embedding the video window" section in the
* client.h header). In general, using the "wid" option is recommended over
* the OpenGL API, because it's simpler and more flexible on the mpv side.
* *
* The renderer needs to be explicitly initialized with mpv_opengl_cb_init_gl(), * The renderer needs to be explicitly initialized with mpv_opengl_cb_init_gl(),
* and then video can be drawn with mpv_opengl_cb_draw(). The user thread can * and then video can be drawn with mpv_opengl_cb_draw(). The user thread can
* be notified by new frames with mpv_opengl_cb_set_update_callback(). * be notified by new frames with mpv_opengl_cb_set_update_callback().
* *
* You can output and embed video without this API by setting the mpv "wid"
* option to a native window handle (see "Embedding the video window" section
* in the client.h header). In general, using the opengl-cb API is recommended,
* because window embedding can cause various issues, especially with GUI
* toolkits and certain platforms.
*
* OpenGL interop * OpenGL interop
* -------------- * --------------
* *