Commit Graph

45136 Commits

Author SHA1 Message Date
wm4 9e7665b21b mp_image: expose some image allocation code as helpers, refactor
Refactor the image allocation code, and expose part of it as helper
code. This aims towards allowing callers to easily allocate mp_image
references from custom-allocated linear buffers. This is exposing only
as much as what should be actually required.
2017-07-23 09:31:27 +02:00
wm4 0ce3dce03a mp_image_pool: disallow adding read only frames
Remove the feature of adding read-only frames to mp_image_pool_add().
This makes no sense, because an image pool is an allocator, and must
always return writable images. Also check these assumptions earlier.
2017-07-23 09:28:36 +02:00
wm4 bbfd9b5a29 vo_opengl: osd: remove stale declaration
Was missed in the previous changes.
2017-07-23 00:02:02 +02:00
wm4 87e9cd13aa vo_opengl: add printf format checking to pass_describe() 2017-07-22 22:08:23 +02:00
wm4 95885bbaa2 vo_opengl: make VAO helper private, remove old VAO mechanism
The struct describing vertex attributes is still public, of course.
2017-07-22 21:56:23 +02:00
wm4 d3dfffdf02 vo_opengl: osd: use new VAO mechanism
In addition to using the new VAO mechanism introduced in the previous
commit, this tries to keep the OSD code self-contained. This doesn't
work all too well (because of the pass and CMS stuff), but it's still
better than before.
2017-07-22 21:55:38 +02:00
wm4 a24df94fed vo_opengl: add mechanism to create/cache VAO on the fly
This removes VAO handling from video.c. Instead the shader cache will
create the VAO as needed. The consequence is that this creates a VAO
per shader, which might be a bit wasteful, but doesn't matter anyway.
2017-07-22 21:51:32 +02:00
wm4 1c81311673 vo_opengl: osd: refactor and simplify
Reduce this to 1 draw call per OSD pass. This removes the need for some
annoying special handling regarding 3D video support (we supported
duplicating the OSD/subtitles for side-by-side 3D output etc.).

Remove the unneeded texture sampler uniform thing.
2017-07-22 21:46:59 +02:00
wm4 2378acc3b3 options: drop --video-aspect-method=hybrid
Remove this code because it could be argued that it contains GPL-only
code (see commit 642e963c86 for details).

The remaining aspect methods appear to work just as well, are
potentially more compatible to other players, and the code becomes much
simpler.
2017-07-21 20:19:39 +02:00
wm4 533ff28574 client API: drop some compatibility handling
See commit e4bc563fd2 for more information.
2017-07-21 20:09:22 +02:00
wm4 a22ff44f7b input: drop deprecated "osd" command
Complicated situation due to changes by GPL-only author, but also
unnecessary due to newer mechanisms.
2017-07-21 20:02:58 +02:00
wm4 4bc29c1730 options: kill --field-dominance
GPL-only author, no chance of relicensing.
2017-07-21 20:00:09 +02:00
wm4 7a51271d3d demux_lavf: don't free AVFormatContext.key field
We don't even set it anymore. This really should be up to libavformat.
2017-07-21 19:54:26 +02:00
wm4 8c82555e41 ao_oss: fix a dumb calculation
period_size used the wrong unit, and even if the unit had been correct,
was assigned the wrong value.

Probably fixes #4642.
2017-07-21 19:45:59 +02:00
James Cowgill f676f6d2b9
manpage: fix minor spelling mistake in mpv.rst
Found by https://lintian.debian.org/
2017-07-19 19:05:25 +01:00
Ricardo Constantino e0739378dd
travis: trigger website rebuild on VERSION changes too
Needed to update the stable manual if no DOCS were changed.
2017-07-19 19:03:08 +01:00
Martin Herkt 9e124933e5
Update VERSION 2017-07-18 21:15:58 +02:00
Martin Herkt 4db82f0450
Release 0.26.0 2017-07-18 21:14:02 +02:00
Niklas Haas 36f181e0d0
csputils: fix mp_colorspace_equal missing field
Forgot to equality test for mp_colorspace.light
2017-07-18 02:20:50 +02:00
torque e97c79bd79 manpage: upcase JavaScript for section title case consistency. 2017-07-17 15:42:10 +03:00
Niklas Haas 51014e1c03
vo_opengl: avoid constant divisions
These are apparently expensive on some drivers which are not smart
enough to turn x/42 into x*1.0/42. So, do it for them.

My great test framework says it's okay
2017-07-17 05:29:16 +02:00
wm4 c1dcf74458 demux_disc: fix bluray subtitle language retrieval
It seems like adjusting the raw stream ID should be done only for DVD.
Otherwise, getting the subtitle language for Bluray breaks.

Untested. Regression since fb9a32977d.

