summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* sub: fix --sub-gausswm42016-06-174-51/+37
| | | | | | | | | | | | | | | | | | | | Implement it directly in sd_lavc.c as well. Blurring requires extending the size of the sub-images by the blur radius. Since we now want sub_bitmaps to be packed into a single image, and we don't want to repack for blurring, we add some extra padding to each sub-bitmap in the initial packing, and then extend their size later. This relies on the previous bitmap_packer commit, which always adds the padding in all cases. Since blurring is now done on parts of a large bitmap, the data pointers can become unaligned, depending on their position. To avoid shitty libswscale printing a dumb warning, allocate an extra image, so that the blurring pass is done on two newly allocated images. (I don't find this feature important enough to waste more time on it.) The previous refactor accidentally broke this feature due to a logic bug in osd.c. It didn't matter before it happened to break, and doesn't matter now since the code paths are different.
* sub: move paletted image handling completely to sd_lavc.cwm42016-06-176-119/+89
| | | | | | | | | | | | | | | | | | | Until now, subtitle renderers could export SUBBITMAP_INDEXED, which is a 8 bit per pixel with palette format. sd_lavc.c was the only renderer doing this, and the result was converted to RGBA in every use-case (except maybe when the subtitles were hidden.) Change it so that sd_lavc.c converts to RGBA on its own. This simplifies everything a bit, and the palette handling can be removed from the common code. This is also preparation for making subtitle images refcounted. The "caching" in img_convert.c is a PITA in this respect, and needs to be redone. So getting rid of some img_convert.c code is a positive side- effect. Also related to refcounted subtitles is packing them into a single mp_image. Fewer objects to refcount is easier, and for the libass format the same will be done. The plan is to remove manual packing from the VOs which need single images entirely.
* bitmap_packer: make manual use slightly more convenientwm42016-06-171-12/+14
| | | | | | | | | | | | | | | | | Apply the padding internally to each input bitmap, instead of requiring this for the semi-public API. Right now, everything still uses packer_pack_from_subbitmaps() to fill the input bitmap sizes, but that's going to change with the following commit. Since bitmap_packer.in is mutated during packing anyway, it's more convenient to add the padding automatically. Also, guarantee that every sub-bitmap has a padding border around it. Don't let the padding overlap. Add padding even on the containing borders. This is simpler, doesn't cost much in memory usage, and is convenient for one of the following commits.
* sd_lavc: move AVSubtitle bitmap setup code into its own functionwm42016-06-171-34/+44
| | | | No functional changes.
* Add github issue and pull request templateswm42016-06-173-32/+21
| | | | | | | I do not understand why github requires adding this crap to source code repositories themselves, instead of making them part of the repository configuration. Remove CONTRIBUTING.md to compensate for github crap accumulating.
* d3d11va: remove unused d3d11va_surface.subindex fieldwm42016-06-161-3/+1
| | | | This is now stored within the AVFrame/mp_image.
* vf_d3d11vpp: flush device context only when using shared textureswm42016-06-161-1/+2
| | | | Reduces interference with pass-through case, where this is not needed.
* vf_d3d11vpp: make missing deinterlacing caps non-fatalwm42016-06-161-3/+2
| | | | Instead, warn.
* vf_d3d11vpp: log some video processor creation parameterswm42016-06-161-2/+7
|
* vo_opengl: use EXT_disjoint_timer_query for timersJames Ross-Gowan2016-06-151-0/+16
| | | | | | This is the ES equivalent to ARB_timer_query. It enables the performance timers on ANGLE. All the added functions should be identical in semantics to their desktop GL equivalents.
* vo_opengl: fix framebuffer object namewm42016-06-151-3/+4
| | | | | | | | | The OpenGL 3.0+ and ES specs are quite clear on what values are accepted for the attachment object name parameter. And there's no overlap for the default framebuffer. Sigh. Probably fixes Mesa raising an error in this case and might fix #3251. Regression by the previous vo_opengl change.
* demux_mkv: support Matroska webvttwm42016-06-141-0/+1
| | | | | | | They're different from the Google/WebM subtitle types, and use a new codec ID. Fixes #3247.
* vo_opengl: use standard functions to retrieve display depthwm42016-06-1410-59/+21
| | | | | | | | | | | | | Until now, we've used system-specific API (GLX, EGL, etc.) to retrieve the depth of the default framebuffer. (We equal this to display depth and use the determined depth for dithering.) We can actually retrieve this value through standard GL API, and it works everywhere (except GLES 2 of course). This simplifies everything a great deal. egl_helpers.c is empty now. But I expect that some EGL boilerplate will be moved to it, so don't remove it yet.
* vo_opengl: hwdec_d3d11egl: remove ES2 swizzle special-casewm42016-06-131-2/+2
| | | | | | | | This was somehow done under the assumption that ANGLE would somehow always use RG in ES2 mode. But there's no basis for this. Even if ANGLE supports NV12 textures with drivers that do not allow for texture_rg, this cas eis too obscure to worry about. So do the robust and correct thing instead, and disable this code if texture_rg is not available.
* vo_rpi: fix destroying overlaysGusar3212016-06-131-0/+3
| | | | | | | Commit 74e3d11 resulted in the background overlay not getting destroyed when mpv quits. Add back a piece of code that was removed in that commit to restore correct functionality. Fixes issue #3100
* audio: apply an upper bound timeout when drainingwm42016-06-121-3/+13
| | | | | | | | | | | | | | | | | | | | | | | | This helps with shitty APIs and even shittier drivers (I'm looking at you, ALSA). Sometimes they won't send proper wakeups. This can be fine during playback, when for example playing video, because mpv still will wakeup the AO outside of its own wakeup mechanisms when sending new data to it. But when draining, it entirely relies on the driver's wakeup mechanism. So when the driver wakeup mechanism didn't work, it could hard freeze while waiting for the audio thread to play the rest of the data. Avoid this by waiting for an upper bound. We set this upper bound at the total mpv audio buffer size plus 1 second. We don't use the get_delay value, because the audio API could return crap for it, and we're being paranoid here. I couldn't confirm whether this works correctly, because my driver issue fixed itself. (In the case that happened to me, the driver somehow stopped getting interrupts. aplay froze instead of playing audio, and playing audio-only files resulted in a chop party. Video worked, for reasons mentioned above, but drainign froze hard. The driver problem was solved when closing all audio output streams in the system. Might have been a dmix related problem too.)
* audio: do not wake up core during EOFwm42016-06-121-3/+4
| | | | | | | | | | | | | When we're draining, don't wakeup the core on every buffer fill, since unlike during normal playback, we won't actually get more data. The wakeup here conceptually works like wakeups with condition variables, so redundant wakeups do not hurt, so this is just a minor change and nothing of consequence. (Final EOF also requires waking up the core, but there is separate code to send this notification.) Also dump the p->still_playing field in trace logging.
* vo_opengl: make size of OUTPUT available to user shadersBin Jin2016-06-122-3/+12
|
* player: fix previous commitwm42016-06-121-0/+3
| | | | | | | Of course we can't just skip updating the OSD if the playloop was woken up for the purpose of removing OSD after an OSD timer expired. Fixes e.g. OSD bars sometimes sticking along when seeking while paused.
* player: do not update OSD all the time when pausedwm42016-06-113-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | Normally, OSD is updated every time the playloop is run. This has to be done, because the OSD may implicitly reference various properties, without knowing whether they really need to be updated or not. (There's a property update mechanism, but it's mostly unavailable, because OSD is special-cased and can not use the client API mechanism properly.) Normally, these updates are no problem, because the OSD is only actually printed when the OSD text actually changes. But commit d23ffd24 added a rate-limiting mechanism, which tries to limit OSD updates at most every 50ms (or the next video frame). Since it can't know in advance whether the OSD is going to change or not, this simply waked up the player every 50ms. Change this so that the player is updated only as part of general updates determined through mp_notify(). (This function also notifies the client API of changed properties.) The desired result is that the player will not wake up at all in normal idle mode, but still update properties that can change when paused, such as the cache. This is mostly a cosmetic change (in the sense of making runtime behavior just slightly better). It has the slightly more negative consequence that properties which update implicitly (such as "clock") will not update periodically anymore.
* win32: use HINST_THISCOMPONENTJames Ross-Gowan2016-06-112-9/+13
| | | | | | | | | | | | | | | This is a common idiom used in MSDN docs and Raymond Chen's example programs to get a HINSTANCE for the current module, regardless of whether it's an .exe or a .dll. Using GetModuleHandle(NULL) for this is technically incorrect, since it always gets a handle to the .exe, even when the executing code (in libmpv) is running in a .dll. In this case, using the wrong HINSTANCE could cause namespace issues with window classes, since CreateWindowEx uses the HINSTANCE to search for the matching window class name. See: https://blogs.msdn.microsoft.com/oldnewthing/20050418-59/?p=35873 https://blogs.msdn.microsoft.com/oldnewthing/20041025-00/?p=37483
* cocoa: use displaylink without manually tracking the display idStefano Pigozzi2016-06-111-5/+6
| | | | | Maybe it partially helps with #2392 (on dual display setups). Either way, it makes the code simpler.
* vo_sdl: fix pixel formats.Rudolf Polzer2016-06-101-12/+9
| | | | | | | | | | | There were two mistakes: - SDL's RGB565 is always equivalent to ffmpeg's RGB565 (both are packed 16bit native-endian integers in RGB=565 form) - this was wrongly reversed on big endian platforms. - SDL's RGB888 doesn't actually mean RGB24, but XRGB8888 (i.e. 32bit packed integer, top 8 bits unused). - Use RGB0 not RGBA when there is no alpha.
* vo_opengl: request core profile on X11/EGL toowm42016-06-101-0/+11
| | | | Avoids that some OpenGL implementation will pin it to 3.0.
* vo_opengl: increase the size limit for cached fileBin Jin2016-06-101-1/+1
| | | | | | This is mainly for the nnedi3 user shader. With all whose NN weights hardcoded into the shader source code, the shader file could be as large as 300 kB.
* Revert "wscript: Require recent FFmpeg by default"wm42016-06-091-45/+24
| | | | | | | This reverts commit b51957fab59fd5a2fde824e1946befd29ed172c1. Breaks big time. It appears to ignore explicitly configured paths within the libav* .pc files, which for example breaks mpv-build.
* vo_opengl: hwdec_d3d11eglrgb: remove some more unused fieldswm42016-06-091-30/+0
| | | | Not sure what/if I was thinking there.
* vo_opengl: fix d3d11 hardware decoding probing on Windows 7wm42016-06-095-0/+39
| | | | | | | | | | | | | | | Although D3D11 video decoding is unuspported on Windows 7, the associated APIs almost work. Where they fail is texture creation, where we try to create D3D11_BIND_DECODER surfaces. So specifically try to detect this situation. One issue is that once the hwdec interop is created, the damage is done, and it can't use another backend (because currently only 1 hwdec backend is supported). So that's where we prevent attempts to use it. It still can fail when trying to use d3d11va-copy (since that doesn't require an interop backend), but at that point we don't care anymore - dxva2(-copy) is tried before that anyway.
* vo_opengl: hwdec_d3d11eglrgb: remove unused fieldswm42016-06-091-3/+0
| | | | Leftovers.
* wscript: Require recent FFmpeg by defaultMartin Herkt2016-06-091-24/+45
| | | | | | | | Distros and users alike should be made aware of the fact that old FFmpeg versions are bad. When users come to us with FFmpeg-related trouble, the answer is “update FFmpeg” more often than not (and no further support will be provided until they have done so), so instead we just nag them about it here.
* vo_opengl: hwdec_vdpau: remove minor code duplicationwm42016-06-081-13/+11
| | | | | Move unmap() to the top of the function, and replace some duplicated code with a call to it.
* vo_opengl: refactor performance data propertiesNiklas Haas2016-06-083-67/+74
| | | | | | | | | | | | | | | Instead of having 9 different properties, requiring 18 different VOCTRLs to read them all, they are now exposed as a single property. This is not only cleaner (since they're all together) but also allows querying all 9 of them with only a single VOCTRL (by using mp.get_property_native). (The extra factor of 2 was due to an extra query being needed to get the type, which is now also unnecessary) This makes it much easier to access performance metrics from within a lua script, and also makes it easier to just show a readable, formatted version via show-text.
* vo_opengl: make user hook passes optionalNiklas Haas2016-06-084-20/+83
| | | | | | | | | | | | | | | | User hooks can now use an extra WHEN expression to specify when the shader should be run. For example, this can be used to only run a chroma scaling shader `WHEN CHROMA.w LUMA.w <`. There's a slight semantics change to user shaders: When trying to bind a texture that does not exist, a shader will now be silently skipped (similar to when the condition is false) instead of generating an error. This allows shader stages to depend on an optional earlier stage without having to copy/paste the same condition everywhere. (In other words: there's an implicit condition on all of the bound textures existing)
* vo_opengl: do not leak previous FBO when reallocating itwm42016-06-081-0/+2
| | | | WTF of the day.
* hwdec_d3d11eglrgb: reduce log level when probingJames Ross-Gowan2016-06-091-3/+5
| | | | | | | | | | When using --hwdec=auto, systems that don't provide D3D11_CREATE_DEVICE_VIDEO_SUPPORT, which probably includes all Windows Vista and 7 systems, will print an error message. Reduce the log level to verbose when probing and skip the error message entirely if d3d11.dll is not present. This commit is in a similar spirit to 991af7d.
* vo_opengl: hwdec_d3d11egl: remove broken code on error pathwm42016-06-081-1/+0
| | | | | If ID3D11Device_QueryInterface fails, "multithread" will be set to NULL. The _Release would just make it crash with a null pointer deref.
* player: remove unused return valuewm42016-06-081-6/+3
|
* player: tell user about --force-seeking if demuxer is not seekablewm42016-06-081-1/+2
| | | | | | | | | | | | | This comes up often, see e.g. #3220. The issue is that if the stream input is not seekable, the demuxer is marked as not seekable. But if the stream cache is enabled, the file still _might_ be seekable to a degree. We recently disabled seeking in this mode because it can cause very weird issues, mostly because if stream-layer seeking fails, the demuxers will arbitrarily misbehave. On the other hand, it can work if the seek is within the cached range, which is why the user can still enable it with --force-seeking. There is a weird trade-off between allowing this and not crapping up too easily, so just informing the user about the possibility seems best.
* demux_lavf: assume fully read files (subtitles) are always seekablewm42016-06-081-0/+1
| | | | | | | Since the libavformat API is crap, we have to apply tons of heuristics to check whether seeking will work. (No, checking it at seek time isn't going to work either, because if a seek fails, the demuxer will be in an undefined state. Because the libavformat API is crap.)
* waftools: remove trailing newlinestepshal2016-06-081-1/+0
|
* demux: fix memory leak when loading of ordered chapter file is abortedwm42016-06-071-0/+1
|
* build: silence -Wunused-resultNiklas Haas2016-06-0710-17/+19
| | | | | | | | For clang, it's enough to just put (void) around usages we are intentionally ignoring the result of. Since GCC does not seem to want to respect this decision, we are forced to disable the warning globally.
* vo_opengl: avoid outputting ultra-wide-gamut by defaultNiklas Haas2016-06-071-1/+13
| | | | | | | | | | | | The default behavior of vo_opengl has pretty much always been 'show the source colors as-is, without caring to adapt it to the target device'. This decision is mostly based on the fact that if we do anything else, lots of people will complain. With the rise of content like BT.2020, however, it turns out more people complain about this content being very desaturated than people complain about this content not matching VLC - so let's just map ultra-wide gamut content back down to standard gamut by default.
* vo_opengl: also collect upload perfdata for hwdecNiklas Haas2016-06-071-0/+4
| | | | | | Instead of measuring the actual upload time, this instead measures the time needed to render + map the texture via vdpau. These numbers are still useful, since they're part of the critical path.
* vo_opengl: expose performance timers as propertiesNiklas Haas2016-06-076-0/+101
| | | | | | | | | | | This is plumbed through a new VOCTRL, VOCTRL_PERFORMANCE_DATA, and exposed as properties render-time-last, render-time-avg etc. All of these numbers are in microseconds, which gives a good precision range when just outputting them via show-text. (Lua scripts can obviously still do their own formatting etc.) Signed-off-by: wm4 <wm4@nowhere>
* vo_opengl: add time queriesNiklas Haas2016-06-075-0/+208
| | | | | | | | | | | | | | | | | | To avoid blocking the CPU, we use 8 time objects and rotate through them, only blocking until the last possible moment (before we need access to them on the next iteration through the ring buffer). I tested it out on my machine and 4 query objects were enough to guarantee block-free querying, but the extra margin shouldn't hurt. Frame render times are just output at the end of each frame, via MP_DBG. This might be improved in the future. (In particular, I want to expose these numbers as properties so that users get some more visible feedback about render times) Currently, we measure pass_render_frame and pass_draw_to_screen separately because the former might be called multiple times due to interpolation. Doing it this way gives more faithful numbers. Same goes for frame upload times.
* dxva2: remove dead code in failure caseJames Ross-Gowan2016-06-071-3/+0
| | | | | This was made unnecessary by a02d77b, since the only way the function could fail was by failing to add a reference to the DirectX DLLs.
* vo_opengl: angle: prevent DXGI hooking Alt+EnterJames Ross-Gowan2016-06-071-0/+73
| | | | | | | | | | When ANGLE is using D3D11 and not running in DirectComposition mode, DXGI will hook the video window's message loop and override Alt+Enter to trigger a transition to exclusive fullscreen mode (which doesn't even work with mpv's renderer for some reason.) This behaviour can be disabled by getting a pointer to the IDXGIFactory associated with the D3D11 device and calling MakeWindowAssociation with the appropriate flags.
* ao_wasapi: initialize COM in main thread with MTAKevin Mitchell2016-06-051-2/+2
| | | | | | Since the main thread is shared by other things in the player, using STA (single threaded aparement) may have caused problems. Instead initialize in MTA (multithreaded apartment).
* vo_opengl: apply vo-cmdline command incrementallywm42016-06-054-27/+31
| | | | | | | | | | Instead of implicitly resetting the options to defaults and then applying the options, they're always applied on top of the current options (in the same way adding new options to the CLI command line will). This does not apply to vo_opengl_cb, because that has an even worse mess which I refuse to deal with.
* vo_opengl_cb: icc-profile-auto does not and will not workwm42016-06-051-0/+2
| | | | | In theory we could probably make icc-profile-auto a vo_opengl-specific option, but I won't bother with this. Logging an error is simpler.
* vo_opengl: possibly update icc profile after changing optionswm42016-06-051-7/+12
| | | | | Changing the options can enable icc-profile-auto, and in this case the profile has to be reteieved again from the system.
* vo_opengl: somewhat simplify suboption handling messwm42016-06-042-78/+53
| | | | | | | | | | | | | | | Enable m_sub_options_copy() to copy nested sub-options, and also enable it to create an option struct from defaults. We can get rid of most of the crap in assign_options() now. Calling handle_scaler_opt() to get a static allocation for scaler name is still needed. It's moved to reinit_scaler(), which seems to be a better place for it. Without it, dangling pointers could be created when options are changed. (And in fact, this fixes possible dangling pointers for window.name.) In theory we could create a dynamic copy, but that seemed even more messy. Chance of regressions.
* vo_opengl: cleanup icc + runtime option changing behaviorwm42016-06-043-43/+72
| | | | | | | | | | | | | | Commit 026b75e7 actually enabled changing icc options at runtime (via vo_cmdline), but it didn't quite work. In particular, changing the icc- profile option just kept the old profile, because it was cached accordingly. As part of this, change gl_lcms.opts from a struct to a pointer to a struct. We properly copy it, instead of allowing possibly dangling strings, like it was done in a working but unclean way before. Also, reinit the whole rendering chain when the auto icc profile changes, just like it's done when icc options are changed.
* vo_opengl: minor simplification to gl_lcms_set_memory_profile()wm42016-06-043-11/+11
| | | | | | Passing the bstr thing as pointer makes no sense. Everywhere else bstr structs are passed by value because they're so small. Only when it's supposed to receive a return value they're not.
* vo_opengl: remove pointless NULL-checkwm42016-06-041-1/+1
| | | | It's never NULL.
* vo_opengl: move all icc handling from vo_opengl.c to video.cwm42016-06-035-26/+35
| | | | | | | |