Commit Graph

186 Commits

Author SHA1 Message Date
wm4 2522bff565 video/filters: simplify libavfilter bridge
Remove the confusing crap that allowed a filter using the libavfilter
bridge to be compiled without libavfilter. Instead, compile the wrappers
only if libavfilter is enabled at compile time.

The only filter which still requires it is vf_stereo3d (unfortunately).
Special-case this one. (The whole filter and how it interacts with lavfi
is pure braindeath anyway.)
2015-02-11 17:35:58 +01:00
wm4 b6ab34fc98 af_rubberband: pitch correction with librubberband
If "--af=rubberband" is used, librubberband will be used to speed up or
slow down audio with pitch correction.

This still has some problems: the audio delay is not calculated
correctly, so the audio position jitters around by a few milliseconds.
This will probably ruin video timing.
2015-02-11 00:29:12 +01:00
wm4 3583559164 vo_opengl: move utility functions from loader to a separate file
gl_common.c contained the function loader (which is big) and additional
utility functions (not so big, but will grow when moving more out of
gl_video.c). Just split them. There are no changes other than some
modifications to comments.
2015-01-28 19:40:46 +01:00
wm4 b473477fc5 vf_ilpack: remove this filter
This was apparently useful for correct interlaced scaling (although I
don't know anyone who used this). It was rarely used (if at all), had an
inconvenient output format (packed YUV), and now has a better solution
in libavfilter (using the libavfilter "scale" filter via vf_lavfi).
There is no reason to keep this filter any longer.
2015-01-27 19:13:51 +01:00
wm4 86bba0dc5b vf_divtc: remove this filter
Better solutions are available in vf_vapoursynth and vf_lavfi. The only
user I know who used this is now using vf_vapoursynth.
2015-01-27 19:10:13 +01:00
wm4 97f32fdb23 vf_phase: remove this filter
If you really want it, it's in libavfilter and can be used via vf_lavfi.
2015-01-27 19:06:59 +01:00
wm4 82e3d06f09 vf_swapuv: remove this filter
It's entirely useless. I left it in for a while, because the analog TV
code had a transitional bug that could switch chroma planes, but it was
fixed long ago. It's also available in libavfilter.
2015-01-27 19:04:02 +01:00
wm4 c92f4a1126 vf_softpulldown: remove this filter
Apparently it was completely broken and essentially did nothing. This
was broken sometime in early mpv or mplayer2 times.

Get rid of it. If you _really_ need it, wait until FFmpeg ports it from
MPlayer, which will happen very soon.
2015-01-27 18:58:16 +01:00
wm4 69e5dd9bce vf_pullup: remove builtin implementation
Now it requires libavfilter. The wrapper is left in place, so FFmpeg
users will not notice any change. On Libav, the filter stops working.
2015-01-27 18:53:28 +01:00
wm4 a0ed62fc1d build: remove bogus client API examples build
The symlink trick made waf go crazy (deleting source files, getting
tangled up in infinite recursion... I wish I was joking). This means we
still can't build the client API examples in a reasonable way using the
include files of the local repository (instead of globally installed
headers). Not building them at all is better than deleting source files.

Instead, provide some manual instructions how to build each example
(except for the Qt examples, which provide qmake project files).
2015-01-23 15:32:23 +01:00
wm4 724f722d7f vo_opengl_old: remove this VO
At this point, there is probably no hardware left that doesn't do
OpenGL 2.1, and at the same time is fast enough to handle video.
2015-01-20 21:15:04 +01:00
wm4 d7dfbc8610 player: use libavutil API to get number of CPUs
Our own code was introduced when FFmpeg didn't provide this API (or
maybe didn't even have a way to determine the CPU count). But now,
av_cpu_count() is available for all FFmpeg/Libav versions we support,
and there's no reason to have our own code.

libavutil's code seems to be slightly more sophisticated than our's, and
it's possible that the detected CPU count is different on some platforms
after this change.
2015-01-05 12:34:34 +01:00
wm4 4ed0907f2d build: try to make examples build both in-tree and out-of-tree
The examples simple.c and cocoabasic.m can be compiled without
installing libmpv. But also, they didn't use the correct include path
libmpv programs normally use, so they couldn't be built with a properly
installed system-libmpv. That's pretty bad for examples, which are
supposed to show how to use libmpv correctly.

So do some bullshit that symlinks libmpv to a "mpv" include directory
under the build directory. This name-mismatch is a direct consequence of
the bullshit done in 499a6758 (requested in #539 for dumb reasons). (We
don't want to name the client API headers directory "mpv", because that
would be too unspecific, and clashes with having the mpv binary in the
same directory.)

If you have spaces or other "unusual" characters in your paths, the
build will break, because I couldn't find out where waf hides its
function to escape shell parameters (or a way to invoke programs
without involving the shell). Neither does such a thing to be
documented, nor do they seem to have a clear way to do this in
their code.

This also doesn't compile the Qt examples, because everything becomes
even more terrible from there on.
2015-01-02 00:00:03 +01:00
wm4 da4f722579 DOCS/client_api_examples: move all examples into their own subdirs
Also get rid of shared.h; it actually doesn't have much value. Just copy
the tiny function it contained into the 2 files which used it.
2015-01-01 23:08:15 +01:00
wm4 bafb9b2271 win32: add native wrappers for pthread functions
Off by default, use --enable-win32-internal-pthreads .

This probably still needs a lot more testing. It also won't work on
Windows XP.
2015-01-01 15:10:42 +01:00
wm4 8eaa63689a demux_mf: move mf.c contents to demux_mf.c
There's no reason why parts of this demuxer would be in a separate
source file. The existence of this code is already somewhat questionable
anyway, so it may as well be dumped into a single file.

Even stranger that demux.c included mf.h for no reason (it was an
artifact from 2002 when the architecture was uncleaner).
2014-12-29 23:09:50 +01:00
wm4 4075518011 ao_portaudio: remove this audio output
It's just completely useless. We have good native support for all 3
desktop platforms, and ao_sdl or ao_openal as fallbacks.
2014-12-29 18:53:12 +01:00
Stefano Pigozzi 20f6cf3ec6 build: fix linking with --enable-static-build 2014-12-29 18:30:24 +01:00
Stefano Pigozzi 54aea7d5de chmap_sel: add multichannel fallback heuristic
Instead of just failing during channel map selection, try to select a close
layout that makes most sense and upmix/downmix to that instead of failing AO
initialization. The heuristic is rather simple, and uses the following steps:

1) If mono is required always prefer stereo to a multichannel upmix.
2) Search for an upmix that is an exact superset of the required channel map.
3) Search for a downmix that is the exact subset of the required channel map.
4) Search for either an upmix or downmix that is the closest (minimum difference
   of channels) to the required channel map.