Fixes #4611 (probably).
2017-07-16 19:02:35 +02:00
Niklas Haas 44391af7df
vo_opengl: style
Use uintptr_t instead of size_t. Shouldn't matter, but is cleaner.
2017-07-16 18:32:48 +02:00
Niklas Haas cea8c86f18
vo_opengl: use MP_ALIGN_UP instead of FFALIGN
Consistency/style
2017-07-16 17:47:06 +02:00
Niklas Haas dead206873 vo_opengl: use glBufferSubData instead of glMapBufferRange
Performance seems pretty much unchanged but I no longer get nasty spikes
on NUMA systems, probably because glBufferSubData runs in the driver or
something.

As a simplification of the code, we also just size the PBO to always
have the full size, even for cropped textures. This seems slower but not
by relevant amounts, and only affects e.g. --vf=crop. It also slightly
increases VRAM usage for textures with big strides.

This new code path is especially nice because it no longer depends on
GL_ARB_map_buffer_range, and no longer uses any functions that can
possibly fail, thus simplifying control flow and seemingly deprecating
the manpage's claim about possible image corruption.

In theory we could also reduce NUM_PBO_BUFFERS since it doesn't seem
like we're streaming uploads anyway, but leave it in there just in
case some drivers disagree...
2017-07-16 17:46:24 +02:00
Jagannathan Tiruvallur Eachambadi 46bfa3726f
ytdl_hook: add a header to support geo-bypass
youtube-dl supports bypassing some geographic restrictions by
setting X-Forwarded-For header when used with geo-bypass and
geo-bypass-country.
2017-07-16 13:20:17 +01:00
wm4 572802e866 osd_libass: avoid libass warnings if scripts set ASS text early
Lua scripts can call osd_set_external() early (before the VO window is
created and obj->vo_res is filled), in which case the PlayResX field
would be set to nonsense, and libass would print a pointless warning.

There's an easy and a hard fix: either just go on and pass dummy values
to libass (basically like before, just clamp them to avoid the values
which make libass print the warning). Or attempt to update the PlayRes
field to correct values on rendering (since at rendering time, you
always know the screen size and the correct values). Do the latter.

Since various things use PlayRes for scaling things, this might still
not be fully ideal. This is a general problem with the async scripting
interface.
2017-07-16 13:33:19 +02:00
wm4 ddd068491c Replace remaining avcodec_close() calls
This API isn't deprecated (yet?), but it's still inferior and harder to
use than avcodec_free_context().

Leave the call only in 1 case in af_lavcac3enc.c, where we apparently
seriously close and reopen the encoder for whatever reason.
2017-07-16 12:51:48 +02:00
Niklas Haas 8e20ef4292
vo_opengl: update BufferData usage hints
STREAM is better than DYNAMIC because we're only using it once per
frame. As for COPY vs DRAW, that was pretty much incorrect to begin with
- but surprisngly, COPY is actually faster (sometimes significantly so,
e.g. on my NUMA system).

After testing, the best I can gather is that it has to do with the fact
that COPY requires fewer redundant memcpy()s, and also 3x reduce RAM
bandwidth (in theory).

Anyway, that bit shouldn't introduce any regressions, it's just a
documentation update. Maybe I'll change my mind about the comment again
the future, it's really hard to tell. Vulkan, please save us!
2017-07-15 23:54:20 +02:00
Niklas Haas b93bcce5df
vo_opengl: coalesce intra-plane PBOs
Instead of allocating three PBOs and cycling through them, we allocate
one PBO that's three times as large, and cycle through the subregion
offsets.

This results in arguably simpler code and faster initialization
performance. Especially for 4K textures, initializing PBOs can take
quite some time (e.g. 180ms -> 110ms). For 1080p, it's more like 66ms ->
52ms for me.

The alignment to 4096 is completely unnecessary by spec, but we do it
anyway just for peace of mind.
2017-07-15 22:11:48 +02:00
wm4 60d0cea310 img_format: fix a comment
This was changed a while ago. Part of it might still apply to the old
D3D hwaccel glue code, though.
2017-07-15 13:04:32 +02:00
Niklas Haas 18c74f7dfe
vo_opengl: generalize --scale-clamp etc.
This can help fight ringing without completely killing it, thus
providing a middle-ground between ringing and aliasing.
2017-07-12 19:08:58 +02:00
Niklas Haas e186567329
vo_opengl: remove redundant gl_video_setup_hooks call
This is unnecessary to call from gl_video_resize, because the hooks only
(possibly) change when the actual vo_opengl options change. This used to
be required back when mpv still had prescaling built in, but since that
was all moved to user shaders and the code removed, this is a left-over
artifact.
2017-07-12 18:46:09 +02:00
wm4 ca512b53a0 player: change default section when loading encoding-profiles.conf
It used to use the "encoding" section. Change this to the default
section to remove another small special case. encoding-profiles.conf
didn't use this by default anyway. The previous revert could mitigate
potential impacts of this a little.
2017-07-12 13:11:14 +02:00
wm4 9a996313e6 Revert "player: always load encoding-profiles.conf"
This reverts commit 0dcb51c7fa.

