summaryrefslogtreecommitdiffstats
path: root/libmpv
Commit message (Collapse)AuthorAgeFilesLines
* client API: clarify that Display pointers etc. need to stay validwm42018-04-161-2/+4
| | | | | | | | | | | | Normally, MPV_RENDER_PARAM* arguments are copied, unless documented otherwise. Of course we can't copy X11 Display or Wayland wl_display types, but for arguments that are "summarized" in a struct (like MPV_RENDER_PARAM_OPENGL_FBO), a copy is expected. Also add some unused infrastructure to make this explicit, and to make it easier to add parameter types that require a copy. Untested.
* client API: add a first class hook API, and deprecate old APIwm42018-03-262-1/+80
| | | | | | | | | | | | | | | As it turns out, there are multiple libmpv users who saw a need to use the hook API. The API is kind of shitty and was never meant to be actually public (it was mostly a hack for the ytdl script). Introduce a proper API and deprecate the old one. The old one will probably continue to work for a few releases, but will be removed eventually. There are some slight changes to the old API, but if a user followed the manual properly, it won't break. Mostly untested. Appears to work with ytdl_hook.
* client API: deprecate mpv_get_wakeup_pipe()wm42018-03-261-16/+20
| | | | I don't think anything even uses it.
* client API: add a new way to pass X11 Display etc. to render APIwm42018-03-264-58/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Hardware decoding things often need access to additional handles from the windowing system, such as the X11 or Wayland display when using vaapi. The opengl-cb had nothing dedicated for this, and used the weird GL_MP_MPGetNativeDisplay GL extension (which was mpv specific and not officially registered with OpenGL). This was awkward, and a pain due to having to emulate GL context behavior (like needing a TLS variable to store context for the pseudo GL extension function). In addition (and not inherently due to this), we could pass only one resource from mpv builtin context backends to hwdecs. It was also all GL specific. Replace this with a newer mechanism. It works for all RA backends, not just GL. the API user can explicitly pass the objects at init time via mpv_render_context_create(). Multiple resources are naturally possible. The API uses MPV_RENDER_PARAM_* defines, but internally we use strings. This is done for 2 reasons: 1. trying to leave libmpv and internal mechanisms decoupled, 2. not having to add public API for some of the internal resource types (especially D3D/GL interop stuff). To remain sane, drop support for obscure half-working opengl-cb things, like the DRM interop (was missing necessary things), the RPI window thing (nobody used it), and obscure D3D interop things (not needed with ANGLE, others were undocumented). In order not to break ABI and the C API, we don't remove the associated structs from opengl_cb.h. The parts which are still needed (in particular DRM interop) needs to be ported to the render API.
* video: add an option to tune waiting for video timingwm42018-03-151-0/+6
| | | | Probably mostly useful for the libmpv render API.
* client API: deprecate qthelper.hppwm42018-03-151-5/+11
| | | | | | | It's a WTF that we have something as specific in the API. It could be argued that we should provide helpers for other language and GUI toolkit combinations. Obviously that's not going to scale, and it's somewhat likely that it will bitrot. The rest is said in the API changelog.
* client API: send MPV_EVENT_SHUTDOWN only oncewm42018-03-151-3/+2
| | | | | | | | | | | | Before this change, mpv_wait_event() could inconsistently return multiple MPV_EVENT_SHUTDOWN events to a single mpv_handle, up to the point of spamming the event queue under certain circumstances. Change this and just send it exactly once to each mpv_handle. Some client API users might have weird requirements about destroying their state asynchronously (and not reacting immediately to the SHUTDOWN event). This change will help a bit to make this less weird and surprising.
* client API: rename mpv_detach_destroy() to mpv_destroy()wm42018-03-152-7/+22
| | | | | Since this has clearer semantics now, the old name is just clunky and confusing.
* client API: add mpv_create_weak_client()wm42018-03-152-3/+20
|
* client API: cleanup mpv_handle terminationwm42018-03-151-7/+25
| | | | | | | | | | | | | | | This changes how mpv_terminate_destroy() and mpv_detach_destroy() behave. The doxygen in client.h tries to point out the differences. The goal is to make this more useful to the API user (making it behave like refcounting). This will be refined in follow up commits. Initialization is unfortunately closely tied to termination, so that changes as well. This also removes earlier hacks that make sure that some parts of FFmpeg initialization are run in the playback thread (instead of the user's thread). This does not matter with standard FFmpeg, and I have no reason to care about this anymore.
* client API: deprecate opengl-cb API and introduce a replacement APIwm42018-02-285-3/+491
| | | | | | | | | | | | | | | | | | | | | | | | | The purpose of the new API is to make it useable with other APIs than OpenGL, especially D3D11 and vulkan. In theory it's now possible to support other vo_gpu backends, as well as backends that don't use the vo_gpu code at all. This also aims to get rid of the dumb mpv_get_sub_api() function. The life cycle of the new mpv_render_context is a bit different from mpv_opengl_cb_context, and you explicitly create/destroy the new context, instead of calling init/uninit on an object returned by mpv_get_sub_api(). In other to make the render API generic, it's annoyingly EGL style, and requires you to pass in API-specific objects to generic functions. This is to avoid explicit objects like the internal ra API has, because that sounds more complicated and annoying for an API that's supposed to never change. The opengl_cb API will continue to exist for a bit longer, but internally there are already a few tradeoffs, like reduced thread-safety. Mostly untested. Seems to work fine with mpc-qt.
* client API: clarify license, fix some typoswm42018-02-282-3/+4
|
* vo: make opengl-cb first in the autoprobing orderwm42018-02-131-1/+1
| | | | | | | This should be helpful for the new OSX Cocoa backend, which uses opengl-cb internally. Since it comes with a behavior change that could possibly interfere with libmpv/opengl_cb users, we mark it as explicit API change.
* client API: be more explicit about what can be done in wakeup callbackswm42018-01-252-6/+15
| | | | Don't leave any room for interpretation.
* client API: mention that SIGPIPE is sometimes blockedwm42018-01-181-0/+2
| | | | | | ipc-unix.c does this out of convenience. Since signals are global process state, this deserves a mention, since applications could in theory rely on SIGPIPE being set to something else.
* libmpv/opengl_cb.h: mention OpenGL ES 2.0 supportLeo Izen2018-01-141-3/+4
| | | | | opengl_cb.h should mention GLES 2.0 support, since this support is available. Now it does mention it.
* client API: remove ytdl=no defaultwm42018-01-131-0/+2
| | | | | | | | | | | | | | With the recent changes to the script it does not incur a startup delay by default due to starting youtube-dl and waiting for it. This was the main reason for making libmpv have a different default. Starting sub processes from a library can still be a bit fishy, but I think it's ok. Still mention it in the libmpv header. There were already other cases where libmpv would start its own processes, such as the X11 backend calling xdg-screensaver. (The reason why this is fishy is because UNIX process management sucks: SIGCHLD and the wait() syscall make sub processes non-transparent and could potentially introduce conflicts with code trying to use them.)
* client API: be more explicit about how to make libmpv use config fileswm42018-01-021-1/+5
|
* vo_gpu: make it possible to load multiple hwdec interop driverswm42017-12-011-6/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make the VO<->decoder interface capable of supporting multiple hwdec APIs at once. The main gain is that this simplifies autoprobing a lot. Before this change, it could happen that the VO loaded the "wrong" hwdec API, and the decoder was stuck with the choice (breaking hw decoding). With the change applied, the VO simply loads all available APIs, so autoprobing trickery is left entirely to the decoder. In the past, we were quite careful about not accidentally loading the wrong interop drivers. This was in part to make sure autoprobing works, but also because libva had this obnoxious bug of dumping garbage to stderr when using the API. libva was fixed, so this is not a problem anymore. The --opengl-hwdec-interop option is changed in various ways (again...), and renamed to --gpu-hwdec-interop. It does not have much use anymore, other than debugging. It's notable that the order in the hwdec interop array ra_hwdec_drivers[] still matters if multiple drivers support the same image formats, so the option can explicitly force one, if that should ever be necessary, or more likely, for debugging. One example are the ra_hwdec_d3d11egl and ra_hwdec_d3d11eglrgb drivers, which both support d3d11 input. vo_gpu now always loads the interop lazily by default, but when it does, it loads them all. vo_opengl_cb now always loads them when the GL context handle is initialized. I don't expect that this causes any problems. It's now possible to do things like changing between vdpau and nvdec decoding at runtime. This is also preparation for cleaning up vd_lavc.c hwdec autoprobing. It's another reason why hwdec_devices_request_all() does not take a hwdec type anymore.
* client API: minor bump + change entry for DRM related opengl-cb changeswm42017-10-232-1/+4
| | | | Commit cfcee4cfe705 forgot those.
* Add DRM_PRIME Format Handling and Display for RockChip MPP decodersLionel CHAZALLON2017-10-231-4/+34
| | | | | | | | | | | This commit allows to use the AV_PIX_FMT_DRM_PRIME newly introduced format in ffmpeg that allows decoders to provide an AVDRMFrameDescriptor struct. That struct holds dmabuf fds and information allowing zerocopy rendering using KMS / DRM Atomic. This has been tested on RockChip ROCK64 device.
* client API: more opengl_cb clarificationswm42017-08-071-4/+7
| | | | Also fix a typo in ra_gl.c. Too greedy for a separate commit.
* vo_opengl: move GL state resetting to vo_opengl_cbwm42017-08-051-0/+3
| | | | | | | | | This code is pretty much for the sake of vo_opengl_cb API users. It resets certain state that either the user or our code doesn't reset correctly. This is somewhat outdated. With GL implicit state being so awfully large, it seems more reasonable require that any code restores the default state when returning to the caller. Some exceptions are defined in opengl_cb.h.
* client API: drop old "no-" option emulationwm42017-06-261-1/+1
| | | | | | | You could do mpv_set_option(h, "no-fs", ""), which would behave like "--no-fs" on the command line. At one point, this had to be emulated for compatibility, and printed a deprecation warning. This was almost a year ago, so remove it.
* client API: document mpv_request_log_messages() return valuewm42017-06-141-0/+1
|
* vo_opengl: drop TLS usagewm42017-05-111-1/+1
| | | | | | | | | | | TLS is a headache. We should avoid it if we can. The involved mechanism is unfortunately entangled with the unfortunate libmpv API for returning pointers to host API objects. This has to be kept until we change the API somehow. Practically untested out of pure laziness. I'm sure I'll get a bunch of reports if it's broken.
* client API: add MPV_ENABLE_DEPRECATED symbolwm42017-04-203-1/+33
| | | | | (Of course this is on by default, because otherwise we'd randomly break downstream applications.)
* Fix use of ISC licensewm42017-04-154-31/+15
| | | | | | | | | | The license text refers a "above copyright notice", so I guess it'd be good to actually provide such a notice. Add the license to some files that were missing it (since in theory, our Copyright file says that such files are LGPL by default). Remove the questionable remarks about the license in the client API.
* manpage, client API: add some clarifications when commands use OSDwm42017-04-011-0/+7
| | | | | The APIs that run commands in a more API-like manner disable OSD and string expansion by default.
* input: add "async" flagwm42017-04-011-0/+4
| | | | | | | | | | | Obviously, this has no effect on commands which do not support this explicitly. A later commit will enable this for screenshots. Also add some wording on mpv_command_async(), which has nothing to do with this. Having a more elegant, unified behavior would be nice. But the API function was not created for this - it's merely for running commands _synchronously_ on the core, but without blocking the client API caller (if the API user consistently uses only async functions).
* client API: clarify what stream_cb callbacks can dowm42017-03-171-1/+3
| | | | See #4227.
* client API: update outdated recommendations about window embeddingwm42017-03-022-23/+20
| | | | | | | Basically, the opengl-cb API causes fewer issues, even if it's a bit harder on the API user. See #4197.
* stream_cb: remove leftover doxygen linewm42017-02-201-1/+0
|
* vo_opengl: remove dxva2 dummy hwdec backendwm42017-02-201-20/+3
| | | | | | | | | This was a hack to let libmpv API users pass a d3d device to mpv. It's not needed anymore for 2 reasons: 1. ANGLE does not have this problem 2. Even native GL via nVidia (where this failed) seems to not require this anymore
* vo_opengl: implement videotoolbox hwdec on iOSAman Gupta2017-02-171-0/+1
| | | | | | Implements --hwdec=videotoolbox on iOS. Similar to hwdec_osx.c, but using CVPixelBuffer APIs available on iOS instead of the equivalent IOSurface APIs in macOS.
* client API: adjust opengl_cb hardware decoding commentswm42017-01-261-3/+6
| | | | | | Replace the reprecated --hwdec-preload option. Add a comment about cuvid/cuda decoding.
* client API: correct a comment in the API doxygenwm42017-01-081-2/+1
|
* client API: turn mpv_suspend() and mpv_resume() into stubswm42016-11-221-1/+4
| | | | | | | | | | | As threatened by the API changes document. This commit also removes or stubs equivalent calls in IPC and Lua scripting. The stubs are left to maintain ABI compatibility. The semantics of the API functions have been close enough to doing nothing that this probably won't even break existing API users. Probably.
* Fix some future release version numberswm42016-11-211-2/+2
| | | | | | Since the recent release was named 0.22.0 instead of 0.21.1, bump all mentions of 0.22.0 to 0.23.0. These were planned removals of deprecated versions, which obviously didn't happen in 0.22.0.
* client API: "priority" option is now runtime settablewm42016-09-281-1/+0
| | | | | So it doesn't have to be in the list of options that can be set before mpv_initialize() only.
* qthelper: introduce new convenience functionswm42016-09-261-0/+96
| | | | (Why the heck is the C++ helper not in a separate repository?)
* player: do not let pseudo-gui override user config settingswm42016-09-231-0/+1
| | | | | | | | Seems like this confused users quite often. Instead of --profile=pseudo-gui, --player-operation-mode=pseudo-gui now has to be used to invoke pseudo GUI mode. The old way still works, and still behaves in the old way.
* client API: more or less deprecate mpv_set_option()wm42016-09-211-19/+47
| | | | | | | | | | | | | | | | | | | | | | With the merging of options and properties, the mpv_set_option() function is close to being useless, and mpv_set_property() can be used for everything instead. There are certain conflicts remaining, which are explained in depth in the docs. For now, none of this should affect existing code using the client API. Make mpv_set_property() redirect to mpv_set_option() before initialization. Remove some options marked as M_OPT_FIXED. The "pause" and "speed" options cannot be written anymore without the playloop being notified by it, so the M_OPT_FIXED does nothing. For "vo-mmcss-profile", the problem was lack of synchronization, which has been added. I'm not sure what the problem was with "frames" - I think it was only marked as M_OPT_FIXED because changing it during playback will have no effect. Except for pause/speed, these changes are needed to make them writable as properties after mpv_initialize(). Also replace all remaining uses of CONF_GLOBAL with M_OPT_FIXED.
* client API: declare mpv_suspend/mpv_resume deprecatedwm42016-09-161-0/+5
| | | | | | | They're useless, and I have no idea what they're actually supposed to do (wrt. pending input processing changes). Also remove their implicit uses from the IPC handlers.
* client API: remove SIGPIPE overriding codewm42016-09-151-4/+0
| | | | | | | This workaround prevented that libmpv users could accidentally crash when the SIGPIPE signal was triggered by FFmpeg's OpenSSL/GnuTLS usage. But it also modifies the global signal handler state, so remove it now that this workaround is not required anymore.
* vo_opengl: add hw overlay support and use it for RPIwm42016-09-121-0/+23
| | | | | | | | | | | This overlay support specifically skips the OpenGL rendering chain, and uses GL rendering only for OSD/subtitles. This is for devices which don't have performant GL support. hwdec_rpi.c contains code ported from vo_rpi.c. vo_rpi.c is going to be deprecated. I left in the code for uploading sw surfaces (as it might be slightly more efficient for rendering sw decoded video), although it's dead code for now.
* client API: more option/property updateswm42016-09-031-2/+11
|
* client API: create core thread at an earlier timewm42016-09-011-1/+1
| | | | | | | | | | | | | Create the core thread right in mpv_create(), and reduce what mpv_initialize() does further. This is simpler, and allows the API user to do more before calling mpv_initialize(). The latter is not the real goal, rather we'd like mpv_intialize() reduced to do almost nothing. It still does a lot, but nothing truly special anymore that is absolutely required for basic mpv workings. One thing we want the user to be able to do is changing properties before mpv_initialize() to reduce the special status of mpv_set_option().
* client API: deprecate "no-..." option handlingwm42016-08-311-1/+1
| | | | | | | | The client API can do this (and there are apparently some libmpv using projects which rely on this). But it's just unnecessary bloat as it requires a separate code path from the option parser. It would be better to remove this code. Formally deprecate it, including API bump and warning in the API changes file to make it really clear.
* stream_cb: fix stale commentwm42016-08-081-1/+1
| | | | Oops.
* client API: bump API for stream_cbwm42016-08-071-2/+2
| | | | | | | | | Forgotten in previous commit. Also minor semi-related change: remove the extra "," from the mpv_sub_api enum, which I accidentally added in the previous commit. (C99 is fine with trailing ",", C89 strictly speaking not. So do this for maximum compatibility.)
* client API: add stream_cb API for user-defined stream implementationsAman Gupta2016-08-073-2/+233
| | | | | | Based on #2630. Some heavy changes by committer. Signed-off-by: wm4 <wm4@nowhere>
* client API: fix indentationwm42016-08-071-1/+1
|
* client API: add MPV_ERROR_GENERICwm42016-08-071-1/+5
| | | | Because why not.
* Use - as command-name separator everywhereTimotej Lazar2016-07-141-3/+3
| | | | | | | Old-style commands using _ as separator (e.g. show_progress) were still used in some places, including documentation and configuration files. This commit updates all such instances to the new style (show-progress) so that commands are easier to find in the manual.
* client API: remove "status" log level from mpv_request_event docswm42016-07-081-1/+1
| | | | | | Although it appears to be accepted by the function, MSGL_STATUS messages are never passed to the client API. Consequently "status" has the same meaning as "v" and is useless.
* client API: fully document opengl-cb hardware decoding interopwm42016-06-011-3/+40
| | | | | Document it exhaustively. Most of these issues were basically burried in the code.
* client API: improve mpv_set_property() handling of MPV_FORMAT_NODEwm42016-04-151-2/+12
| | | | | | | | | If a mpv_node wrapped a string, the behavior was different from calling mpv_set_property() with MPV_FORMAT_STRING directly. Change this. The original intention was to be strict about types if MPV_FORMAT_NODE is used. But I think the result was less than ideal, and the same change towards less strict behavior was made to mpv_set_option() ages ago.
* qthelper: fix potential NULL deref in error pathwm42016-03-221-2/+2
| | | | Found by clang-tidy.
* DOCS: add some hints to the new examples repositorywm42016-03-101-1/+2
|
* client API: explain when mpv_create() can return NULLwm42016-02-141-1/+4
|
* Fix some typos in