2014-12-29 17:56:53 +01:00
wm4 3fdb6be316 win32: add mmap() emulation
Makes all of overlay_add work on windows/mingw.

Since we now don't explicitly check for mmap() anymore (it's always
present), this also requires us to make af_export.c compile, but I
haven't tested it.
2014-12-26 17:30:10 +01:00
wm4 fb855b8659 client API: expose OpenGL renderer
This adds API to libmpv that lets host applications use the mpv opengl
renderer. This is a more flexible (and possibly more portable) option to
foreign window embedding (via --wid).

This assumes that methods like context sharing and multithreaded OpenGL
rendering are infeasible, and that a way is needed to integrate it with
an application that uses a single thread to render everything.

Add an example that does this with QtQuick/qml. The example is
relatively lazy, but still shows how relatively simple the integration
is. The FBO indirection could probably be avoided, but would require
more work (and would probably lead to worse QtQuick integration, because
it would have to ignore transformations like rotation).

Because this makes mpv directly use the host application's OpenGL
context, there is no platform specific code involved in mpv, except
for hw decoding interop.

main.qml is derived from some Qt example.

The following things are still missing:
- a way to do better video timing
- expose GL renderer options, allow changing them at runtime
- support for color equalizer controls
- support for screenshots
2014-12-09 17:59:04 +01:00
wm4 231d5a32a9 build: showqscale was removed 2014-12-04 10:39:11 +01:00
wm4 809936fdb9 video/filter: kill vf_pp (libpostproc)
This is an ancient filter, and we assume it's not useful anymore.

