mirror of https://github.com/mpv-player/mpv
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:
parent
9080e4d468
commit
8fb0d2ee27
|
@ -161,23 +161,19 @@ extern "C" {
|
|||
* Embedding the video window
|
||||
* --------------------------
|
||||
*
|
||||
* Currently you have to get the raw window handle, and set it as "wid" option.
|
||||
* This works on X11, win32, and OSX only. In addition, it works with a few VOs
|
||||
* only, and VOs which do not support this will just create a freestanding
|
||||
* window.
|
||||
* Using the opengl-cb API (in opengl_cb.h) is recommended. This API requires
|
||||
* you to create and maintain an OpenGL context, to which you can render
|
||||
* video using a specific API call. This API does not include keyboard or mouse
|
||||
* input directly.
|
||||
*
|
||||
* Both on X11 and win32, the player will fill the window referenced by the
|
||||
* "wid" option fully and letterbox the video (i.e. add black bars if the
|
||||
* aspect ratio of the window and the video mismatch).
|
||||
* There is an older way to embed the native mpv window into your own. You have
|
||||
* to get the raw window handle, and set it as "wid" option. This works on X11,
|
||||
* 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
|
||||
* through the embedded window, if this is desired.
|
||||
*
|
||||
* 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.
|
||||
* Also see client API examples and the mpv manpage. There is an extensive
|
||||
* discussion here:
|
||||
* https://github.com/mpv-player/mpv-examples/tree/master/libmpv#methods-of-embedding-the-video-window
|
||||
*
|
||||
* Compatibility
|
||||
* -------------
|
||||
|
|
|
@ -31,22 +31,23 @@ extern "C" {
|
|||
#endif
|
||||
|
||||
/**
|
||||
* Warning: this API is not stable yet.
|
||||
*
|
||||
* Overview
|
||||
* --------
|
||||
*
|
||||
* 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
|
||||
* 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.
|
||||
* can be used to handle video display.
|
||||
*
|
||||
* 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
|
||||
* 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
|
||||
* --------------
|
||||
*
|
||||
|
|
Loading…
Reference in New Issue