summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* README: mention some semi-required FFmpeg dependencieswm42018-03-031-0/+4
| | | | | | | | I think DASH playback tends to work much better with FFmpeg's DASH demuxer, which requires libxml2. For nvdec, FFmpeg git master now requires the external nvidia headers, since the builtin ones were removed.
* demux_edl: fix undefined behavior if mp4 init segment is not providedwm42018-03-031-1/+1
| | | | param_names[n] is only valid for n<nparam.
* cocoa-cb: fix building with SDK 10.12 and earlierAkemi2018-03-011-1/+1
| | | | | | | | | the NSWindowButton enum was moved to be a member of NSWindow and renamed to ButtonType in SDK 10.13. apparently that wasn't documented anywhere. not even in the SDK changes Document and the official Documentations makes it look like it was always like this. the old NSWindowButton enum though is still around on SDK 10.13 or at least got a typealias. so we will just use that.
* build: restore alphabetical sort order of file listswm42018-02-281-71/+71
|
* client API: deprecate opengl-cb API and introduce a replacement APIwm42018-02-2823-288/+1267
| | | | | | | | | | | | | | | | | | | | | | | | | 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.
* m_option: remove unneded compatibility featureswm42018-02-282-9/+2
| | | | | Aliases that set old options are not needed anymore. Also extend the total size of the aliases array for one of the following commits.
* vo_gpu: remove a dead declarationwm42018-02-281-1/+0
|
* client API: clarify license, fix some typoswm42018-02-282-3/+4
|
* osdep/atomic: add emulation for atomic_exchange()wm42018-02-281-0/+7
|
* osdep/atomic: fix potential shadowing warningswm42018-02-281-8/+8
| | | | | | | The stdatomic emulation adds "_" to each variable used inside the macros, to avoid that compilers print -Wshadow warnings for identifiers that are also used in surrounding code. Do this more consistently, because new warnings have been showing up.
* cocoa-cb: make fullscreen resize animation duration configurableAkemi2018-02-283-2/+30
|
* cocoa-cb: fix stretched gl surface on window aspect ratio changeAkemi2018-02-282-2/+48
| | | | | | | | when resizing async it's possible that the layer, and the underlying gl surface, is stretched on an aspect ratio change. to prevent that we do an atomic resize (resize and draw at the same time). usually max one unique frame should be dropped but it's possible, depending on the performance, that more are dropped.
* cocoa-cb: change border and borderless window stylingAkemi2018-02-289-20/+158
| | | | | | | | | | | the title bar is now within the window bounds instead of outside. same as QuickTime Player. it supports several standard styles, two dark and two light ones. additionally we have properly rounded corners now and the borderless window also has the proper window shadow. Also make the earliest supported macOS version 10.10. Fixes #4789, #3944
* drm_common: Improve VT switching signal handling somewhatAnton Kindestam2018-02-261-1/+15
| | | | | | | | By blocking the VT switcher signal in the VO thread we get less races and other oddities. This gets rid of tearing (at least for me) when VT switching with --gpu-context=drm.
* vo_drm: Fix pageflip errors on VT switchAnton Kindestam2018-02-261-2/+5
| | | | | | | | crtc_setup gets called on VT reacquire as well as during normal setup. When called during VT reacquire p->front_buf might not be 0, so the maths was wrong, and could cause array OOB errors. Use mathematically correct (for negative numbers) modulo to always pick the farthest away buffer (should work even for larger values of BUF_COUNT).
* context_drm_egl: Repair VT switchingAnton Kindestam2018-02-261-2/+27
| | | | | | | | | | | | | The VT switcher was being set up, but it was being neither polled nor interrupted. Insert wait_events and wakeup functions based on those from vo_drm, and add return early in drm_egl_swap_buffers if p->active isn't set. This should get basic VT switching working, however there will likely still be some random glitches. Switching between mpv and X11/weston is unlikely to work satisfactorily until we can solve the problems with drmSetMaster and drmDropMaster.
* context_drm_egl: Introduce 30bpp supportAnton Kindestam2018-02-264-30/+103
| | | | | | | | | | | | | This introduces the option --drm-format (currently used only by context_drm_egl, vo_drm implementation is pending) which allows you to pick between a xrgb8888 or a xrgb2101010 visual for --gpu-context=drm. Requires a recent mesa (18.0.0_rc4 or later) to work. This also fixes a bug when using --gpu-context=drm on a 30bpp-enabled mesa (allow_rgb10_configs set to true). Previously it would've set up an XRGB8888 format at the DRM/GBM level, while a 30bpp EGLConfig would be picked, resulting in a garbled image.
* egl_helpers: mpegl_cb can now signal an error conditionAnton Kindestam2018-02-262-1/+8
| | | | | This can be used by client code that needs to fail when it cannot find a suitable EGLConfig.
* cocoa-cb: fix wrong fullscreen window sizeAkemi2018-02-252-11/+21
| | | | | | | | | | | | | | | | | | | even though the fullscreen animation has a shorter duration than the system wide animation (space sliding effect) there are still cases where it takes longer, eg performance issues (especially on init). furthermore the final size of the animation is usually different than the actual fullscreen size because of spect ratio differences. the actual resize to fullscreen is done automatically by cocoa itself when the actual transition to fullscreen happens (system event). so it could happen that the last animation resize happened after the actual resize to fullscreen leading to a wrongly sized frame after entering fullscreen. to prevent this we cancel the animation when entering fullscreen, we always set the proper frame size when in fullscreen and discard any other frame sizes, and to prevent some performance problems on init we push entering fullscreen to the end of the main queue to execute it when most of the init routines are done. Fixes #5525
* cocoa-cb: fix wrong drawing size on resizeAkemi2018-02-251-17/+12
| | | | | | on live resize, eg async resize, the layer's bounds size is not in sync with the actual surface size. this led to a wrongly sized frame and a perceived flicker. get and use the actual surface size instead.
* vo_gpu: fix mobius tone mapping when sig_peak <= 1.0Niklas Haas2018-02-251-0/+2
| | | | | | | Mobius isn't well-defined for sig_peak <= 1.0. We can solve this by just soft-clamping sig_peak to 1.0. Although, in this case, we can just skip tone mapping altogether since the limit of mobius as sig_peak -> 1.0 is just a linear function.
* vo_gpu: don't tone-map for pure gamut reductionsNiklas Haas2018-02-251-3/+0
| | | | | | | | | Based on testing with real-world non-HDR BT.2020 clips, clipping the color space looks better than attempting to gamut map using a tone mapping shader that's (by now) optimized for HDR content. If anything, we'd have to develop a separate gamut mapping shader that works in LCh space.
* stream_file: add mode for reading appended fileswm42018-02-212-7/+61
| | | | | | | | | | | | | Do this because retrying reading on higher levels (like the demuxer) usually causes tons of problems. A hack like this is simpler and could allow to remove some of the higher level retry behavior. This works by trying to detect whether the file is appended. If we reach EOF, check if the file size changed compared to the initial value. If it did, it means the file was appended at least once, and we set the p->appending flag. If that flag is set, we simply retry reading more data every time we encounter EOF. The only way to do this is polling, and we poll for at most 10 times, after waiting for 200ms every time.
* audio: improve behavior if filters output nothing during probingwm42018-02-212-1/+9
| | | | | | | | | | Just bail out immediately (and disable audio) if format probing has no result, instead of doing nothing and then apparently freezing. This can happen with bogus filters, cases where the first audio frame is essentially dropped by filters (can happen with large resampling factors), and if the audio track contains no packets at all, or all packets fail to decode.
* cocoa-cb: fix invalid framebuffer operation errorAkemi2018-02-211-1/+5
| | | | | | | | | in certain circumstances the returned fbo for drawing is 0, but that fbo is solely used internally by the CAOpenGLLayer for its drawing and should never be used. in that case we fallback to 1 or the last used fbo instead if it was not 0. Fixes #5546
* drm_vo: pixel aspect from --monitoraspectMarco Migliori2018-02-211-1/+7
| | | | | | | | | | | | | | | | | When pixels are non-square, the appropriate value of vo->monitor_par is necessary to determine the destination rectangle, which in turn tells how to scale the video along the x and y axis. Before this commit, the drm driver only used --monitorpixelaspect. For example, to play a video with the right aspect on a 4:3 screen and 640:400 pixels, --monitorpixelaspect=5:6 had to be given. With this commit, vo->monitor_par is determined from the size of the screen in pixels and the --monitoraspect parameter. The latter is usually easier to determine than --monitorpixelaspect, since it is simply the proportion between the width and the height of the screen, in most cases 16:9 or 4:3. If --monitoraspect is not given, --monitorpixelaspect is used if given, otherwise pixel aspect is assumed 1:1.
* vf_vapoursynth: fix freezewm42018-02-201-5/+7
| | | | | | | Commit 59f9547fb56b missed this case, in which we can't make new progress and have to exit. Fixes #5548.
* vo_gpu: introduce --target-peakNiklas Haas2018-02-204-7/+49
| | | | | | | | | | | | | This solves a number of problems simultaneously: 1. When outputting HLG, this allows tuning the OOTF based on the display characteristics. 2. When outputting PQ or other HDR curves, this allows soft-limiting the output brightness using the tone mapping algorithm. 3. When outputting SDR, this allows HDR-in-SDR style output, by controlling the output brightness directly. Closes #5521
* vo_gpu: correctly parametrize the HLG OOTF by the display peakNiklas Haas2018-02-201-20/+31
| | | | | | | | | | | | | | The HLG OOTF is defined as a one-parameter family of OOTFs depending on the display's peak luminance. With the preceding change to OOTF scale and handling, we no longer have any issues with outputting values in whatever signal range we need. So as a result, it's easy for us to support a tunable OOTF which may (drastically) alter the display brightness. In fact, this is also the only correct way to do it, because the HLG appearance depends strongly on the OOTF configuration. For the OOTF, we consult the mastering display's tagging (via src.sig_peak). For the inverse OOTF, we consult the output display's target peak.
* vo_gpu: simplify and correct color scale handlingNiklas Haas2018-02-203-33/+40
| | | | | | | | | | | | | | | | | | | | | | | | | The primary need for this change is the fact that the OOTF was incorrectly scaled, due to the fact that the application of the OOTF can itself change the required normalization peak. (Plus, an oversight in pass_inverse_ootf meant we forgot to normalize at the end of it) The linearize/delinearize functions still normalize the scale since it's used in a number of places throughout gpu/video.c, but the color management function now converts to absolute scale right away, instead of in an awkward way inside the tone mapping branch. The OOTF functions now work in absolute scale only. In addition, minor changes have been made to the way normalization is handled for tone mapping - we now divide out the dst_peak *after* peak detection, in order to make the scale of the peak detection buffer consistent even if the dst_peak were to (hypothetically) change mid-stream. In theory, we could also do this for desaturation, but doing the desaturation before tone mapping has the advantage of preserving much more brightness than the other way around - and even mid-stream changes are not that drastic here. Finally, some preparation work has been done for allowing the user to customize the `dst.sig_peak` in the future.
* vo_mediacodec_embed: fix forgotten VO_CAP_NOREDRAW→VO_CAP_NORETAINJan Ekström2018-02-201-1/+1
| | | | Fixes compilation of this module.
* video: fix --video-rotate in some caseswm42018-02-181-1/+1
| | | | Which idiot wrote this code? [Yeah, me.]
* cocoa-cb: fix hwdec when drawing off-screenAkemi2018-02-171-0/+1
| | | | | | | | | drawing off-screen failed because we didn't have a valid context. the problem is we force off-screen drawing because the CAOpenGLLayer refuses to draw anything while being off-screen. set the current context before starting to draw anything off-screen. Fixes #5530
* video: do not buffer extra frames with VO_CAP_NORETAIN outputsAman Gupta2018-02-171-0/+3
| | | | | | | | | | | | | | This fixes playback stalls on some mediacodec hardware decoders, which expect that frame buffers will be rendered and returned back to the decoder as soon as possible. Specifically, the issue was observed on an NVidia SHIELD Android TV, only when playing an H264 sample which switched between interlaced and non-interlaced frames. On an interlacing change, the decoder expects all outstanding frames would be returned to it before it would emit any new frames. Since a single extra frame always remained buffered by mpv, playback would stall. After this commit, no extra frames are buffered by mpv when using vo_mediacodec_embed.
* video: rename VO_CAP_NOREDRAW to VO_CAP_NORETAINAman Gupta2018-02-172-4/+4
|
* vo_gpu: hwdec_drmprime_drm: cosmetic simplificationwm42018-02-161-6/+3
| | | | | | Coverity complained about the redundant init of hratio etc. - just remove that and merge declaration/init of these variables. Also the first double cast in each expression is unnecessary.
* filter: fix potential NULL pointer derefwm42018-02-161-1/+1
| | | | | | The rest of the function should be executed only if both are set. It seems like in practice this didn't happen yet with only one of them unset, but in theory it's possible. Found by Coverity.
* command: simplify mp_property_filter_metadatawm42018-02-161-19/+11
| | | | Also silence a dead code coverity error.
* github: recommend 0x0.st rather than sprunge.us for logfilesKevin Mitchell2018-02-161-1/+1
| | | | The latter seems to give 500 errors more often than not these days.
* build: fix dependency check on macOSAkemi2018-02-162-9/+8
| | | | | | | 235eb60 added a needed linking flag, but too soon. this lead to some of the configure checks to fail. add the flag in our build phase. Fixes #5528
* cocoa-cb: fix drawing on macOS 10.11Akemi2018-02-161-3/+19
| | | | | | | | | the CVDisplayLinkSetOutputHandler function introduced with 10.11 is broken on the very same version of the OS, which caused our render loop never to start. fallback to the old display link callback on 10.11. for reference the radar http://www.openradar.me/26640780 Fixes #5527
* build: fix linking libmpv when swift features are builtAkemi2018-02-132-0/+3
| | | | | | | | the swift object file wasn't linked when libmpv was linked, which resulted in a missing symbol error. add the swift object to the linking list for libmpv too. Fixes #5522
* build: remove shell usage from swift build scriptsAkemi2018-02-131-4/+5
| | | | | | | for convenience reasons i used strings for subprocess commands instead of command lists, which made it mandatory to use a shell. for security reasons, among others, we removed the shell usage and converted the commands to actual command lists.
* build: fix swift detection with python2Akemi2018-02-131-6/+2
| | | | | | | | | c82fed8 fixed the detection with python3 but broke it on python2. the decode function on python2 converts the str to unicode which causes problems when concatenating to str when building. instead of decoding the output we change the subprocess to operate in text mode. also use check_output instead of Popen for simplicity.
* lua+js: Implement utils.getpid()sfan52018-02-135-0/+51
| | | | | | | Usable for uniquely identifying mpv instances from subprocesses, controlling mpv with AppleScript, ... Adds a new mp_getpid() wrapper for cross-platform reasons.
* vo_gpu: remove old window screenshot glue code and GL implementationwm42018-02-134-42/+0
| | | | | | | | | | | There is now a better way. Reading the font framebuffer was always a hack. The new code via VOCTRL_SCREENSHOT renders it into a FBO, which does not come with the disadvantages of reading the front buffer (like not being supported by GLES, possibly black regions due to overlapping windows on some systems). For now keep VOCTRL_SCREENSHOT_WIN on the VO level, because there are still some lesser VOs and backends that use it.
* f_lavfi: extend filter help outputwm42018-02-131-1/+41
| | | | | | Also print type and help string. Also print AV_OPT_TYPE_CONST, which are like the mpv choice option type, except different. Print them as separate lines because FFmpeg usually has help strings for them too.
* options: minor cleanup to --no-... handlingwm42018-02-133-7/+14
| | | | | | | | Most options starting with --no-<name> are automatically translated to --<name>=no. Make the code slightly nicer by using a flag instead of explicitly comparing option types. Also fix an issue that made the option parser print nonsense error messages for if --no-... was used for options which don't support it.
* options: prefix option with "--" in one case in help outputwm42018-02-131-1/+1
|
* vo: make opengl-cb first in the autoprobing orderwm42018-02-134-5/+12
| | | | | | | 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.
* Fix recent FFmpeg deprecationswm42018-02-137-56/+56
| | | | | | | | | This includes codec/muxer/demuxer iteration (different iteration function, registration functions deprecated), and the renaming of AVFormatContext.filename to url (plus making it a malloced string). Libav doesn't have the new API yet, so it will break. I hope they will add the new APIs too.
* filter: extend documentation commentswm42018-02-131-6/+43
| | | | Add more explanations, and also fix some blatantly wrong things.
* filter: simplify/fix external filter graph usagewm42018-02-131-34/+37
| | | | | | | | | | | | | | | | There was the following problem: if a filter graph had asynchronous filters, and the filter graph user did not call mp_filter_run() (and only accessed the mp_pins), then filtering could stall, because using mp_pin_out_request_data() only recursively invoked filtering if the data_requested flag wasn't already set. The latter can happen if a request was tried earlier but failed, and then an asynchronous filter actually produced output that would satisfy the request. Obviously, it has to invoke filtering again to get the requested frame. Fix this by organizing the code differently, and making sure to invoke mp_filter_run() on every request (if there's nothing to do, it doesn't do anything anyway). Simplify it a bit by removing things which are not needed, like connecting filter graphs with different root filters.
* audio: don't touch spdif frames in mp_aframe_clip_timestamps()wm42018-02-131-0/+3
| | | | It can't work for this type of format.
* f_lavfi: fix typo in commentwm42018-02-131-1/+1
|
* demux: lower demuxer cache default sizeswm42018-02-131-2/+2
| | | | | | | | | Reduce backward/forward from 400MB/400MB to 50MB/150MB. Too many complaints about high memory usage. Note that external tracks (like ytdl DASH with external audio tracks) will double the amounts, because an external track uses its own demuxer and cache.
* filter: adjust root log prefixwm42018-02-131-2/+3
| | | | | | | | | | Avoids that the audio decoder shows up with a "[root/ad]" log prefix. This is an annoying consequence of mp_log_new(): if a log parent doesn't have a prefix with "!", it'll add the prefix to all mp_logs created from it. This should probably be fixed in the mp_log code itself, but doing so would be a big deal as we'd have to make sure all the other log prefixes are what we want. So work it around for now.
* vf_vavpp: select best quality deinterlacing algorithm by defaultwm42018-02-133-6/+28
| | | | | | | | This switches the default away from "bob" to the best algorithm reported as supported by the driver. This is convenient for users, and there is no reason to use something worse by default. Untested.
* manpage: remove mention of --vf=eqwm42018-02-131-1/+1
| | | | This doesn't work anymore.
* input: add a keybinding to toggle hardware decodingwm42018-02-133-0/+5
| | | | | We sure as hell won't enable hardware decoding by default, but we can make it more accessible with a key binding.
* video: make --deinterlace and HW deinterlace filters always deinterlace