If you really want this, it's still available in libavfilter (e.g. via
--vf=lavfi=[pp...]). The disadvantage is that mpv doesn't pass through
QP information to libavfilter. (This was probably the reason vf_pp still
was part of mpv - it was slightly easier to pass QP internally.)
2014-12-03 23:01:19 +01:00
wm4 920512d358 vo_opengl: move hwdec parts into their own files
This wasn't done before because there was no advantage in "abstracting"
it. This changed, and putting this into its own files is better than
messing it into gl_common.c/h.
2014-12-03 23:01:19 +01:00
wm4 a72a4b28a0 build: don't install some files if only libmpv is built
encoding-profiles.conf can be used by libmpv, but it won't load it
from this path by default, so exclude it as well.

Fixes #1293.
2014-11-29 00:03:42 +01:00
James Ross-Gowan ef0d1cddb6 lua: subprocess: move to osdep/subprocess-{win,posix}.c
The subprocess code was already split into fairly general functions,
separate from the Lua code. It's getting pretty big though, especially
the Windows-specific parts, so move it into its own files.
2014-11-22 18:15:13 +11:00
wm4 cfa9724a79 build: don't build win32 mpv.com wrapper with --disable-cplayer
It'll be useless.
2014-11-21 01:47:30 +01:00
wm4 079ecd7f01 player: integrate ytdl_hook.lua 2014-11-19 18:59:38 +01:00
Jonathan Yong f29f16663a ao/wasapi: new wasapi device monitoring interface
Implement skeleton IMMNotificationClient to watch for changes in the
sound device.  This will make recovery possible from changes shared
mode sample rate, bit depth, "enhancements"/effects and even graceful
device removal.

http://msdn.microsoft.com/en-us/library/windows/desktop/dd371417%28v=vs.85%29.aspx

Signed-off-by: Kevin Mitchell <kevmitch@gmail.com>
2014-11-17 04:30:53 -08:00
wm4 e094e9cb75 audio: change how filters are inserted on playback speed changes
Use a pseudo-filter when changing speed with resampling, instead of
somehow changing a samplerate somewhere. This uses the same underlying
mechanism, but is a bit more structured and cleaner. It also makes some
of the following changes easier.

Since we now always use filters to change audio speed, move most of the
work set_playback_speed() does to recreate_audio_filters().
2014-11-10 22:02:05 +01:00
wm4 bebfaae666 vo_opengl: minimal EGL on X11 support
Pretty useless and only good for testing.

Does not include any form of GLES support.
2014-11-04 01:41:37 +01:00
Stefano Pigozzi fba8fedf66 build: remove bundle support from waf
Use TOOLS/osxbundle.py instead. It's just better and less hacky.
2014-11-01 11:00:03 +01:00
wm4 9b45b48c46 Drop libquvi support
No development activity (or even any sign of life) for almost a year.

A replacement based on youtube-dl will probably be provided before the
next mpv release. Ask on the IRC channel if you want to test.

Simplify the Lua check too: libquvi linking against a different Lua
version than mpv was a frequent issue, but with libquvi gone, no
direct dependency uses Lua, and such a clash is rather unlikely.
2014-10-25 20:18:22 +02:00
wm4 423a7de676 video: initial dxva2 support
Shamelessly stolen from ffmpeg. It probably doesn't work - you can debug
it yourself.
2014-10-25 19:25:22 +02:00
Stefano Pigozzi 474461244e rename ao_coreaudio_device.c -> ao_coreaudio_exclusive.c
This is so that the source file name matches the AO name
2014-10-23 09:55:17 +02:00
Alessandro Ghedini 3deb6c3d4f input: implement --input-file on unix using the IPC support 2014-10-17 20:47:43 +02:00
Alessandro Ghedini e0f0f6fe26 manpage: add JSON IPC documentation 2014-10-17 20:46:31 +02:00
Alessandro Ghedini 13039414f5 input: implement JSON-based IPC protocol 2014-10-17 20:46:31 +02:00
Stefano Pigozzi 49b6fa8779 cocoa: allow to disable apple remote at compile time
Actually doesn't remove the related flags so that one can still pass the
option with the option doing nothing.
2014-10-17 19:16:58 +02:00
wm4 1c5dbdbfc2 client API: add qthelper.hpp
This provides some helper functions and classes for C++/Qt. As the top
of qthelper.hpp says, this is built on top of the client API, and is a
mere helper provided for convenience.

