Commit Graph

36322 Commits

Author SHA1 Message Date
ChrisK2 0a0d7f43a5 Add the on-screen-controller
Signed-off-by: wm4 <wm4@nowhere>
2013-09-26 01:29:15 +02:00
wm4 6048f87e3c Add initial Lua scripting support
This is preliminary. There are still tons of issues, and any aspect
of scripting may change in the future. I decided to merge this
(preliminary) work now because it makes it easier to develop it, not
because it's done. lua.rst is clear enough about it (plus some
sarcasm).

This requires linking to Lua. Lua has no official pkg-config file, but
there are distribution specific .pc files, all with different names.
Adding a non-pkg-config based configure test was considered, but we'd
rather not.

One major complication is that libquvi links against Lua too, and if
the Lua version is different from mpv's, you will get a crash as soon
as libquvi uses Lua. (libquvi by design always runs when a file is
opened.) I would consider this the problem of distros and whoever
builds mpv, but to make things easier for users, we add a terrible
runtime test to the configure script, which probes whether libquvi
will crash. This is disabled when cross-compiling, but in that case
we hope the user knows what he is doing.
2013-09-26 01:28:58 +02:00
wm4 b0cc3c2cf4 Fix previous commit
This time it broke because I didn't actually test compiling vo_vaapi.c,
and it was using a macro from mp_image.h, which implicitly assumed
FFALIGN was available. Screw that too, and copy the definition of
ffmpeg's FFALIGN to MP_ALIGN_UP, and move these macros to mp_comnon.h.
2013-09-25 22:44:12 +02:00
wm4 200fb7eceb vaapi: fix compilation with Libav
The code using FFSWAP was moved from vo_vaapi.c to vaapi.c, which didn't
include libavutil/common.h anymore, just libavutil/avutil.h. The header
avutil.h doesn't include common.h recursively in Libav, so it broke
there.

Add FFSWAP as MPSWAP in mp_common.h (copy pasted from ffmpeg) to make
sure this doesn't happen again. (This kind of stuff happens all too
often, so screw libavutil.)
2013-09-25 22:22:02 +02:00
wm4 72fbd846db options: allow selecting the libass shaper
I'm using the word "languages" instead of "scripts" in the manpage, but
I think that's easier to understand with a smaller amount of
descriptions.
2013-09-25 21:42:29 +02:00
wm4 1e4f08c50c options: make --ass-hinting a choice, instead of using magic numbers
options.c still doesn't use the constants defined by the libass headers,
but it's still better than exposing those to the user directly.
2013-09-25 21:40:35 +02:00
Martin Herkt 4e6751609e configure: make the pdflatex check use the tempdir 2013-09-25 16:04:41 +02:00
Martin Herkt cc12f05a52 configure: improve pdflatex check 2013-09-25 15:57:20 +02:00
wm4 641e94cd27 vaapi: allow GPU read-back with --hwdec=vaapi-copy
This code is actually quite inefficient: it reuses the (slow, simple)
screenshot code. It uses an inefficient method to read the image
(vaGetImage() instead of vaDeriveImage()), allocates new memory for
each frame that is read, and it tries all image formats again each
time.

Also, in my tests it always picked NV12 as image format, which is not
ideal if you actually want to filter the video, and vo_xv can't handle
this format without conversion either.

However, a user confirmed that it worked for him, so everything is fine.
2013-09-25 13:53:42 +02:00
wm4 7c3f1ffc44 vd_lavc: allow process_image to change image format
This will allow GPU read-back with process_image.

We have to restructure how init_vo() works. Instead of initializing the
VO before process_image is called, rename init_vo() to
update_image_params(), and let it update the params only. Then we really
initialize the VO after process_image.

As a consequence of these changes, already decoded hw frames are
correctly unreferenced if creation of the filter chain fails. This
could trigger assertions on VO uninitialization, because it's not
allowed to reference hw frames past VO lifetime.
2013-09-25 13:53:42 +02:00
xylosper 39d1ab82e5 vaapi: add vf_vavpp and use it for deinterlacing
Merged from pull request #246 by xylosper. Minor cosmetic changes, some
adjustments (compatibility with older libva versions), and manpage
additions by wm4.

