Commit Graph

9007 Commits

Author SHA1 Message Date
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 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
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
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 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 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 3e5b632559 Merge branch 'volume_restore' 2013-09-20 13:48:36 +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
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
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
Stefano Pigozzi 4a9f618d9f osxbundle: fonts.conf: only look for fonts in ~/.mpv/fonts
This is to avoid the 30s hang while mpv caches fonts. In practice all the
fonts an average user is going to use are embedded in mkv files so there is
no reason to build fontconfig's cache on all of OS X system directories.

I might add something similar for terminal usage, but I am highly undecided.
2013-09-18 22:18:33 +02:00
wm4 471d6f0013 manpage: remove bogus space in example usage 2013-09-15 21:32:26 +02:00
wm4 132c7f1cf5 manpage: remove version and date fields
These would have to be updated manually all the time. Replacing them
automatically would be possible, but additional work, and would force
regeneration of the manpage way too often.

We decided that we don't need these fields.
2013-09-15 20:44:07 +02:00
wm4 9aa206a90e screenshot: change %w format to be more like %t
Instead of containing a format string within %w{...}, simply allow %w
to specify one item of a time format string. This is simpler, more like
other format specifiers (%t),  and probably easier to use too.
2013-09-15 19:07:35 +02:00
wm4 aa43405020 screenshot: make it possible to format playback time in various ways 2013-09-15 02:51:19 +02:00
wm4 a87298e501 mplayer: don't run heartbeat command while paused
This is commonly used to disable the screensaver with broken/non-
standard X screensavers. During pause, the screensaver should not be
disabled, so not calling this command while paused seems sensible.

See github issue #236.
2013-09-15 02:13:54 +02:00
wm4 6cec60a454 core: add --deinterlace option, restore it with resume functionality
The --deinterlace option does on playback start what the "deinterlace"
property normally does at runtime. You could do this before by using the
--vf option or by messing with the vo_vdpau default options, but this
new option is supposed to be a "foolproof" way.

The main motivation for adding this is so that the deinterlace property
can be restored when using the video resume functionality
(quit_watch_later command).

Implementation-wise, this is a bit messy. The video chain is rebuilt in
mpcodecs_reconfig_vo(), where we don't have access to MPContext, so the
usual mechanism for enabling deinterlacing can't be used. Further,
mpcodecs_reconfig_vo() is called by the video decoder, which doesn't
have access to MPContext either. Moving this call to mplayer.c isn't
currently possible either (see below). So we just do this before frames
are filtered, which potentially means setting the deinterlacing every
frame. Fortunately, setting deinterlacing is stable and idempotent, so
this is hopefully not a problem. We also add a counter that is
incremented on each reconfig to reduce the amount of additional work per
frame to nearly zero.

The reason we can't move mpcodecs_reconfig_vo() to mplayer.c is because
of hardware decoding: we need to check whether the video chain works
before we decide that we can use hardware decoding. Changing it so that
this can be decided in advance without building a filter chain sounds
like a good idea and should be done, but we aren't there yet.
2013-09-13 21:32:28 +02:00
wm4 6a850b0264 quvi: restore playback position when switching formats
This simply issues a seek after reloading.
2013-09-10 16:50:19 +02:00
wm4 12770d5407 manpage: various improvements
Took a superficial look at the manpage, and fixed whatever I spotted.
2013-09-10 15:12:25 +02:00
Martin Herkt 005407338d Add PDF manual target
This builds a PDF version of the manpage using rst2latex
and pdflatex, and installs it to PREFIX/share/doc/mpv by
default.
2013-09-09 04:34:56 +02:00
Martin Herkt 3992e5dfca DOCS/crosscompile-mingw.txt: Update 2013-09-08 12:25:20 +02:00
Martin Herkt c9873ea06c Manpage: Fix formatting (mostly for PDF output) 2013-09-08 12:02:30 +02:00
wm4 35fd083828 demux: retrieve per-chapter metadata
Retrieve per-chapter metadata, but don't do much with it. We just make
the metadata of the _current_ chapter available as chapter-metadata
property. Returning the full chapter list with metadata would be no
problem, except that the property interface isn't really good with
structured data, so it's not available for now.

