Commit Graph

40020 Commits

Author SHA1 Message Date
wm4 f64665e7e9 vo_opengl: clean up GL ES function loading
Previously, this was sort of messed together with desktop OpenGL
loading. Add explicit support for ES, and clean up the mess. Also sort
the function arrays alphabetically (at least most of them).

In some cases, add functions to multiple sections. This keeps the number
of sections down.

Don't check for GL_ARB_vertex_array_object. This feature must be used in
OpenGL 3 core, while it may be not available at all in earlier versions,
and not using it if it's available as extension only has no advantages.

This commit also considers GLES 2, because actual support for it will be
added with a later commit.

Also get rid of some MPGL_VER() uses (see some commits ago).
2014-12-18 23:51:21 +01:00
wm4 1b766ab208 vo_opengl: do not use 4x3 matrix
This was a nice trick to get the mpv colormatrix directly into OpenGL,
because the memory representation happened to match.

Unfortunately, OpenGL ES 2 doesn't have glUniformMatrix4x3fv().

Even more unfortunately, the memory representation is now incompatible.
It would be nice to change it, but that would mean getting into a big
mess.
2014-12-18 22:24:45 +01:00
wm4 32fb3dae87 vo_opengl: simplify some aspects of the GL function loader 2014-12-18 21:06:17 +01:00
wm4 da997db095 vo_opengl, x11: make legacy context warning not an error
Really, this doesn't actually matter. It's printed as error only because
it was once thought to be an mostly unneeded fallback, but it turned out
this is still frequently needed, and users are getting confused.
2014-12-18 20:58:37 +01:00
wm4 eec4b86bbc x11: fix mysterious issue with window embedding on OpenBox
For some reason, when using window embedding, and the window manager is
OpenBox, calling XSetWMNormalHints() before the window is mapped, the
initial window position will be off. It leaves some vertical space,
instead of placing it on the top/left corner. Suspiciously, the vertical
space is as much as a the height of normal window decoration.