Signed-off-by: wm4 <wm4@nowhere>
2013-09-25 13:53:42 +02:00
wm4 1ee8d0210d sd_ass: minor simplification
There shouldn't be any functional changes. Just reduce the amount of
pointless temporary variables.
2013-09-24 23:18:11 +02:00
wm4 1dbb73e0fb sd_ass: remove dead code
This code was made inactive some months ago. At this time it wasn't
entirely clear whether this code was still needed, but now I'm pretty
sure it isn't. Even if it is, it didn't work anymore.
2013-09-24 23:14:38 +02:00
wm4 fdd5140f43 command: fix short buffer when handling of long property names
This wasn't enough and could lead to a cut off message shown on OSD.
Just make it dynamic, since we already use dynamic memory allocation
at this point anyway.
2013-09-24 21:26:05 +02:00
Alexander Preisinger d75cfef49c wayland: remove outdated comment 2013-09-24 18:34:50 +02:00
Alexander Preisinger 3308bc2bc9 wayland: remove moving window by grabbing
Moving the window was convenient but generates a MOUSE_LEAVE event
which it shouldn't. Now we remove it, because it is still possible
to move the window in weston with MOD+BTN0.
2013-09-24 18:30:44 +02:00
Martin Herkt d4bdcdfe09 .gitignore: add pdflatex output files 2013-09-23 19:07:22 +02:00
Martin Herkt 8764f4cf96 sub/ass_mp: remove superfluous message prefixes 2013-09-23 19:02:23 +02:00
Martin Herkt 3807038193 install: don’t force append /mpv to docdir 2013-09-23 14:09:15 +02:00
wm4 ee57f7fdae win32: edit resource files, in particular set CompanyName
Setting CompanyName (probably) helps with issue #256.

Update some other fields as well, because why not. (They're full of
MPlayer remnants.)
2013-09-23 01:44:09 +02:00
wm4 ddca41bd54 demux: don't print "Clip info:" line if there are no tags 2013-09-23 01:22:48 +02:00
Paul B Mahol 20b2d7cb6f ao_oss: add support for SNDCTL_DSP_RESET and use it when pausing
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: wm4 <wm4@nowhere>
2013-09-23 01:21:37 +02:00
wm4 cc7f8ee620 mplayer: attempt to make playback resume work with DVD/BD
The problem with DVD/BD and playback resume is that most often, the
filename is just "dvd://", while the actual path to the DVD disk image
is given with --dvd-device. But playback resume works on the filename
only.

Add a pretty bad hack that includes the path to the disk image if the
filename starts with dvd://, and the same for BD respectively. (It's a
bad hack, but I want to go to bed, so here we go. I might revert or
improve it later, depending on user feedback.)

We have to cleanup the global variable mess around the dvd_device.
Ideally, this should go into MPOpts, but it isn't yet. Make the code
paths in mplayer.c take MPOpts anyway.
2013-09-22 03:31:25 +02:00
wm4 b0f7a26f1a network: fix rtsp playback
By default, libavformat uses UDP for rtsp playback. This doesn't work
very well. Apparently the reason is that the buffer sizes libavformat
chooses for UDP are way too small, and switching to TCP gets rid of this
issue entirely (thanks go to Reimar Döffinger for figuring this out).

In theory, you can set buffer sizes as libavformat options, but that
doesn't seem to help.

Add an option to select the rtsp transport, and make TCP the default.

Also remove an outdated comment from stream.c.
2013-09-22 02:40:29 +02:00
wm4 ce861c9f33 stream_lavf: print lavf options that could not be set
Mainly for debugging. Usually, we just set options for all possible
protocols, and we can't really know whether a certain protocol is used
beforehand. That's also the reason why avio_open2() takes a dictionary,
instead of letting the user set options directly with av_opt_set(). Or
in other words, we don't know whether an option that could be set is an
error or not, thus we print the messages only at verbose level.
2013-09-22 02:20:18 +02:00
wm4 eda596a3f9 command: when changing volume while muted, show an extra message on OSD
So nobody has to wonder why everything is silent, even if they raise the
volume.
2013-09-21 00:08:38 +02:00
wm4 897d4b58a1 command: when changing a property, allow showing an extra OSD message
This is for properties that normally show a bar, and thus do not show an
OSD message (as per classic mplayer behavior). Setting an extra_msg
allows showing an OSD message anyway, except if OSD messages are
explicitly suppressed.

This refactors the whole show_property_osd() function a bit, and
replaces the weird sep field with a more general method.
2013-09-21 00:07:42 +02:00
wm4 f988c63003 m_property: add a way to switch on property values in property expansion
Allows for example: --status-msg='${?pause==yes:(Paused) } ...' to
emulate the normal terminal status line. It's useful in other situations
too.