I randomly decided that this was better. It can be re-applied once it
actually becomes necessary in some way.

Note that this worked fine. My main gripe with this is that it can
spam the log file with encoding stuff even if playback mode is used.
2017-07-12 13:03:15 +02:00
Ricardo Constantino 005ec766c6
man/options: fix a few broken options' examples 2017-07-12 00:38:54 +01:00
Ricardo Constantino db60cbb80a
ytdl_hook: actually load the script-opts
Also, comma-separated list doesn't actually work, even quote-surrounded.
Switch to using | instead.
2017-07-11 23:42:22 +01:00
Ricardo Constantino 042e98f4c9
ytdl_hook: add option to exclude URLs from being parsed
This is more of a niche usecase than --ytdl-format and --ytdl-raw-options,
so a simple script option should be enough.

Either create lua-settings/ytdl_hook.conf with
'exclude=example.com,sub.example.com' option or
"--script-opts=ytdl_hook-exclude=example.com,sub.example.com"
2017-07-11 14:18:29 +01:00
Ricardo Constantino b1165ce3a2
ytdl_hook: add times for ytdl and hook running on debug-level
Not really important, but still interesting to know.
2017-07-11 14:16:35 +01:00
Kevin Mitchell c5dfd66e14 ao_wasapi: remove redundant / outdated comment
Where this was moved from, it made slightly more sense. Here what the comment is
trying to say is already pretty obvious from the code.
2017-07-10 21:01:39 -07:00
Kevin Mitchell 63b6aa3f57 ao_waspi: use switch for handling fix_format errors 2017-07-10 21:01:39 -07:00
Kevin Mitchell 4389ddcc34 ao_wasapi: don't repeat format negotiation on align hack
Even if it did return a different result, the bufferFrameCount from the align
hack would be wrong anyway.
2017-07-10 21:01:39 -07:00
Kevin Mitchell 71cc28b804 ao_wasapi: fix leak on align hack 2017-07-10 21:01:39 -07:00
Aman Gupta 4e93046ddf vo_opengl: fix type of glsl variable frame 2017-07-11 04:46:37 +02:00
wm4 26f56b5a5d vo_opengl: don't make assumptions about plane order
The renderer code doesn't list a fixed set of supported formats, but
supports anything that is described by AVPixFmtDescriptor and follows a
number of constraints.

Plane order is not included in those constraints. This means the planes
could be in random order, rather than what the vo_opengl renderer
happens to assume. For example, it assumes that the 4th plane is alpha,
even though alpha could be on any plane. Likewise it assumes that plane
0 was always luma, and planes 2/3 chroma. (In earlier iterations of
format support, this was guaranteed by MP_IMGFLAG_YUV_P, but this is not
used anymore.)

Explicitly set the plane semantics (enum plane_type) by the component
descriptors and the used colorspace. The behavior should mostly not
change, but it's less likely to break when FFmpeg adds new pixel
formats.
2017-07-10 17:56:43 +02:00
wm4 b016760a28 ad_spdif: minor cleanups
Use avcodec_free_context() unstead of random other calls. Actually it
was already used in the second case, but calling avcodec_close() is
redundant.

Don't crash if allocating a codec context fails.
2017-07-10 16:40:52 +02:00
wm4 02468dcbde vo_opengl: hwdec_dxva2egl: probe whether ANGLE mapping works
With some newer ANGLE builds, mapping can fail with "Failed to create
EGL surface" during playback. The reason is unknown, and it might just
be an ANGLE bug. Probe whether it works at init time to avoid the
problem.
2017-07-10 15:32:09 +02:00
wm4 ba921e2617 vd_lavc: fix crashes with old hwaccels
Commit d5702d3b95 messed up the order of destruction of the elements: it
destroyed the avctx before the hwaccel uninit, even though the hwaccel
uninit could access avctx. This could happen with some old hwaccels
only, such as D3D ones before the new libavcodec hwaccel API.

Fix this by making use of the fact that avcodec_flush_buffers() will
uninit the underlying hwaccel. Thus we can be sure avctx is not using
any hwaccel objects anymore, and it's safe to uninit the hwaccel.

Move the hwdec_dev dstruction code with it, because otherwise we would
in theory potentially create some dangling pointers in avctx.
2017-07-10 14:56:48 +02:00
Niklas Haas f76f37991f
vo_opengl: fix dumb_mode chroma transformation fixup
In commit 6eb0bbe this was changed from xs[n] to use gl_format.chroma_w
indiscriminately, which broke chroma rendering when zooming/cropping.
The solution is to only use chroma_w for chroma planes.

Fixes #4592.
2017-07-10 13:46:41 +02:00
Kevin Mitchell e9f729c17c audio/out: fix comment typo 2017-07-09 13:46:13 -07:00