The previous name of this filter was misleading, because it doesn’t actually
normalize volume levels. What it does is closer to performing low-quality
dynamic range compression, hence it is now called af_drc.
Instead of putting codec header data into WAVEFORMATEX and
BITMAPINFOHEADER, pass it directly via AVCodecContext. To do this, we
add mp_copy_lav_codec_headers(), which copies the codec header data
from one AVCodecContext to another (originally, the plan was to use
avcodec_copy_context() for this, but it looks like this would turn
decoder initialization into an even worse mess).
Get rid of the silly CodecID <-> codec_tag mapping. This was originally
needed for codecs.conf: codec tags were used to identify codecs, but
libavformat didn't always return useful codec tags (different file
formats can have different, overlapping tag numbers). Since we don't
go through WAVEFORMATEX etc. and pass all header data directly via
AVCodecContext, we can be absolutely sure that the codec tag mapping is
not needed anymore.
Note that this also destroys the "standard" MPlayer method of exporting
codec header data. WAVEFORMATEX and BITMAPINFOHEADER made sure that
other non-libavcodec decoders could be initialized. However, all these
decoders have been removed, so this is just cruft full of old hacks that
are not needed anymore. There's still ad_spdif and ad_mpg123, bu neither
of these need codec header data. Should we ever add non-libavcodec
decoders, better data structures without the past hacks could be added
to export the headers.
Use codec names instead of FourCCs to identify codecs. Rewrite how
codecs are selected and initialized. Now each decoder exports a list
of decoders (and the codec it supports) via add_decoders(). The order
matters, and the first decoder for a given decoder is preferred over
the other decoders. E.g. all ad_mpg123 decoders are preferred over
ad_lavc, because it comes first in the mpcodecs_ad_drivers array.
Likewise, decoders within ad_lavc that are enumerated first by
libavcodec (using av_codec_next()) are preferred. (This is actually
critical to select h264 software decoding by default instead of vdpau.
libavcodec and ffmpeg/avconv use the same method to select decoders by
default, so we hope this is sane.)
The codec names follow libavcodec's codec names as defined by
AVCodecDescriptor.name (see libavcodec/codec_desc.c). Some decoders
have names different from the canonical codec name. The AVCodecDescriptor
API is relatively new, so we need a compatibility layer for older
libavcodec versions for codec names that are referenced internally,
and which are different from the decoder name. (Add a configure check
for that, because checking versions is getting way too messy.)
demux/codec_tags.c is generated from the former codecs.conf (minus
"special" decoders like vdpau, and excluding the mappings that are the
same as the mappings libavformat's exported RIFF tables). It contains
all the mappings from FourCCs to codec name. This is needed for
demux_mkv, demux_mpg, demux_avi and demux_asf. demux_lavf will set the
codec as determined by libavformat, while the other demuxers have to do
this on their own, using the mp_set_audio/video_codec_from_tag()
functions. Note that the sh_audio/video->format members don't uniquely
identify the codec anymore, and sh->codec takes over this role.
Replace the --ac/--vc/--afm/--vfm with new --vd/--ad options, which
provide cover the functionality of the removed switched.
Note: there's no CODECS_FLAG_FLIP flag anymore. This means some obscure
container/video combinations (e.g. the sample Film_200_zygo_pro.mov)
are played flipped. ffplay/avplay doesn't handle this properly either,
so we don't care and blame ffmeg/libav instead.
This functionality looked smart but created problems with some kinds of
multi touch events. Moreover some events coming from the windows server – like
hovering a corner for window resize – didn't cause the player to wake up
immediately.
The "correct" non hacky way to implement async event polling with cocoa would
be having the vanilla cocoa event loop driving the player and setting up mpv's
terminal FDs as event sources for the cocoa event loop.
Fixes#20
This also means the option is verified on program start, not when the VO
is created. The actual code becomes a bit more complex, because the
screen width/height is not available at program start.
The actual parsing code is still the same, with its unusual sscanf()
usage.
Refcounting will conceptually allocate and free images all the time
when using the filter chain. Add a pool that makes these reallocations
cheap.
This only affects the image data, not mp_image structs and similar small
allocations. Small allocations are always fast with reasonable memory
managers, while large image data will trigger mmap/munmap calls each
time.
Replace libavcodec's native buffer allocation with code taken from
ffplay/ffmpeg's libavfilter support. The code in lavc_dr1.c is directly
copied from cmdutils.c. Note that this is quite arcane code, which
contains some workarounds for decoder bugs and the like. This is not
really a maintainance burden, since fixes from ffmpeg can be directly
applied to the code in lavc_dr1.c.
It's unknown why libavcodec doesn't provide such a function directly.
avcodec_default_get_buffer() can't be reused for various reasons.
There's some hope that the work known as The Evil Plan [1] will make
custom get_buffer implementations unneeded.
The DR1 support as of this commit does nothing. A future commit will
use it to implement ref-counting for mp_image (similar to how AVFrame
will be ref-counted with The Evil Plan.)
[1] http://lists.libav.org/pipermail/libav-devel/2012-December/039781.html
This allowed to move the input stream layer across the network, allowing
the user to play anything that mplayer could play remotely. For example,
playing a DVD related on a remote server (say, with the host name
"remotehost1") could be done by starting the netstream server on that
remote server, and then running:
mplayer mpst://remotehost1/dvd://
This would open the DVD on the remote host, and transfer the raw DVD
sector reads over network. It works the same for other protocols, and
all accesses to the stream layer are marshaled over network. It's
comparable to the way the cache layer (--cache) works.
It has questionable use and most likely was barely used at all. There's
lots of potential for breakage, because it doesn't translate the stream
CTRLs to network packets. Just get rid of it.
The server used to be in TOOLS/netstream.c, and was accidentally removed
earlier.
This function sucks and apparently is not very portable (at least on
mingw, the configure check fails). Also remove the emulation of that
function from osdep/strsep*, and remove the configure check.
vsscanf() is in POSIX, C99, mingw, etc. Further, the implementation in
osdep/vsscanf.c was completely broken, and if it worked, it worked only
by chance.
This mainly serves as a fallback for platforms where nothing better is
available; also as a debugging help. Both the audio and video driver are
not first class - the audio driver lacks delay detection, and the video
driver only supports a single YUV color space.
Configure options: --disable-sdl2 to disable SDL 2.0+ detection,
--disable-sdl to disable SDL 1.2+ detection. Both options need to be
specified to turn off SDL support entirely.
Add `mp_find_config_file` to search different known paths and use that in
ass_mp to look for the fontconfig configuration file.
Some incidental changes spawned by this feature where:
* Buffer allocation for the strings containing the paths is now performed
with talloc. All of the allocations are done on a NULL context, but it still
improves readability of the code.
* Move the OSX function for lookup inside of a bundle: this code path was
currently not used by the bundle generated with `make osxbundle`. The plan
is to use it again in a future commit to get a fontconfig config file.
ad_dvdpcm reads MPEG specific headers directly (passed through codecdata
by demux_mpg), so you couldn't use ffmpeg's "pcm_dvd" with demux_mpg.
Change demux_mpg to set the correct audio parameters directly. The code
for this is taken from ad_dvdpcm.
ad_dvdpcm is evil because it still does partial packet reads (with
demux_read_data()), and it's redundant to libavcodec anyway.
Since libavcodec doesn't have a "generic" PCM decoder, we have to go out
of out way to make it look like ad_lavc provides one: make it provide a
pseudo "pcm" decoder, which maps some format tags manually to the
individual libavcodec PCM decoders.
Format tags which uniquely map to one libavcodec could be mapped via
codecs.conf. Since defining these in tag_map[] is much shorter (one line
vs. a full codec entry in codecs.conf), and since we need tag_map[]
anyway, we don't use codecs.conf for these.
ad_pcm is evil because it still does partial packet reads (with
demux_read_data()), and it's redundant to libavcodec anyway.
ffmpeg recently added a demuxer that can read vobsubs (pairs of .sub and
.idx files). Get rid of the internal vobsub reader, and use the ffmpeg
demuxer instead.
Sneak in an unrelated manpage change (autosub default).
libavdevice supports various "special" video and audio inputs, such
as screen-capture or libavfilter filter graphs.
libavdevice inputs are implemented as demuxers. They don't use the
custom stream callbacks (in AVFormatContext.pb). Instead, input
parameters are passed as filename. This means the mpv stream layer has
to be disabled. Do this by adding the pseudo stream handler avdevice://,
whose only purpose is passing the filename to demux_lavf, without
actually doing anything.
Change the logic how the filename is passed to libavformat. Remove
handling of the filename from demux_open_lavf() and move it to
lavf_check_file(). (This also fixes a possible bug when skipping the
"lavf://" prefix.)
libavdevice now can be invoked by specifying demuxer and args as in:
mpv avdevice://demuxer:args
The args are passed as filename to libavformat. When using libavdevice
demuxers, their actual meaning is highly implementation specific. They
don't refer to actual filenames.
Note:
libavdevice is disabled by default. There is one problem: libavdevice
pulls in libavfilter, which in turn causes symbol clashes with mpv
internals. The problem is that libavfilter includes a mplayer filter
bridge, which is used to interface with a set of nearly unmodified
mplayer filters copied into libavfilter. This filter bridge uses the
same symbol names as mplayer/mpv's filter chain, which results in symbol
clashes at link-time.
This can be prevented by building ffmpeg with --disable-filter=mp, but
unfortunately this is not the default.
This means linking to libavdevice (which in turn forces linking with
libavfilter by default) must be disabled. We try doing this by compiling
a test file that defines one of the clashing symbols (vf_mpi_clear).
To enable libavdevice input, ffmpeg should be built with the options:
--disable-filter=mp
and mpv with:
--enable-libavdevice
Originally, I tried to auto-detect it. But the resulting complications
in configure did't seem worth the trouble.
Gestalt is deprecated since 10.8. Change the code to read the OS version from
a system plist file.
As mentioned http://stackoverflow.com/a/11072974/499456 Apple engineers are
suggesting this plist reading approach.
Now "make install" will never strip the binary. "make install-strip"
always will.
The behavior of --enable-debug is unchanged, other than having no
influence anymore on the install targets.
The config directory, controlled by --confdir and which is set to
PREFIX/etc/mpv by default, should not be created by default, as
"make install" doesn't copy any files there. The user can still create
a config file manually if system-wide configuration is desired.
Add building the manpage to the all target (which is also the default
target). This fixes the behavior that "make install" tried to build the
manpage if it wasn't built yet.
Add rst2man detection to configure, and disable rst2man usage in the all
and install targets if it hasn't been found. You can still build or
install the man page manually (by using the install-mpv-man target),
but the all and install targets won't attempt to use rst2man.
Additionally, building/installing the manpage by default can be
explicitly inhibited using the --disable-manpage configure option.
It's possible to avoid rst2man by using "make mpv install-no-man" as
well.
This removes the rather complicated configure and Makefile parts
related to auto-detecting available languages for manpages and locales.
We don't have non-English manpages or any locales, so this is
pointless. It didn't even work: configure --language=all created an
invalid config.mak that would cause "make install" to fail.
Remove installation of locales. There are no translations at all which
could be installed. Should there ever be someone who is interested in
adding translations, this can be added back in a simpler way.
Rename the --enable-translation configure option to --enable-gettext.
This is what this option really does: enable gettext() use. This may
be interesting for people who want to experiment with localizing mpv,
but is entirely useless for normal use.
Remove detection of the binary codecs directory in configure.
Finish renaming directories and moving files. Adjust all include
statements to make the previous commit compile.
The two commits are separate, because git is bad at tracking renames
and content changes at the same time.
Also take this as an opportunity to remove the separation between
"common" and "mplayer" sources in the Makefile. ("common" used to be
shared between mplayer and mencoder.)
file2string.pl and vdpau_functions.pl are direct ports.
matroska.py was reimplemented as the Parse::Matroska module in CPAN,
and matroska.pl was made a client of Parse::Matroska.
A copy of Parse::Matroska is included in TOOLS/lib, and matroska.pl
looks there first when trying to load the module.
osxbundle.py was not ported since I have no means to verify it.
Python is always available on OSX though, so there is no harm in
removing the check for it on configure.
This reflects the fact that this filter now renders all types of
subtitles, not just ASS subtitles.
Always compile this filter, not just on CONFIG_ASS.
Note that --no-ass still disables auto-inserting this filter. It's the
only way to disable auto-insertion, so keep it even though it's not
really ASS specific anymore. --no-ass also disables using libass for
rendering text subs directly.
To ease changing all the VOs to the new OSD rendering, fallbacks,
conversions, support code etc. was left all over the code. Now that
all VOs have been changed, all that code is inactive. Remove it.
Strip down spudec.c. We don't need the old grayscale and scaling stuff
anymore. (Not removing spudec itself yet - I'm not confident that the
libavcodec DVD sub decoder is sufficient, and it would also require
some hacks to get DVD palette and resolution information from libdvdread
to libavcodec.)
The option --spuaa, --spualign, --spugauss were used with the old sub
scaling code, and don't do anything anymore.
This contains about the same code as bitmap_packer.c. eosd_packer.c was
added first, and then not merged for a year - then it was added as
bitmap_packer.c with slightly different and incompatible interface. Now
replacing eosd_packer.c with bitmap_packer.c is finally done. So much
wasted work...
Before this commit, the OSD was drawn using libass, but the resulting
bitmaps were converted to the internal mplayer OSD format. We want to
get rid of the old OSD format, because it's monochrome, and can't even
be rendered directly using modern video output methods (like with
OpenGL/Direct3D/VDPAU).
Change it so that VOs can get the ASS images directly, without
additional conversions. (This also has the consequence that the OSD can
render colors now.) Currently, this is vo_gl3 only. The other VOs still
use the old method. Also, the old OSD format is still used for all VOs
with DVD subtitles (spudec).
Rewrite sub.c. Remove all the awkward flags and bounding boxes and
change detection things. It turns out that much of that isn't needed.
Move code related to converting subtitle images to img_convert.c. (It
has to be noted that all of these conversions were already done before
in some places, and that the new code actually makes less use of them.)
Add a make task and python script to create a Mac OS X Application Bundle
to be used when compiling with the --enable-macosx-finder and
--enable-macosx-bundle configure flags.
The main svg icon was created by me and heavily inspired by Apple's iTunes
and AppStore icon designs. We are still looking for something better.
For the audio, movie and subtitles icons I added the main logo to MPlayer OSX
Extended icons.
Use with `make osxbundle` after running configure and make.
Clean up handling of libquvi (which resolves URLs of streaming sites
into URLs to the actual media playable by mpv). Move the code out of
open.c to quvi.c, and invoke it explicitly from mplayer.c, instead of
trying to resolve every filename passed to open_stream().
This allows easily passing metadata from the quvi context to the
frontend. Expose QUVIPROP_PAGETITLE as "media-title" property, and use
that instead of "filename" for the mplayer window title. (For YouTube,
this is the video title.) It's cleaner too.
Handle a potential reliability issue: check quvi_getprop return values.
Since open.c contains barely anything but the open_stream() stub, move
that to stream.c and delete open.c.
This changes the name of this project to mpv. Most user-visible mentions
of "MPlayer" and "mplayer" are changed to "mpv". The binary name and the
default config file location are changed as well.
The new default config file location is: ~/.mpv/
Remove etc/mplayer.desktop. Apparently this was for the MPlayer GUI,
which has been removed from mplayer2 ages ago.
We don't have a logo, and the MS Windows resource files sort-of require
one, so leave etc/mplayer.ico/.xpm as-is.
Remove the debian and rpm packaging scripts. These contained outdated
dependencies and likely were more harmful than useful. (Patches which
add working and well-tested packaging are welcome.)
ao_dsound.c depended on the same configure check as vo_directx.c, which
was removed in commit 0e2c48a3ce. This accidentally disabled
inclusion of ao_dsound.
Fix it by adding a new check. Also, move it below ao_portaudio on the
auto-select list, as ao_dsound is considered deprecated.
Unrelated to that, move ao_lavc below ao_null to prevent it from being
auto-selected.
Most of these have very limited actual use, or are even entirely
useless. They only serve to bloat the codebase and to make life harder.
Drowning users in tons of barely useful filters isn't exactly helpful
either. Some of these filters were redundant or marked as obsolete.
The dlopen and lua (to be added soon) video filters provide ways to add
custom filters.
Detailed listing for each filter with reasons (with contributions from
divVerent and lachs0r):
1bpp:
Replaced by "scale".
2xsai:
Pixel art scaling algorithm, useless with lossy video.
blackframe:
Not very useful. Apparently one use is combining it with scripts,
that pass the
bmovl:
Weirdly complex and insane (using FIFO commands), questionable use.
cropdetect:
Only sort-of useful when used with scripts, and then it will be
very fragile.
It's probably better to use the dlopen rectangle filter, or to
implement the common use-case in a better way.
decimate:
Not needed/useful with modern video codecs, is an
encoding-only filter.
denoise3d:
"hqdn3d" is better.
detc:
Some of the worse deteleciners.
dint:
Useless, actually crashes. (On an assert in vf.c that is disabled
by default in mplayer-svn.)
dvbscale:
Not even practical, and the same effect can be achieved through
other means.
eq:
Worse/older version of eq2.
field:
Limited use, available as dlopen filter.
fil:
Quoting the manpage:
This filter is very similar to the il filter but much faster,
the main disadvantage is that it does not always work.
Especially if combined with other filters it may produce
randomly messed up images, so be happy if it works but do not
complain if it does not for your combination of filters.
filmdint:
Kind of redundant with pullup, and slightly worse.
fixpts:
Never useful. (Most if not all filters have been fixed for PTS.)
framestep:
Questionable use. For things like creating thumbnails, ffmpeg or
--sstep should be used.
geq:
Limited use, will be redundant with the "lua" filter.
halfpack:
Useless, probably redundant with "scale".
harddup:
Useless.
hue:
Most VOs support this.
il:
Useless.
ivtc:
Another of the worse deteleciners.
kerndeint:
A bad deinterlacer.
lavc:
For DVB output devices. We removed that support.
lavcdeint:
A bad deinterlacer, was already deprecated.
Still available as --vf=pp=fd.
mcdeint:
A broken deinterlacer that uses lavc internals.
ow:
Very slow, barely any quality benefit over "hqdn3d".
palette:
Done by "scale".
perspective:
Files with incorrect perspective are extremely rare. About the
only real-world use for this is keystone correction, which is
usually done in hardware by the projector or by graphics
drivers/compositors.
pp7:
Another useless postprocessing filter with bad and complicated code.
Use libpostprocess with "pp" instead.
qp:
Useless.
remove-logo:
Redundant with delogo, which is better and more practical.
rgbtest:
Useless.
sab, smartblur, boxblur:
Blur filters, redundant to "unsharp".
softskip:
Does nothing.
spp, fspp, uspp:
Useless postprocessing filters. "spp" needs ffmpeg internals.
"fspp" is the optimized version of the "spp" filter (???), while
"uspp" is the slow version (????).
Use libpostprocess with "pp" instead.
telecine:
Evil and useless. Available as dlopen filter for testing
purposes.
test:
Useless.
tfields:
Useless, probably.
tile:
Questionable use. Available as dlopen filter.
tinterlace:
Evil and useless.
yuvcsp:
Probably useless.
yvu9:
Redundant with "scale".
Also remove the following left-over files: vd_null.c, vqf.h