Not sure if it's worth it, but it was requested via github issue #201.
2013-09-08 07:43:23 +02:00
wm4 cecbd8864e mplayer: add --cursor-autohide-fs-only option
This option makes the cursor always visible in windowed mode.
Apparently, this is what (some?) Windows and OSX users expect. It's
disabled by default for now.

Restructure the cursor hide logic a bit for this purpose.
2013-09-08 03:03:58 +02:00
wm4 68e331851a options: remove --(no-)mouseinput option
I have no idea why it exists, as it's redundant to --(no-)mouse-movements.
2013-09-08 03:03:58 +02:00
wm4 ae64f29930 options: fix --volume option range, add some explanations to manpage
The --volume option accepted values up to 10000, but internally, the
value is always clipped to 0-100 range. What makes this even worse is
that --softvol-max suggests that it extends the range of --volume, which
is not the case. (And passing a volume larger than 100 to --volume
didn't even print a warning.)
2013-09-07 08:54:12 +02:00
wm4 62ab8441a6 mplayer: make --save-position-on-quit save only on quit
When enabling --save-position-on-quit, playback position stored not only
on quit, but in any case playback of a file was stopped. This includes
going to the next file with playlist navigation commands.

After some discussion on IRC, it turned out that nobody thought this was
good behavior. Disable it, and really make it save only on quit.

Maybe the option is useless now, as the user could remap the CLOSE_WIN
key binding. On the other hand, CLOSE_WIN sounds and _is_ a bit obscure.
2013-09-04 18:12:11 +02:00
wm4 4d62b90f88 video: add unscaled mode with --video-unscaled 2013-09-01 03:46:28 +02:00
wm4 8be9c49fcd core: add a playlist demuxer
Modeled after the old playlist_parser.c, but actually new code, and it
works a bit differently.

Demuxers (and sometimes streams) are the component that should be used
to open files and to determine the file format. This was already done
for subtitles, but playlists still use a separate code path.
2013-08-26 10:09:45 +02:00
Alexander Preisinger 58e826e6f2 wayland: shm based software rendering
A wayland output based on shared memory. This video output is useful for x11
free systems, because the current libGL in mesa provides GLX symbols. It is also
useful for embedded systems where the wayland backend for EGL is not
implemented like the raspberry pi.

At the moment only rgb formats are supported, because there is still no
compositor which supports planar formats like yuv420p. The most used compositor
at the moment, weston, supports only BGR0, BGRA and BGR16 (565).

The BGR16 format is the fastest to convert and render without any noticeable
differences to the BGR32 formats. For this reason the current (very basic)
auto-detection code will prefer the BGR16 format. Also the weston source code
indicates that the preferred format is BGR16 (RGB565).

There are 2 options:
    * default-format (yes|no)  Which uses the BGR32 format
    * alpha (yes|no)    For outputting images and videos with transparencies
2013-08-25 22:46:26 +02:00
Stefano Pigozzi a9cb2dc1b8 video: add vda decode support (with hwaccel) and direct rendering
Decoding H264 using Video Decode Acceleration used the custom 'vda_h264_dec'
decoder in FFmpeg.

The Good: This new implementation has some advantages over the previous one:

 - It works with Libav: vda_h264_dec never got into Libav since they prefer
   client applications to use the hwaccel API.

 - It is way more efficient: in my tests this implementation yields a
   reduction of CPU usage of roughly ~50% compared to using `vda_h264_dec` and
   ~65-75% compared to h264 software decoding. This is mainly because
   `vo_corevideo` was adapted to perform direct rendering of the
   `CVPixelBufferRefs` created by the Video Decode Acceleration API Framework.

The Bad:
  - `vo_corevideo` is required to use VDA decoding acceleration.
  - only works with versions of ffmpeg/libav new enough (needs reference
    refcounting). That is FFmpeg 2.0+ and Libav's git master currently.

The Ugly: VDA was hardcoded to use UYVY (2vuy) for the uploaded video texture.
One one end this makes the code simple since Apple's OpenGL implementation
actually supports this out of the box. It would be nice to support other
output image formats and choose the best format depending on the input, or at
least making it configurable. My tests indicate that CPU usage actually
increases with a 420p IMGFMT output which is not what I would have expected.

NOTE: There is a small memory leak with old versions of FFmpeg and with Libav
since the CVPixelBufferRef is not automatically released when the AVFrame is
deallocated. This can cause leaks inside libavcodec for decoded frames that
are discarded before mpv wraps them inside a refcounted mp_image (this only
happens on seeks).
For frames that enter mpv's refcounting facilities, this is not a problem
since we rewrap the CVPixelBufferRef in our mp_image that properly forwards
CVPixelBufferRetain/CvPixelBufferRelease calls to the underying
CVPixelBufferRef.

So, for FFmpeg use something more recent than `b3d63995` for Libav the patch
was posted to the dev ML in July and in review since, apparently, the proposed
fix is rather hacky.
2013-08-22 12:13:30 +02:00
wm4 74e3a29606 options: replace --edition=-1 with --edition=auto
Originally, the objective of this commit was changing --edition to be
1-based, but this was cancelled. I'm still leaving the change to
demux_mkv.c though, which is now only of cosmetic nature.
2013-08-21 18:41:59 +02:00
wm4 c8a7140c73 mplayer: start track IDs from 1 rather than 0
Completely pointless, but makes ChrisK happy for some reason.

Track ID 0 is now rejected by the option parser itself.
2013-08-21 18:32:42 +02:00
Cheng Sun 92658864ae manpage: fix (again) incorrect ao_alsa example
One example in ao.rst used the old syntax with misspelling of "no-block".
2013-08-20 23:15:06 +01:00
wm4 216e8320b0 video: make it possible to scale/pan the video by arbitrary amounts
Add --video-align-x/y, --video-pan-x/y, --video-scale options and
properties. See the additions to the manpage for description and
semantics.

These transformations are intentionally done on top of panscan. Unlike
the (now removed) --panscanrange option, this doesn't affect the default
panscan behavior. (Although panscan itself becomes kind of useless if
the new options are used.)
2013-08-19 13:03:08 +02:00
wm4 67704e2977 options: remove --panscanrange option
This option allowed you to extend the range of the panscan controls, so
that you could essentially use it to scale the video. This will be
replaced by a separate option to set the zoom factor directly.
2013-08-19 12:55:53 +02:00
wm4 062d39fad2 changes: add some things for completeness 2013-08-19 01:05:37 +02:00
wm4 4b506525da vo_vdpau: add RGB support
Apparently this was dropped some years ago, but judging from MPlayer's
handling of this, the original code wasn't so great anyway. The new
code handling clearing of panscan borders correctly, and integrates
better with the YUV path. (Although the VDPAU API sure makes this
annoying with its separate surface types for RGB.)

Note that we create 5 surfaces for some reason - I don't think this
makes too much sense (because we can't use the deinterlacer with RGB
surfaces), but at least it reduces the amount of differences with
the YUV code path.

Clearing the borders is done by drawing a single black pixel over the
window. This sounds pretty dumb, but it appears to work well, and
there is no other API for that. (One could try to use the video mixer
for this purpose, since it has all kinds of features, including
compositing multiple RGBA surfaces and clearing the window background.
But it would require an invisible dummy video surface to make the
video mixer happy, and that's getting too messy.)
2013-08-18 05:46:02 +02:00
Philip Sequeira b018c7d936 command: more intuitive chapter seek behavior
If close to chapter start, skipping back goes to previous chapter (no change).
If more than <threshold> seconds in, skipping back will now go to the beginning
of the current chapter instead.

The threshold is set by the new option --chapter-seek-threshold and defaults to
5 seconds.  A negative value disables the new functionality.
2013-08-17 21:32:52 +02:00
wm4 ab81af477c vo_vdpau: use color close to black as default colorkey (instead of green)
The VDPAU default colorkey, although it seems to be driver specific, is
usually green. This is a pretty annoying color, and you usually see it
briefly (as flashes) if the VDPAU window resizes.

Change it to some shade of black. The new default color is close to what
MPlayer picks as colorkey (and apparently it worked well for them):

    VdpColor vdp_bg = {0.01, 0.02, 0.03, 0};

Since our OPT_COLOR can set 8 bit colors only, we use '#020507' instead,
which should be the same assuming 8 bit colors.

Obviously, you can't use black, because black is a way too common color,
and would make it too easy to observe the colorkey effect when e.g.
moving a terminal with black background over the video window.
2013-08-17 20:06:21 +02:00
wm4 75298d9f0a vo_vdpau: allow setting colorkey
Formally, this sets the "background color" of the presentation queue.
But in practice, this color is also used as colorkey.

This commit doesn't change the VDPAU default yet.
2013-08-17 20:06:20 +02:00
wm4 a82be4348e manpage: fix incorrect ao_alsa example, extend changes.rst
One example in ao.rst used the old syntax with mangled device names.
Fix it. Mention some shell related caveats. Explicitly mention the
change of device name syntax in changes.rst, because it seems to be
a common issue.
2013-08-15 23:40:03 +02:00
wm4 f9271c2ca2 sub: make --subcp=enca the default. 2013-08-15 23:40:03 +02:00
wm4 fe3c445112 sub: allow specifying a fallback codepage if input is not UTF-8
Normally, --subcp always forces conversion. This really always forces
conversion, even if the UTF-8 check on the input succeeds.

Extend the --subcp to allow codepages as fallback if UTF-8 doesn't
work. So, for example --subcp=utf8:cp1250 will use UTF-8 if the input
looks like UTF-8, and will fall back to use cp1250 if the UTF-8 check
fails.

I think this should actually be the default, but on the other hand,
this changes the semantics of the option, and a user would actually
expect --subcp to force conversion, rather than silently using UTF-8
if that happens to work.
2013-08-15 23:40:03 +02:00
Stefano Pigozzi 68b189351c changes.rst: document some OSX and windows changes 2013-08-13 23:20:27 +02:00
wm4 19a7534573 manpage: actually document --hwdec=auto 2013-08-12 02:16:20 +02:00
wm4 2827295703 video: add vaapi decode and output support
This is based on the MPlayer VA API patches. To be exact it's based on
a very stripped down version of commit f1ad459a263f8537f6c from
git://gitorious.org/vaapi/mplayer.git.

This doesn't contain useless things like benchmarking hacks and the
demo code for GLX interop. Also, unlike in the original patch, decoding
and video output are split into separate source files (the separation
between decoding and display also makes pixel format hacks unnecessary).

On the other hand, some features not present in the original patch were
added, like screenshot support.

VA API is rather bad for actual video output. Dealing with older libva
versions or the completely broken vdpau backend doesn't help. OSD is
low quality and should be rather slow. In some cases, only either OSD
or subtitles can be shown at the same time (because OSD is drawn first,
OSD is prefered).

Also, libva can't decide whether it accepts straight or premultiplied
alpha for OSD sub-pictures: the vdpau backend seems to assume
premultiplied, while a native vaapi driver uses straight. So I picked
straight alpha. It doesn't matter much, because the blending code for
straight alpha I added to img_convert.c is probably buggy, and ASS
subtitles might be blended incorrectly.

Really good video output with VA API would probably use OpenGL and the
GL interop features, but at this point you might just use vo_opengl.
(Patches for making HW decoding with vo_opengl have a chance of being
accepted.)

Despite these issues, decoding seems to work ok. I still got tearing
on the Intel system I tested (Intel(R) Core(TM) i3-2350M). It was also
tested with the vdpau vaapi wrapper on a nvidia system; however this
was rather broken. (Fortunately, there is no reason to use mpv's VAAPI
support over native VDPAU.)
2013-08-12 01:12:02 +02:00
Alexander Preisinger 182b470567 changes.rst: add precise scrolling support 2013-08-07 22:26:56 +02:00
Stefano Pigozzi 406241005e core: move contents to mpvcore (2/2)
Followup commit. Fixes all the files references.
2013-08-06 22:52:31 +02:00
Alexander Preisinger 9b6947fcdb changes.rst: mention wayland support
In case website copy&paste outdated information again.
2013-08-05 20:40:17 +02:00
wm4 cccfac47a4 demux_lavf: make avio buffer configurable
Perhaps not very useful, but reserved for situations when a user reports
awful latency and experimentation/debugging might be required to find
out why or to fix it (happens often).
2013-08-04 23:25:54 +02:00
wm4 2710ae8017 command: make vf and af commands more verbose
On success, print the filter chain on the OSD. Otherwise, show an error
message on the OSD (just enough so that the user knows whether the
command worked).
2013-08-03 14:56:27 +02:00
wm4 cdc6810e59 command: add vf/af properties 2013-08-03 14:47:33 +02:00
wm4 bc1d61cf42 stream: redo URL parsing, replace m_struct usage with m_config
Move the URL parsing code from m_option.c to stream.c, and simplify it
dramatically. This code originates from times when http code used this,
but now it's just relict from other stream implementations reusing this
code. Remove the unused bits and simplify the rest.

stream_vcd is insane, and the priv struct is different on every
platform, so drop the URL parsing. This means you can't specify a track
anymore, only the device. (Does anyone use stream_vcd? Not like this
couldn't be fixed, but it doesn't seem worth the effort, especially
because it'd require potentially touching platform specific code.)
2013-08-02 17:02:34 +02:00
wm4 964194b55b manpage: clean up environment variables section 2013-08-02 13:43:11 +02:00
wm4 ac6b150e94 manpage: document exit codes 2013-08-02 13:19:23 +02:00
wm4 7cec9b1ffe manpage: move screenshot section above option list
Seems more logical, because general usage instructions are before the
option list as well.
2013-08-02 13:06:11 +02:00
wm4 3c8190e49d crosscompile-mingw.txt: it's "MinGW" not "MingGW" 2013-07-30 16:15:37 +02:00
wm4 4f970a8179 crosscompile-mingw.txt: mingw-w64 now has modern OpenGL headers in trunk 2013-07-30 16:15:36 +02:00
wm4 3bddc16431 options: simplify --correct-pts handling
Remove the (now unused) code for determining correct-pts mode based on
the demuxer in use. Change its description in the manpage to reflect
what this option does now.
2013-07-26 02:11:34 +02:00
wm4 d1d6db25c0 command: add pseudo-property that allows you to read global options
The "options" pseudo-property allows reading global like this:

   show_text ${options/name}

Where "name" maps to the option "--name". This allows retrieving option
values that are not properties. Write-access is not possible: this is
reserved for normal properties.

Note: it is possible that we'll change this again, and don't require the "options/" prefix to access options.
2013-07-26 00:19:15 +02:00
wm4 74146a855c af_lavfi: switch to new option API
This makes it actually possible to use the filter with more complicated
filter graphs (such as graphs containing the "," character).
2013-07-22 15:11:04 +02:00
wm4 7c2bf06615 af_lavrresample: switch to new option API
Also add a "o" suboption, which should allow fine control over
libavresample.
2013-07-22 15:11:04 +02:00
wm4 3b8dfddb4c audio/filter: use new option API
Make the VF/VO/AO option parser available to audio filters. No audio
filter uses this yet, but it's still a quite intrusive change.

In particular, the commands for manipulating filters at runtime
completely change. We delete the old code, and use the same
infrastructure as for video filters. (This forces complete
reinitialization of the filter chain, which hopefully isn't a problem
for any use cases. The old code forced reinitialization too, but it
could potentially allow a filter to cache things; e.g. consider loaded
ladspa plugins and such.)
2013-07-22 15:11:03 +02:00
Diogo Franco (Kovensky) bcb398ddb4 DOCS/man/en/ao.rst: Update wasapi:device=<id> documentation 2013-07-22 02:42:38 +02:00
Diogo Franco (Kovensky) d5adaed9d8 ao_wasapi0: Rename to ao_wasapi
Nobody knows what the 0 was for. There's no "WASAPI version 0". Just take
it out.
2013-07-22 02:42:38 +02:00
Diogo Franco (Kovensky) 44f699da0d DOCS/man/en/ao.rst: Document ao_wasapi0 2013-07-22 02:42:37 +02:00
wm4 b38e631ed2 vo_opengl: some option changes
Doing "mpv --vo=opengl:lscale=help" now lists possible scalers and
exits. The "backend" suboption behaves similar. Make the "stereo"
suboption a choice, instead of using magic integer values.
2013-07-22 02:14:15 +02:00
wm4 5e0ee41617 options: move --colorkey option to vo_xv 2013-07-22 01:50:22 +02:00
wm4 0c28dc6adc ao_jack: use new option API 2013-07-22 00:03:57 +02:00
wm4 5b91ba0a8d options: remove --mixer and --mixer-channel, turn them into alsa/oss subopts
These two options were supported by ALSA and OSS only. Further, their
values were specific to the respective audio systems, so it doesn't make
sense to keep them as top-level options.
2013-07-21 23:35:14 +02:00
wm4 2111d7bc05 ao_alsa: use new option API (changes syntax)
This changes how device names are handled. Before this commit, device
names were mangled in strange ways to avoid clashing with the option
parser syntax. "." was replaced with ",", and "=" with ":" (the user had
to do the inverse to get the correct device name).

The "new" option parser has multiple ways to escape option strings, so
we don't need this confusing hack anymore.

Add an explicit note to the manpage as well.
2013-07-21 23:27:31 +02:00
wm4 111a455ec6 manpage: fix typo 2013-07-21 23:27:31 +02:00
wm4 ba1dc085bc input.rst: update example
Option was renamed.
2013-07-21 18:06:27 +02:00
wm4 b81f5e2757 vf_scale: use new swscale wrapper 2013-07-18 13:41:38 +02:00
wm4 169b3abd78 sd_ass: scale blur by original video size if requested 2013-07-15 02:01:37 +02:00
wm4 af55db654b sd_add: add terrible hack for (xy-)vsfilter compatibility
Much has been said about this topic, we don't need to say even more.

See additions to options.rst.
2013-07-15 02:01:37 +02:00
wm4 65d8709152 demux_lavf: add terrible hack to make DVD playback just work
DVD playback had some trouble with PTS resets: libavformat's genpts
feature would try reading until EOF (worst case) to find a new usable
PTS in case a packet's PTS is not set correctly. Especially with slow
DVD access, this would make the player to appear frozen.

Reimplement it partially in demux_lavf.c, and use that code in the DVD
case. This is heavily "inspired" by the code in av_read_frame from
libavformat/utils.c. The difference is that we stop reading if no PTS
has been found after 50 packets (consider this a heuristic). Also, we
don't bother with the PTS wrapping and last-frame-before-EOF handling.
Even with normal PTS wraps, the player frontend will go to hell for the
duration of a frame anyway, and should recover quickly after that.

The terribleness of this commit is mostly that we duplicate libavformat
functionality, and that we suddenly need a packet queue.
2013-07-14 23:44:50 +02:00
wm4 e18ffd6b99 Merge branch 'remove_old_demuxers'
The merged branch doesn't actually just remove old demuxers, but also
includes a branch of cleanups and some refactoring.

Conflicts:
	stream/stream.c
2013-07-14 17:59:26 +02:00
wm4 5ad42d0caf tech-overview.txt: minor changes and additions 2013-07-14 17:49:05 +02:00
wm4 3269bd1780 demux: rewrite probing and demuxer initialization
Get rid of the strange and messy reliance on DEMUXER_TYPE_ constants.
Instead of having two open functions for the demuxer callbacks (which
somehow are both optional, but you can also decide to implement both...),
just have one function. This function takes a parameter that tells the
demuxer how strictly it should check for the file headers. This is a
nice simplification and allows more flexibility.

Remove the file extension code. This literally did nothing (anymore).

Change demux_lavf so that we check our other builtin demuxers first
before libavformat tries to guess by file extension.
2013-07-12 22:16:26 +02:00
wm4 175cd3cb57 options: add --cache-default option
Add this option, which lets users set the cache size without forcing it
even when playing from the local filesystem.

Also document the default value explicitly.

The Matroska linked segments case is slightly simplified: they can
never come from network (mostly because it'd be insane, and we can't
even list files from network sources), so the cache will never be
enabled automatically.
2013-07-10 15:05:24 +02:00
wm4 9bb7935ce1 options: remove --ignore-start
This was used only with demux_avi.
2013-07-08 21:59:44 +02:00
wm4 31f685040b Merge branch 'master' into remove_old_demuxers
Conflicts:
	DOCS/man/en/changes.rst
	DOCS/man/en/options.rst
2013-07-08 21:55:44 +02:00
wm4 c460258f5a command: add screenshot_to_file command 2013-07-08 20:37:11 +02:00
wm4 15a5422dd2 input: allow binding multiple commands to a key
Separate the commands with ';'.
2013-07-08 19:28:52 +02:00
Martin Herkt 09d2dd7c3a manpage: proofread and fix formatting 2013-07-08 18:02:46 +02:00
wm4 af0c41e162 Remove old demuxers
Delete demux_avi, demux_asf, demux_mpg, demux_ts. libavformat does
better than them (except in rare corner cases), and the demuxers have
a bad influence on the rest of the code. Often they don't output
proper packets, and require additional audio and video parsing. Most
work only in --no-correct-pts mode.

Remove them to facilitate further cleanups.
2013-07-07 23:54:11 +02:00
wm4 4caa3356b2 Remove some leftovers from network removal
stream_vstream.c in particular was actually dependent on the network
code, and didn't compile anymore.

Cleanup the protocol list in mpv.rst, and add some missing ones
supported by libavformat to stream_lavf.c.
2013-07-07 21:10:44 +02:00
Martin Herkt e670dd7310 manpage: fix section headings 2013-07-07 20:37:47 +02:00
wm4 854303ad49 Remove internal network support
This commit removes the "old" networking code in favor of libavformat's
code.

The code was still used for mp_http, udp, ftp, cddb. http has been
mapped to libavformat's http support since approximately 6 months ago.
udp and ftp have support in ffmpeg (though ftp was added only last
month). cddb support is removed with this commit - it's probably not
important and rarely used if at all, so we don't care about it.
2013-07-07 19:42:38 +02:00
wm4 2c732a46ba ao_jack: allow more control about channel layouts 2013-07-07 18:37:55 +02:00
wm4 451f6788ce command: add some playlist manipulation commands
playlist_remove and playlist_move.
2013-07-02 13:23:26 +02:00
wm4 fc422f5aeb command: add commands to enable/disable input sections
For now, it's mostly for testing. It also might allow to create key
binding state machines, but this sounds questionable.
2013-06-29 22:58:13 +02:00
wm4 776e2893a2 manpage: document input sections 2013-06-29 22:58:13 +02:00
wm4 d4680aaecd command: make raw percent-pos property return fractions
percent-pos was an integer (0-100). Sometimes higher precision is
wanted, but the property is this way because fractional parts would
look silly with normal OSD usage. As a compromise, make percent-pos
double (i.e. includes fractional parts), but print it as integer.

So ${percent-pos} is like an integer, but not ${=percent-pos}.
2013-06-29 22:58:13 +02:00
wm4 a6a1f4b833 command: add properties for playlist position
playlist-pos can set/get the current playlist index. playlist-count
returns the number of entries in the playlist.
2013-06-29 22:58:12 +02:00
wm4 ac266da658 vo_opengl: handle chroma location
Use the video decoder chroma location flags and render chroma locations
other than centered. Until now, we've always used the intuitive and
obvious centered chroma location, but H.264 uses something else.

FFmpeg provides a small overview in libavcodec/avcodec.h:

-----------
/**
 *  X   X      3 4 X      X are luma samples,
 *             1 2        1-6 are possible chroma positions
 *  X   X      5 6 X      0 is undefined/unknown position
 */
enum AVChromaLocation{
    AVCHROMA_LOC_UNSPECIFIED = 0,
    AVCHROMA_LOC_LEFT        = 1, ///< mpeg2/4, h264 default
    AVCHROMA_LOC_CENTER      = 2, ///< mpeg1, jpeg, h263
    AVCHROMA_LOC_TOPLEFT     = 3, ///< DV
    AVCHROMA_LOC_TOP         = 4,
    AVCHROMA_LOC_BOTTOMLEFT  = 5,
    AVCHROMA_LOC_BOTTOM      = 6,
    AVCHROMA_LOC_NB             , ///< Not part of ABI
};
-----------

The visual difference is literally minimal, but since videophiles
apparently consider this detail as quality mark of a video renderer,
support it anyway. We don't bother with chroma locations other than
centered and left, though.

Not sure about correctness, but it's probably ok.
2013-06-28 21:20:41 +02:00