aboutsummaryrefslogtreecommitdiffhomepage
path: root/DOCS/client_api_examples
Commit message (Collapse)AuthorAge
* examples/qt_opengl: Use fbo of the widget and not the thread contextGravatar commander kotori2015-12-03
| | | | | | | Sometimes QOpenGLWidget may be redirecting it's output to a framebuffer object rather than the frontbuffer, in which case the current thread's context render fbo is different from the widget's. Use the widget's desired fbo instead.
* examples/qt_opengl: remove redundant time-start property fetchGravatar commander kotori2015-12-03
| | | | | | Time-start is not a real property since 70df1608d. Fixes #2529.
* DOCS/client_api_examples/README: add qt_openglGravatar wm42015-10-11
| | | | | | | And also adjust the documentation for the other Qt examples to avoid redundancy. While we're at it, move the simple example to the top.
* DOCS/client_api_examples/qt_opengl: fix uninitGravatar wm42015-10-11
| | | | | | | | | | | | | | | | | mpv_opengl_cb_uninit_gl() still needs the OpenGL context. It makes calls to free OpenGL objects. Strictly speaking, this is probably unnecessary, because the OpenGL context is destroyed afterwards (implicitly freeing all related objects). But mpv_opengl_cb_uninit_gl() does not require the destruction of the OpenGL context, and thus has to free resources manually. It's also true that OpenGL normally simply ignores API calls (or returns errors) if no context is set, but doing it properly is cleaner. That makeCurrent() can be called in the destructor is explicitly allowed and recommended for freeing GL resources in the Qt docs. This fixes a mpv error message on exit.
* DOCS/client_api_examples: add qt widget + opengl-cb exampleGravatar wang-bin2015-10-11
|
* DOCS/client_api_examples/README: rewriteGravatar wm42015-10-10
| | | | | | The new one is much more detailed. Also add part of it to the libmpv doxygen.
* vo_opengl: remove sharpen scalers, add sharpen sub-optionGravatar wm42015-09-23
| | | | | | | | | | | | This turns the old scalers (inherited from MPlayer) into a pre- processing step (after color conversion and before scaling). The code for the "sharpen5" scaler is reused for this. The main reason MPlayer implemented this as scalers was perhaps because FBOs were too expensive, and making it a scaler allowed to implement this in 1 pass. But unsharp masking is not really a scaler, and I would guess the result is more like combining bilinear scaling and unsharp masking.
* DOCS/client_api_examples/sdl: make the window resizableGravatar wm42015-09-04
|
* DOCS/client_api_examples/sdl: don't curse the mainloopGravatar wm42015-08-17
| | | | Fix a typo, and also reword another comment.
* DOCS/client_api_examples/sdl: add more explanation commentsGravatar wm42015-08-12
|
* DOCS/client_api_examples/sdl: don't load file before GL initGravatar wm42015-08-11
| | | | Could lead to failure because it's essentially a race condition.
* DOCS/client_api_examples: add SDL OpenGL exampleGravatar wm42015-08-11
|
* DOCS: fix wrong libmpv's cocoa example commentGravatar Stefano Pigozzi2015-05-27
| | | | | libmpv can be embedded in a cocoa view (without the mpv window). This has been the case for serveral months, and the comment is just wrong now.
* DOCS/client_api_examples/cocoa-openglcb: do initial flush correctly.Gravatar torque2015-05-23
|
* DOCS/client_api_examples: cocoa: minor fixesGravatar wm42015-05-21
| | | | | | | Cocoa needs to be linked explicitly. EXIT_SUCCESS is pretty pointless, and the same file uses exit(1) in other places.
* DOCS/client_api_examples: add opengl-cb-based cocoa example.Gravatar torque2015-05-21
| | | | Contains a basic toggle button that pauses the video.
* DOCS/client_api_examples: Qt: force qmake to use pkg-config.Gravatar torque2015-05-16
|
* vo_opengl_cb: deprecate mpv_opengl_cb_render()Gravatar wm42015-04-09
| | | | Its vp parameter made no sense anymore. Introduce a new one.
* vo_opengl_cb: add a function to report vsync timeGravatar wm42015-04-09
| | | | | | | And also let vo.c know of it. Currently, this does not help much, but will facilitate future improvements.
* cocoa: remove the setNextKeyView hackGravatar Stefano Pigozzi2015-02-28
| | | | | | Just use makeFirstResponder on the mpv events view from client code if you need the built in keyboard events (this is easier for dealing with view nesting).
* examples/cocoabasic: allow to send stop commandGravatar Stefano Pigozzi2015-02-28
|
* DOCS/client_api_examples/simple: fix optionGravatar wm42015-02-23
| | | | | "input-x11-keyboard" still works, but is a deprecated alias with the same functionality.
* manpage: minor changesGravatar wm42015-01-23
| | | | | | Mostly related to vo_opengl. Fix the opengl lscale option in the qml example too.
* build: remove bogus client API examples buildGravatar wm42015-01-23
| | | | | | | | | | | The symlink trick made waf go crazy (deleting source files, getting tangled up in infinite recursion... I wish I was joking). This means we still can't build the client API examples in a reasonable way using the include files of the local repository (instead of globally installed headers). Not building them at all is better than deleting source files. Instead, provide some manual instructions how to build each example (except for the Qt examples, which provide qmake project files).
* DOCS/client_api_examples: fix locale nonsense in qml examplesGravatar wm42015-01-15
| | | | | | | The Qt example already does this. I hoped this was restricted to QApplication only, but apparently Qt repeated this mistake with QGuiApplication (QGuiApplication was specifically added for QtQuick at a much later point, even though QApplication inherits from it).
* DOCS/client_api_examples: qml_direct: QWindow::size() is not thread-safeGravatar wm42015-01-09
| | | | | | We still keep the window pointer, because we want to call QQuickWindow::resetOpenGLState() (which runs on the rendering thread only). Interesting mess...
* DOCS/client_api_examples: qml: reduce number of filesGravatar wm42015-01-09
| | | | This is annoying.
* DOCS/client_api_examples: add an alternative qml exampleGravatar wm42015-01-08
| | | | | | | | | | | This one avoids use of a FBO. It's less flexible, because it uses works around the whole QML rendering API. It seems to be the only way to get OpenGL rendering without any indirections, though. Parts of this example were insipired by Qt's "Squircle" example. Also add a README file with a short description of each example, to reduce the initial confusing.
* DOCS/client_api_examples: qml: add test for gamma controlGravatar wm42015-01-06
| | | | Provides a dumb test for the functionality added in the previous commit.
* DOCS/client_api_examples: qtexample: demonstrate multiple mpv instancesGravatar wm42015-01-06
| | | | Multiple client API contexts can exist in the same process.
* DOCS/client_api_examples: qml: add test for vo_cmdlineGravatar wm42015-01-05
|
* build: try to make examples build both in-tree and out-of-treeGravatar wm42015-01-02
| | | | | | | | | | | | | | | | | | | | | | | | | The examples simple.c and cocoabasic.m can be compiled without installing libmpv. But also, they didn't use the correct include path libmpv programs normally use, so they couldn't be built with a properly installed system-libmpv. That's pretty bad for examples, which are supposed to show how to use libmpv correctly. So do some bullshit that symlinks libmpv to a "mpv" include directory under the build directory. This name-mismatch is a direct consequence of the bullshit done in 499a6758 (requested in #539 for dumb reasons). (We don't want to name the client API headers directory "mpv", because that would be too unspecific, and clashes with having the mpv binary in the same directory.) If you have spaces or other "unusual" characters in your paths, the build will break, because I couldn't find out where waf hides its function to escape shell parameters (or a way to invoke programs without involving the shell). Neither does such a thing to be documented, nor do they seem to have a clear way to do this in their code. This also doesn't compile the Qt examples, because everything becomes even more terrible from there on.
* DOCS/client_api_examples: move all examples into their own subdirsGravatar wm42015-01-01
| | | | | Also get rid of shared.h; it actually doesn't have much value. Just copy the tiny function it contained into the 2 files which used it.
* DOCS/client_api_examples: don't throw char* in C++ codeGravatar wm42015-01-01
| | | | | | | 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 uninitializationGravatar wm42014-12-31
| | | | | | | | | | | 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: add an explicit licenseGravatar wm42014-12-30
| | | | IANAL, but we don't give a shit what you do with this code.
* DOCS/client_api_examples: qtexample: use queued signalsGravatar wm42014-12-30
| | | | | | | | Use queued signals instead of QEvent for the wakeup notification. This is slightly nicer, and reduces the chance that the event (QEvent::User) could clash with other code using the same event. Also switch to modern connect() syntax.
* DOCS/client_api_examples: qtquick: fix destructionGravatar wm42014-12-30
| | | | | | | | | | | | | | | | 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 nonsenseGravatar wm42014-12-09
| | | | | | | 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 rendererGravatar wm42014-12-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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: cocoa: add basic menuGravatar Stefano Pigozzi2014-10-27
|
* DOCS/client_api_examples: qtexample: don't require Qt 5.xGravatar wm42014-10-17
| | | | Exclude the worthless Qt 5.0-only demo code on Qt 4.x.
* cocoa: allow mouse events to bubble up with no-input-cursorGravatar Stefano Pigozzi2014-10-17
| | | | | Previously we didn't report events to the core, but still prevented the events to travel on the responder chain.
* DOCS/client_api_examples: qtexample: set a magic Qt flagGravatar wm42014-10-16
| | | | | | Otherwise, other magic Qt stuff can be magically broken. (No, I don't know the real reasons for this.)
* DOCS/client_api_examples: qtexample: embedding works on CocoaGravatar wm42014-10-16
|
* DOCS/client_api_examples: qtexample: remove debugging codeGravatar wm42014-10-14
| | | | Forgotten.
* DOCS/client_api_examples: qtexample: stuffGravatar wm42014-10-13
| | | | | | Dump chapters and track list to the log for demo purposes. Compile in debug mode.
* libmpv/cocoa: allow clients to use mpv event systemGravatar Stefano Pigozzi2014-10-12
| | | | | | | | | | This allows mpv's view to take key and send events to mpv's core. To set key status correctly, clients must call -[NSWindow selectNextKeyView:] during reconfig on the main thread. All is 'documented' in the cocoabasic example. If someone knows a better way to handle giving key to the embedded view, let me know!
* libmpv/cocoa: make global events work and get rid of is_cplayerGravatar Stefano Pigozzi2014-10-09
| | | | | | | After @frau's split of macosx_events from macosx_application, `is_cplayer' is not needed anymore. At the moment only global events such as Media Keys and Apple Remote work, because the VO-level ones were hardcoded to be disabled. (that will be fix in a later commit ).
* client API: rename --input-x11-keyboard to --input-vo-keyboardGravatar wm42014-10-09
| | | | | Apparently we need this for Cocoa too. (The option was X11 specific in the hope that only X11 would need this hack.)