I'm a bit worried about extending this mini-DSL, and sure hope nobody
will implement a generic formula evaluator at some point in the future.
But for now we're probably safe.
2013-09-20 23:09:43 +02:00
wm4 ab706f9969 m_property: rearrange code 2013-09-20 22:26:08 +02:00
wm4 99576ac483 command: don't append, but prepend deinterlace filter by default
In most cases, it's better if deinterlacing happens before any other
filtering, so prepend the filter to the user's filter list, instead
of appending it.
2013-09-20 16:48:08 +02:00
wm4 d5a3739105 vo_lavc: mp_msg conversion
Also restores consistent log message prefixes with ao_lavc.
2013-09-20 16:32:36 +02:00
wm4 0611c43b97 command: use a list of potential deinterlacer filters
Instead of hardcoding a single filter. This might be helpful for
modeling the vaapi deinterlacer as a video filter. The idea is that a
software deinterlacer would be tried first, and if that fails (because
vaapi hardware decoding uses HW surfaces, which a software deinterlacer
does not accept), the vaapi filter would be tried.
2013-09-20 15:09:29 +02:00
wm4 2694b5f378 vo/x11_common: don't require a working input method
Normally, we need this for Xutf8LookupString(). But we can just fall
back to XLookupString(). In fact, the code for this was already there,
the code was just never tested and was actually crashing when active
(see commit 2115c4a).
2013-09-20 14:45:49 +02:00
wm4 6c28524e0f vf: fix filter initialization error check
vf_open returns 0 on error, 1 on success. Oops. Accidentally broken
with 6629a95.
2013-09-20 14:01:00 +02:00
Johan Kiviniemi 912f609403 ao_pulse: bug fix: goto the correct error handler 2013-09-20 13:50:45 +02:00
Johan Kiviniemi e5710ccc5d ao_pulse: set the property media.role=video 2013-09-20 13:50:13 +02:00
wm4 3e5b632559 Merge branch 'volume_restore' 2013-09-20 13:48:36 +02:00
wm4 542086dd45 af: merge af_reinit() and fix_output_format()
Calling them separately doesn't really make sense, and all existing
calls to them usually combined them. One subtitle difference was that
af_init() didn't wipe the filter chain if initialization of the chain
itself failed, but that didn't really make sense anyway.

Also remove af_init() from the code for setting balance in mixer.c. The
mixer should be in the initialized state only if audio is fully
initialized, so the af_init() call made no sense.

Note that the filter "editing" code in command.c doesn't really do a
nice job of handling errors in case recreating an _old_ (known to work)
filter chain unexpectedly fails, and this obscure/rare case might be
differently handled after this change.
2013-09-20 13:43:00 +02:00
wm4 0162271725 mixer: make struct opaque
Also remove stray include statements from ao_alsa and ao_oss.
2013-09-20 13:23:25 +02:00
wm4 327a779a81 mixer: allow accessing volume and mute property on disabled audio
The volume is set as soon as the audio chain is created again. This
works only in softvol mode. For system wide volume or otherwise
externally user controllable volume, this code is intentionally
disabled. It would be extremely weird if changing volume (while audio is
not initialized) would do nothing, and then suddenly change it when the
audio chain is created.

There's another odd corner case: the user-set volume will be thrown away
if it's set before the _first_ audio chain initialization. This is
because the volume restore logic recognizes a change from nothing to
softvol or an AO, and circumventing that would require additional code.
Also, we don't even know the start volume before that point.

Forcing the volume with --volume will can override the volume set during
no-audio mode, depending on the situation.
2013-09-20 13:23:25 +02:00
wm4 7623c94ddc manpage: af_volnorm was renamed 2013-09-20 13:23:25 +02:00
wm4 b8e42ae13c mixer: restore volume with playback resume
Note that this is intentionally never done if the AO or softvolume is
different, or if the current volume control method is thought to control
system wide volume (such as ALSA) or otherwise user controllable (such
as PulseAudio). The intention is to keep things robust and to avoid
messing with the user's audio settings as far as possible, while still
providing the ability to resume volume if it makes sense.
2013-09-20 13:23:25 +02:00
Martin Herkt ed2d67b6d7 vo/x11_common: remove superfluous msg prefixes 2013-09-20 00:04:39 +02:00
Stefano Pigozzi 061b6ab3aa macosx_application: fix regression causing crash
95a2151d1 introduced a crash on systems lower than 10.9 when opening files
with a single argument.
2013-09-19 22:03:49 +02:00
Stefano Pigozzi 00d8e85373 Revert "osxbundle: fonts.conf: only look for fonts in ~/.mpv/fonts"
Commit broke text subtitles without embedded fonts. Will look for a better
solution later. Revert it for now, since I'm starting to get bug reports.

This reverts commit 4a9f618d9f.
2013-09-19 21:39:16 +02:00
Martin Herkt 2115c4a3ad vo/x11_common: Fail init with no valid XIM
XOpenIM can fail to find a valid input method, in which case it
returns NULL. Passing a NULL pointer to XCreateIC would cause a
crash, so fail VO init before that happens.
2013-09-19 20:08:34 +02:00
Alexander Preisinger 858dcee5f1 wayland/common: exit properly on fd errors
Before this commit there was just an error message, but the file descriptor was
still open. Now we close the file descriptor and prevent it from calling
endlessly. Also a CLOSE_WIN event is sent which closes the window eventually if
the action of CLOSE_WIN is set to quit or quit_watch_later.
2013-09-19 17:45:49 +02:00
wm4 6599677b98 mplayer: rename a somewhat misnamed function 2013-09-19 17:28:27 +02:00
wm4 93feffad15 vo_opengl: blend alpha components by default
Improves display of images and video with alpha channel, especially if
the transparent regions contain (supposed to be invisible) garbage
color values.
2013-09-19 17:03:03 +02:00
wm4 234d967bed mixer: don't unmute audio when raising volume
This is rather strange behavior, away with it.
2013-09-19 14:32:25 +02:00