Maybe this should be a separate library, but on the other hand I don't
see much of a point in that. It's also header-only, but C++ people like
such things. This makes it easier for us, because we don't need to care
about ABI compatibility.

The client API doesn't change, but bump it so that those who are using
this header can declare a proper dependency.
2014-10-13 23:54:19 +02:00
wm4 3093d93e1f vf_vapoursynth: add standalone Lua scripting 2014-10-12 01:33:10 +02:00
Stefano Pigozzi 8b6b84f36b cocoa: remove usage of Objective-C categories
Objective-C categories need special linker flags from the user when statically
linking (-ObjC LDFLAG), so make everyone's life simpler and remove them.
2014-10-12 00:19:44 +02:00
wm4 bce2be7b3e build: install input config files into doc dir
Users using binary packages don't have obvious access to them, so this
seems like a good idea.
2014-10-11 16:16:02 +02:00
Philip Sequeira 977ff1034f build: make zsh completion directory configurable
Also, use the zsh default location (rather than the Debian one).
2014-10-11 13:26:12 +02:00
Stefano Pigozzi 547b62f45e cocoa: separate video view and events view 2014-10-05 23:38:39 +02:00
Stefano Pigozzi d10b8c7e84 build: fix examples target paths
I 'broke' it in 78c362b. Sorry!
2014-10-04 11:46:51 +02:00
Stefano Pigozzi 78c362bfb8 build: allow to compile the cocoabasic.m example 2014-10-04 11:05:22 +02:00
wm4 e0b4daf3ad input: use libwaio for pipe input on Windows
Use libwaio to read from pipes (stdin or named pipes) on Windows. This
liberates us from nasty issues, such as pipes (as created by most
programs) not being possible to read in a non-blocking or event-driven
way. Although it would be possible to do that in a somewhat sane way
on Vista+, it's still not easy, and on XP it's especially hard. libwaio
handles these things for us.

Move pipe.c to pipe-unix.c, and remove Windows specific things. Also
adjust the input.c code to make this work cleanly.
2014-09-14 16:24:01 +02:00
Alexander Preisinger 94fe57856d vo_wayland: pixel perfect buffers
1.  Separate buffer and temporary file handling from the vo to make maintenance
    and reading code easier

2.  Skip resizing as much as possible if back buffer is still busy.

3.  Detach and mark osd buffers for deletion if we want to redraw them and they
    are still busy. This could be a possible case for the video buffers as
    well. Maybe better than double buffering.

All the above steps made it possible to have resizing without any artifacts
even for subtitles. Also fixes dozen of bugs only I knew, like broken subtitles
for rgb565 buffers. I can now sleep at night again.
2014-09-10 19:10:19 +02:00
wm4 564b957cc3 osdep: add POSIX semaphore emulation for OSX
OSX is POSIX conformant, but it's a sad joke: it provides the
<semaphore.h> prototype as the standard demands, but they're empty
wrappers, and all functions just return ENOSYS.

Emulate them similar to how osdep/io.h emulate filesystem functions on
Windows. By including the header, working sem_* functions become
available.