I don't know what kind of issue this is. Possibly an OpenBox bug, but
then this happens even if the override-redirect flag is set. (This flag
basically tells the X server to ignore the window manager. Normally we
don't set it.) On other window managers, it works fine. So I don't know
why this is happening.

But this is easy to workaround. XSetWMNormalHints() isn't needed at all
if embedding.

Should fix #1235.
2014-12-18 16:45:55 +01:00
wm4 7098f33077 x11: minor improvements
Always include the window position in winrc, even if the window
embedded. This should give the correct positions for things which still
interact with global coordinates, such as the xrandr code.
2014-12-18 16:30:13 +01:00
wm4 6f0da71c6b vo_opengl: minor simplification in function loader
Don't force every entries without functions to define a dummy array.
2014-12-18 15:29:47 +01:00
wm4 541f6731a0 vo_opengl: simplify the case without texture_rg
If GL_RED was not available, we used GL_ALPHA. But this is an
unnecessary complication, and it's easier to use GL_LUMINANCE instead.
With the latter, a texture will return the .r component set, and as long
as the shader doesn't look at the other components, the shader doesn't
need any changes.

Some of the changes added in 0e8fbdbd are now unneeeded.

Also, realign the entire gl_byte_formats_legacy table.
2014-12-18 14:46:59 +01:00
wm4 d910a0faa8 player: cosmetics: remove ancient comment
The DVD horror was confined to specific parts of the player, instead of
having it spread everywhere.
2014-12-17 22:57:20 +01:00
wm4 c721948efe command: extend revert_seek command
"revert_seek mark" basically forces the seekback point. It's basically a
one-way bookmark.
2014-12-17 22:56:45 +01:00
wm4 649e337f4d vo_opengl: don't assume legacy OpenGL is available with GLES
OpenGL 3.0 has the weird situation that it's "hard" to detect whether
legacy GL is really present. Since we pretend that we have OpenGL 3.0 if
we use GLES, it was assuming legacy GL is available.
2014-12-17 22:39:04 +01:00
wm4 592aa9c70c build: add -Werror=format-security, add -W flags in all platforms
The idea of using -Werror=format-security comes from MPlayer.

Try to use the compiler flags with any compiler. There's no reason not
to apply them on clang.
2014-12-17 22:24:20 +01:00
wm4 5758a47902 vo_opengl: add some OpenGL standard symbols missing on OSX
Older OSX versions are missing some OpenGL 3 symbols, apparently. At
least there's some precedent in the headers. Just add the symbols
manually for now to fix OSX (on travis-ci) compilation.
2014-12-17 22:17:11 +01:00
wm4 10befa26d9 vo_opengl: GLES 3 support
Tested with MESA on software emulation. Seems to work well, although the
default FBO format in opengl-hq disables most interesting features. I
have no idea how well it will work on real hardware (or if it does at
all).

Unfortunately, some features, including playback of 10 bit video, are
not supported. Not sure what to do about this.

GLES 2 or 1 do not work.
2014-12-17 21:48:23 +01:00
wm4 07975877be vo_opengl: remove useless FBO test
Remove the readback stuff; it was a useless mess.

Don't test GL_R16 as FBO. The intention was to measure the effective
bitdepth of the texture, except that it was never actually done.
(There's also a OpenGL function which is supposed to retrieve the
bitdepth, but we don't use that either.)
2014-12-17 21:38:37 +01:00
wm4 84ec21ea23 vo_opengl: cleanup dither texture creation
Might be slightly more compatible too, and will make it work on GLES.
2014-12-17 21:36:17 +01:00
wm4 4681e7f49f vo_opengl: switch default FBO format to rgba, use GL_RGBA
I'm hoping this is generally more compatible, and it works with GLES.

This probably has not much of an effect on desktop GL. It also switches
only the default format for --vo=opengl, not --vo=opengl-hq.

"-hq" already uses GL_RGBA16, though since it's a sized format, the
story is a bit different, and it won't work on GLES either.
2014-12-17 21:35:05 +01:00
wm4 631ec3cc33 vo_opengl: glsl: stricter typing
Older GLSL dialects as well as GLES3 do not support the following things
in expressions:

- implicit conversions of integer constants to float
- arithmetic of float*vecN
2014-12-17 21:30:03 +01:00
wm4 50e39ebb0a dvd: add the last chapter
As suggested in issue #1251. I think the main point is that it acts as
a hack to return to the DVD menu when jumping past the last chapter,
because it will reach title-EOF, instead of explicitly jumping to the
next file (which usually exits the player).

This basically reverts commit 8b7418d, except it doesn't include an
off-by-1 error (apparently).

Closes #1251.
2014-12-16 19:28:08 +01:00
wm4 2a71763c88 vo_opengl: remove icc profile options from runtime-settable options
Because of the icc-profile-auto option (which was added at a later
point), supporting this would probably be slightly messy: the ICC
profile can spontaneously update, and then it would overwrite the
previously set options.

Don't make icc-profile-auto fatal if unsupported. The "auto" indicates
that it will use whatever it finds, even if it's nothing.

Also add a warning; before this commit, it just refused to initialize
without explanation.

As a mostly unrelated cosmetic change, remove redundant parameters which
had no point anymore.

Probably fixes #1359 (or rather works it around by disallowing it).
2014-12-16 19:19:02 +01:00
wm4 0e8fbdbdb1 vo_opengl: remove requirement for RG textures
Features not supported are disabled (although with a misleading error
message).
2014-12-16 18:55:20 +01:00
wm4 446e759f64 vo_opengl: remove inactive code 2014-12-16 18:54:32 +01:00
wm4 98d09f735e vo_opengl: fix broken rejection of extended scaling
Possibly explains why some users got mysterious FBO errors on crappy
hardware.
2014-12-16 18:54:06 +01:00
Stefano Pigozzi 4b65bd5086 ao_coreaudio: fix mono/stereo channel mapping
Needed after af3bbb800d since now we use channel mapping all the time.

Fixes #1357
2014-12-16 13:04:29 +01:00
Stefano Pigozzi a7e48eca66 ao_coreaudio: add missing goto for error path 2014-12-16 13:04:28 +01:00
Kevin Mitchell 1e5f9d2673 ao/wasapi: use IsEqualGUID and IsEqualPropertyKey
before we were reinventing this wheel
2014-12-16 03:29:51 -08:00
Kevin Mitchell 011b7c9c3c Revert "vo/w32_common: use local definition of IID_ITaskbarList2"
This reverts commit 17067343eb.

Embarassingly, this turned out not to be necessary.
2014-12-16 02:19:33 -08:00
Kevin Mitchell 17067343eb vo/w32_common: use local definition of IID_ITaskbarList2
It is not defined in the current cygwin release.
2014-12-15 23:38:29 -08:00
wm4 161bdbdb7a build: require alsa libs not older than 6 years
Some IEC958 flags we use have been introduced in 2008, which makes
compilation fail on older systems.
2014-12-16 06:12:46 +01:00
wm4 f81748c4e4 manpage: ao_alsa: link upmix wiki entry
Also clarify the statement about what we expect to happen by default.
It's well possible that distros at some point will fix their ALSA
configuration, and e.g. enable the upmix plugin by default.
2014-12-16 05:11:14 +01:00
wm4 c8727ed9fc command: format ${avsync} like on terminal status line
Padding with spaces is very useless for OSD (because most fonts are
variable width), but it's good when using it on the terminal, e.g. for
reproducing the default terminal status line.
2014-12-16 05:07:38 +01:00
wm4 af3bbb800d audio: make native channel count the default instead of stereo downmix
This should work well with most audio APIs, except ALSA. A long-winded
explanation is provided how to make ALSA multichannel output work.

All other AOs should have no such problems. Of course it's possible
that previously unknown issues arise, because I assume that enabling
multichannel audio is actually relatively rare.

This also disables codec downmix by default, which could change the
audio output due to different mixing in the codec and libavresample.

Fixes #1313.
2014-12-15 17:14:23 +01:00
wm4 49df01323e ao_alsa: remove old multichannel method
The "old" method (before the ALSA channel map API) used device aliases
like "surround51" to set the channel layout. The "interesting" part was
that these devices usually redirect to a hardware device. This means
playing stereo would lead you to the "default" device (dmix), while e.g.
5.1 to "surround51", which automatically takes care of the fact that
dmix can't do 5.1.

This is pretty much nonsense, though. It shouldn't depend on the damn
input media file whether the player is going to use shared access (dmix)
or exclusive access (direct hw device).

As a consequence, by default ao_alsa will do only what dmix can do. If
the user actually wants multichannel, he has to select a suitable hw
device with --audio-device. From there on, the correct speaker mapping
will be ensured via the channel mapping API.

The change is preparation for making multichannel output the default (as
far as supported by the audio output API). Of the common APIs, only ALSA
messes up beyond repair, so I feel like this change is needed.

On ancient alsa-lib versions, only stereo and mono can be played with
this branch.
2014-12-15 16:58:03 +01:00
wm4 ae5fd4a809 ao_alsa: add ridiculous hack to deal with braindead ALSA behavior
dmix reports channel layouts it doesn't support. The rest of the
technical part of the story is in the code comment.

This seems to be the only reasonable way to fallback from trying to
initialize certain devices (like dmix) with multichannel audio. We could
probably add support for such padding channels to our audio chain or to
ao_alsa itself, but this would probably be much more work than this
commit.

What dmix does is probably a bug. I've tried to report it to ALSA. Thay
have a link on their website to a bug tracker, but it's a dead link, and
has been for years. I've posted to alsa-devel, but received no reply.
I'm thus assuming this absolutely retarded behavior is by design, and
nothing will happen to improve upon it.

I'm considering sending Lennart Poettering a "thank you" email, because
with PulseAudio, multichannel audio just works (although some other
things just don't work).
2014-12-15 16:40:23 +01:00
wm4 756adee999 client API: be more lenient about mpv_suspend/resume mismatches
Before this commit, this was defined to trigger undefined behavior. This
was nice because it required less code; but on the other hand, Lua as
well as IPC support had to check these things manually. Do it directly
in the API to avoid code duplication, and to make the API more robust.
(The total code size still grows, though...)

Since all of the failure cases were originally meant to ruin things
forever, there is no way to return error codes. So just print the
errors.
2014-12-15 14:44:47 +01:00
wm4 a40df83bae lua: cosmetics: fix some include directives
Apparently, the atomics were used by the win32 subprocess code. This
code was moved to a separate file, but the atomics.h include was
forgotten.
2014-12-15 14:44:47 +01:00
Kevin Mitchell 4966a67f71 ao/wasapi: set the ao with the waveformat channelmap
hopefully this fixes #1350
2014-12-15 05:01:38 -08:00
wm4 fcec3df700 scripting: fix/improve deprecation message
The message was missing a '\n', so it was merged with the next line,
which also typically caused it not to be printed with the colors for
warnings.

Print the full new path in the warning message. (Normally, cfg should
never be NULL, so accounting for this case is just for robustness.)
2014-12-15 06:24:05 +01:00
wm4 1c2cbeabc2 vo_opengl: remove quadbuffer/anaglyph stereo 3D rendering
Obscure feature, and I've never heard of anyone using it.

The anaglyph effects can be reproduced with vf_stereo3d. The only thing
that can't be reproduced with it is "quadbuffer", which requires special
and expensive hardware.
2014-12-15 04:40:26 +01:00
Avi Halachmi (:avih) 39e04e9294 options: deprecate 'lua' based options/dirs for 'script'
- --lua and --lua-opts change to --script and --script-opts
- 'lua' default script dirs change to 'scripts'
- DOCS updated

- 'lua-settings' dir was _not_ modified

The old lua-based names/dirs still work, but display a warning.

Signed-off-by: wm4 <wm4@nowhere>
2014-12-15 04:39:56 +01:00
wm4 06828f71a1 vo_x11: don't attempt to resize when unconfigured
Fixes #1347.

The previous commit actually fixes the crash.
2014-12-14 22:01:30 +01:00
wm4 399e2fec6b vo_x11: check allocation errors
Avoids a crash if allocation fails.
2014-12-14 22:00:21 +01:00
wm4 91b8a7f994 build: add checks for some compiler warning flags 2014-12-14 20:44:27 +01:00
wm4 aaa319fcbd vd_lavc: fix error handling path
The ctx->pic check must uninitialize the decoder.
2014-12-13 22:00:42 +01:00
wm4 291ae3d659 mp_image: check for malloc failure
Or rather, the only reason av_buffer_create() can fail is a malloc
failure.
2014-12-13 22:00:08 +01:00
wm4 5b618ef629 command, dvd: add property which returns list of DVD titles
This was requested.

It seems libdvdread can't get the duration for titlesets other than the
currently opened title. The data structures contain dangling pointers
for these, and MPlayer works this around by opening every title
separately for the purpose of dumping the title list.
2014-12-13 20:25:56 +01:00
wm4 c3275f7e53 stream_cdda: don't return number of tracks as number of titles
Apparently, we treat different tracks as titles, so returning the number
of titles (which is user-visible as "disc-titles" property) is
completely misguided.
2014-12-13 20:25:56 +01:00
wm4 8b7418db97 dvd: drop last chapter
Apparently, libdvdnav always reports a last chapter that points to the
exact end of the title. This is useless for us.

Again, same possible caveats as with the previous commit.
2014-12-13 20:25:56 +01:00
wm4 13ae78d207 dvd: add an extra chapter at position 0
This way, chapter 0 will always point to the start of the title.

At least this is the intention; it's likely that DVDs as well as
libdvdnav do random things that lead to random results.
2014-12-13 20:25:56 +01:00
Mihai Moldovan 8c927376a1 osxbundle: don't use sed but pure python
GNU sed and BSD sed don't share the same options for editing files in-place,
so a workaround is needed.

The most simple way is to use a pure python implementation of applying the
changes.
2014-12-13 11:20:29 +01:00