To make it async-signal safe, use a pipe for wakeup (write() is AS-safe,
but mutexes can't be). Actually I'm not sure anymore if we really need
AS-safety, but for now the emulation can do it.

On Linux, the system provides a far more efficient and robust
implementation. We definitely want to avoid using the emulation if
possible, so this code is active on OSX only. For convenience we always
build the source file though, even if the implementation is disabled and
no actual code is generated.

(Linux provides working semaphores, but is formally not POSIX
conformant. On OSX it's the opposite. Is POSIX a complete joke?)
2014-09-10 03:24:19 +02:00
Stefano Pigozzi a1d3afb395 vo_corevideo: remove this VO
This was kept in the codebase because it is slightly faster than --vo=opengl
on really old Intel cards (from the GMA era). Time to kill it, and let it rest.

Fixes #1061
2014-09-06 14:10:22 +02:00
wm4 68ff8a0484 Move compat/ and bstr/ directory contents somewhere else
bstr.c doesn't really deserve its own directory, and compat had just
a few files, most of which may as well be in osdep. There isn't really
any justification for these extra directories, so get rid of them.

The compat/libav.h was empty - just delete it. We changed our approach
to API compatibility, and will likely not need it anymore.
2014-08-29 12:31:52 +02:00
wm4 740f0f61d8 input: redo how --input-file is handled
Abandon the "old" infrastructure for --input-file (mp_input_add_fd(),
select() loop, non-blocking reads). Replace it with something that
starts a reader thread, using blocking input.

This is for the sake of Windows. Windows is a truly insane operating
system, and there's not even a way to read a pipe in a non-blocking
way, or to wait for new input in an interruptible way (like with
poll()). And unfortunately, some want to use pipe to send input to
mpv. There are probably (slightly) better IPC mechanisms available
on Windows, but for the sake of platform uniformity, make this work
again for now.

On Vista+, CancelIoEx() could probably be used. But there's no way on
XP. Also, that function doesn't work on wine, making development
harder. We could forcibly terminate the thread, which might work, but
is unsafe. So what we do is starting a thread, and if we don't want
the pipe input anymore, we just abandon the thread. The thread might
remain blocked forever, but if we exit the process, the kernel will
forcibly kill it. On Unix, just use poll() to handle this.

Unfortunately the code is pretty crappy, but it's ok, because it's late
and I wanted to stop working on this an hour ago.

Tested on wine; might not work on a real Windows.
2014-08-25 01:00:21 +02:00
Jan Palus 69d5356d76 build: fix libmpv build when using system waf
Since the 'syms' tool is shipped in waf's extras, when using system waf the
default tool overrides our own. Force our syms tool by providing the tooldir.

Fixes #1006
2014-08-13 17:09:45 +02:00
wm4 7898169484 build: add hacks to force waf to generate valid .pc files
Don't like this? You're invited to fix this crap.
2014-08-07 23:45:40 +02:00
Stefano Pigozzi 2e241c0a47 build: allow to disable building the cplayer 2014-08-06 09:31:59 +02:00
FRAU KOUJIRO b8a431c892 cocoa: macosx_application needs cocoa-application 2014-08-06 09:31:59 +02:00
wm4 5a0db9bf8a build: move def file to libmpv/
This is more consistent with mpv.pc, which is also in libmpv/.
2014-08-05 20:02:41 +02:00
wm4 43ddf2099b client API: add and use the MPV_MAKE_VERSION macro
This is probably nicer. The actual version number doesn't change (other
than the minor being incremented).

The "| 0UL" is to make the type unsigned long int, like it was before.
2014-08-05 02:23:14 +02:00
wm4 bdf607ea5f build: list exported symbols explicitly
Instead of using a regex to match names to be exported from the libmpv
dynamic shared library, use a libmpv.def file, which lists all exported
functions explicitly.

This reduces the platform specifics in syms.py. I'm not sure if the
separate compile_sym task is still needed (it could probably be
collapsed, which would concentrate the platform specifics into one
place).
2014-08-05 02:21:29 +02:00
wm4 d68a759fa4 Improve setting AVOptions
Use OPT_KEYVALUELIST() for all places where AVOptions are directly set
from mpv command line options. This allows escaping values, better
diagnostics (also no more "pal"), and somehow reduces code size.

Remove the old crappy option parser (av_opts.c).
2014-08-02 03:12:33 +02:00
wm4 f8ab732ac3 video/filter: add vf_buffer
Mostly useful for debugging.
2014-07-30 23:29:00 +02:00
wm4 559fe1daac Add Plan 9-style barriers
Plan 9 has a very interesting synchronization mechanism, the
rendezvous() call. A good property of this is that you don't need to
explicitly initialize and destroy a barrier object, unlike as with e.g.
POSIX barriers (which are mandatory to begin with). Upon "meeting", they
can exchange a value.

This mechanism will be nice to synchronize certain stages of
initialization between threads in the following commit.

Unlike Plan 9 rendezvous(), this is not implemented with a hashtable,
because that would require additional effort (especially if you want to
make it actually scele). Unlike the Plan 9 variant, we use intptr_t
instead of void* as type for the value, because I expect that we will be
mostly passing a status code as value and not a pointer. Converting an
integer to void* requires two cast (because the integer needs to be
intptr_t), the other way around it's only one cast.

We don't particularly care about performance in this case either. It's
simply not important for our use-case. So a simple linked list is used
for waiters, and on wakeup, all waiters are temporarily woken up.
2014-07-26 20:29:48 +02:00
wm4 23a7257cca Revert "Remove DVD and Bluray support"
This reverts commit 4b93210e0c.

*shrug*
2014-07-15 01:49:02 +02:00
wm4 4b93210e0c Remove DVD and Bluray support
It never worked well. Just remux your DVD and BD images to mkv.
2014-07-14 14:34:14 +02:00
wm4 54a4a25fe9 tv: move demuxer parts to separate file
Now all demuxer implementations (at least demuxer API-wise) are in the
demux directory.
2014-07-05 17:07:15 +02:00
wm4 338004bcfc dvd, bluray, cdda: add demux_disc containing all related hacks
DVD and Bluray (and to some extent cdda) require awful hacks all over
the codebase to make them work. The main reason is that they act like
container, but are entirely implemented on the stream layer. The raw
mpeg data resulting from these streams must be "extended" with the
container-like metadata transported via STREAM_CTRLs. The result were
hacks all over demux.c and some higher-level parts.

Add a "disc" pseudo-demuxer, and move all these hacks and special-cases
to it.
2014-07-05 17:07:15 +02:00
wm4 a97256c1d5 demux: move packet functions to a separate source file 2014-07-05 17:07:14 +02:00
Stefano Pigozzi 041557b639 ao_coreaudio: move spdif code to a new AO
The mplayer1/2/mpv CoreAudio audio output historically contained both usage
of AUHAL APIs (these go through the CoreAudio audio server) and the Device
based APIs (used only for output of compressed formats in exclusive mode).

The latter is a very unwieldy and low level API and pretty much forces us to
write a lot of code for little workr. Also with the widespread of HDMI, the
actual need for outputting compressed audio directly to the device is getting
lower (it was very useful with S/PDIF for bandwidth constraints not allowing
a number if channels transmitted in LPCM).

Considering how invasive it is (uses hog/exclusive mode), the new AO
(`ao_coreaudio_device`) is not going to be autoprobed but the user will have
to select it.
2014-07-02 21:43:07 +02:00
wm4 5b8298376b stream: add a file cache
For remarks, pretty much see the manpage additions. Could help with
network streams that require too much seeking (maybe), or might be
extended to help with the use case of watching and downloading a file
at the same time.

In general, it might be a useless feature and could be removed again.
2014-06-22 05:04:05 +02:00
wm4 f5e1756475 DOCS: remove en/ sub-directory
This additional sub-directory doesn't serve any purpose anymore. Get rid
of it.
2014-06-20 23:01:12 +02:00
wm4 05fd3e701b client API: declare as stable
It is reasonably stable, so all further changes will be versioned.

Also change how the libmpv version number is generated. Fix the patch
version number to 0; I don't think we have a use for this. In
particular, the version doesn't version mpv, just the client API.
2014-06-20 19:26:04 +02:00
wm4 af9e40119d build: remove some trailing whitespace 2014-06-20 19:21:11 +02:00
xylosper 858d6d93cb build: add '--enable-libmpv-static' option
Signed-off-by: wm4 <wm4@nowhere>
2014-06-16 18:02:50 +02:00
wm4 8ad8dedca8 win32: implement --priority differently
Does anyone actually use this?

For now, update it, because it's the only case left where an option
points to a global variable (and not a struct offset).
2014-06-12 00:55:14 +02:00
Alessandro Ghedini cc74bc3fec build: generate and install zsh completion script 2014-06-08 20:48:42 +02:00
wm4 60e0833f1f build: prevent installation of client API example
This was never intended to be installed; waf just picked it up
automagically. There's also a closed ticket on github where someone
complains that the program "simple" is installed, and I didn't realize
at this point that it was actually installed by default when enabling
the client API.
2014-06-06 19:43:53 +02:00
wm4 a192f32a3a stream: remove VCD support
If a single person complains, I will readd it. But I don't expect that
this will happen.

The main reason for removing this is that it's some of the most unclean
code remaining, it's unmaintained, and I've never ever heard of someone
using it.
2014-06-01 17:22:21 +02:00
ChrisK2 ce69afab44 lua/osc: forgot some changed files in previous commit 2014-05-23 13:24:27 +02:00
wm4 2279f718de player: reorganize how lua scripts are loaded
Make loading of scripts independent of Lua. Move some of the loading
code from lua.c to scripting.c, and make it easier to add new scripting
backends.
2014-05-13 02:39:37 +02:00
wm4 feb1f8f18f video/out: separate out code to compute window size
Currently, vo_reconfig() calculates the requested window size and sets
the vo->dwidth/dheight fields _if_ VOCTRL_UPDATE_SCREENINFO is
implemented by the VO or the windowing backend. The window size can be
different from the display size if e.g. the --geometry option is used.
It will also set the vo->dx/dy fields and read vo->xinerama_x/y.

It turned out that this is very backwards and actually requires the
windowing backends to workaround these things. There's also
MPOpts.screenwidth/screenheight, which used to map to actual options,
but is now used only to communicate the screen size to the vo.c code
calculating the window size and position.

Change this by making the window geometry calculations available as
separate functions. This commit doesn't change any VO code yet, and just
emulates the old way using the new functions. VO code will remove its
usage of VOCTRL_UPDATE_SCREENINFO and use the new functions directly.
2014-05-06 20:22:32 +02:00
wm4 ec60669cd1 vdpau: add a postprocessing pseudo-filter
This factors out some code from vo_vdpau.c, especially deinterlacing
handling. The intention is to use this for vo_vdpau.c to make the logic
significantly easier, and to use it for vo_opengl (gl_hwdec_vdpau.c) to
allow selecting deinterlace and postprocessing modes.

As of this commit, the filter actually does nothing, since both vo_vdpau
and vo_opengl treat the generated images as normal vdpau images. This
will change in the following commits.
2014-05-02 01:08:02 +02:00
wm4 2b26517ef7 dispatch: move into its own source file
This was part of osdep/threads.c out of laziness. But it doesn't contain
anything OS dependent. Note that the rest of threads.c actually isn't
all that OS dependent either (just some minor ifdeffery to work around
the lack of clock_gettime() on OSX).
2014-04-23 21:16:51 +02:00
wm4 0cff5836c3 Remove CPU detection and inline asm handling
Not needed anymore. I'm not opposed to having asm, but inline asm is too
much of a pain, and it was planned long ago to eventually get rid fo all
inline asm uses.

For the note, the inline asm use that was removed with the previous
commits was almost worthless. It was confined to video filters, and most
video filtering is now done with libavfilter. Some mpv filters (like
vf_pullup) actually redirect to libavfilter if possible.

If asm is added in the future, it should happen in the form of external
files.
2014-04-19 17:10:56 +02:00
wm4 132f395aac Remove radio://
It was disabled by default, works only for analogue radio, and I bet
nobody uses it.
2014-04-13 18:51:43 +02:00
Kevin Mitchell bc79ded75a mp_tags: move generic mp_tags stuff into its own .c/.h files in common/
rename add_metadata to the more genera/descriptive mp_tags_copy_items_from_av_dictionary

Signed-off-by: wm4 <wm4@nowhere>
2014-04-13 18:03:01 +02:00
wm4 47972a0077 player: remove ASX, SMIL and NSC playlist parsers
These playlist parsers are all what's left from the old mplayer playlist
parsing code. All of it is old code that does little error checking; the
type of C string parsing code that gives you nightmare.

Some playlist parsers have been rewritten and are located in
demux_playlist.c. The removed formats were not reimplemented. ASX and
SMIL use XML, and since we don't want to depend on a full blown XML
parser, this is not so easy. Possibly these formats could be supported
by writing a very primitive XML-like lexer, which would lead to success
with most real world files, but I haven't attempted that. As for NSC, I
couldn't find any URL that worked with MPlayer, and in general this
formats seems to be more than dead.

Move playlist_parse_file() to playlist.c. It's pretty small now, and
basically just opens a stream and a demuxer. No use keeping
playlist_parser.c just for this.
2014-04-13 15:40:05 +02:00
wm4 33f822b715 video: add VapourSynth filter bridge
Mainly meant to apply simple VapourSynth filters to video at runtime.
This has various restrictions, which are listed in the manpage.

Additionally, this actually copies video frames when converting frame
references from mpv to VapourSynth, and a second time when going from
VapourSynth to mpv. This is inefficient and could probably be easily
improved. But for now, this is simpler, and in fact I'm not sure if
we even can references VapourSynth frames after the core has been
destroyed.
2014-04-12 19:31:50 +02:00
xylosper fb47f2f940 player: rename dvdnav to discnav
Now, navigation works both of DVD and non-BD-J Blu-ray. Therefore,
rename all 'dvdnav' strings which are not DVD specific to 'discnav'
2014-03-30 11:42:49 +09:00
wm4 6fa2c52589 stream_cdda: remove unused stuff
This cd_info_t struct was practically unused. The only thing it did was
storing the track name of the form "Track %d" in a very roundabout way.
Remove it. (It made more sense when there was still CDDB support.)
2014-03-26 16:55:27 +01:00
wm4 98cd2c4122 build: simplify libavfilter configure checks
This is all not needed anymore. In particular, remove all configure
switches except --enable-libavfilter.
2014-03-16 13:19:29 +01:00
wm4 c7e620df96 af_lavrresample: remove avresample_set_channel_mapping() fallbacks
This function is now always available.

Also remove includes of reorder_ch.h from some AOs (these are just old
relicts).
2014-03-16 13:19:28 +01:00
wm4 bb0290145a sub: remove old MPlayer DVD sub decoder
The DVD sub decoder in Libav 9 was broken/incomplete, so we kept the
MPlayer decoder around. Now it's not needed anymore.
2014-03-16 13:19:28 +01:00
wm4 3ec7f528c4 vd_lavc: remove compatibility crap
All this code was needed for compatibility with very old libavcodec
versions only (such as Libav 9).

Includes some now-possible simplifications too.
2014-03-16 13:19:19 +01:00
wm4 14c1816c71 build: automagically extract client library version
This reads MPV_CLIENT_API_VERSION from the source header, and turns it
into a 3 part version number.

E.g. if MPV_CLIENT_API_VERSION were 0x12abcdef, this would result in
"18.171.773615" (8 bits, 8 bits, 16 bits).

We'll see if this is actually useful, or if it's too clever.
2014-03-12 00:40:55 +01:00
wm4 40855d6c12 build: rename --enable-shared switch
Rename it to --enable-libmpv-shared. The option name didn't really
tell much. When we add the possibility to create a static library,
it would also be bad if that were named --enable-static (because it
would sound like it does what --static-build does).
2014-03-11 23:56:19 +01:00
Alessandro Ghedini 8737ca9582 build: fix version in mpv.pc 2014-03-11 23:30:50 +01:00
Diogo Franco (Kovensky) 58011810e5 ao_wasapi: Split into 2 files
ao_wasapi.c was almost entirely init code mixed with option code and
occasionally actual audio handling code. Split most things to
ao_wasapi_utils.c and keep the audio handling code in ao_wasapi.c.
2014-03-11 16:37:02 -03:00
Alessandro Ghedini 499a67582a build: install client.h under mpv/ instead of libmpv/ 2014-03-11 19:15:42 +01:00
Alessandro Ghedini dfc57e6d32 libmpv: add pkg-config file 2014-03-11 19:15:42 +01:00