Commit Graph

3126 Commits

Author SHA1 Message Date
Jonathan Yong e94fc5ee66 configure: fix vcd detection on Windows 2013-07-13 04:07:40 +02:00
wm4 dc95504a52 build: change vf_dlopen test
Didn't work on Windows. Apparently, WIN32 is not set in the Makefile.
2013-07-12 18:33:39 +02:00
Stephen Hutchinson d176f9571f build: make the "built on" report opt-out 2013-07-11 09:27:01 +02:00
Rudolf Polzer 1d48b11478 configure: add libdl detection to ladspa, vf_dlopen 2013-07-09 09:28:42 +02:00
wm4 7a71a2cc48 configure: fix oversight in log message 2013-07-08 21:29:01 +02:00
wm4 09250d9921 configure: make zlib non-optional
This is needed by demux_mkv to decode files with compressed tracks.

Requested by nikoli.
2013-07-08 19:28:11 +02:00
wm4 49bf0fb9df configure: fix previous commit
This doesn't help if -pthread is omitted. (Apparently, glibc 2.17, on
which I tested the previous commit, doesn't require -lpthread in order
to use pthreads either.)
2013-07-08 02:24:42 +02:00
wm4 bfe0207a7a configure: link with -lrt
In order to use clock_gettime() (which we need for use with
pthread_cond_timedwait()), most glibc versions need to link with -lrt.
2013-07-08 01:53:59 +02:00
wm4 659a314a19 osdep: remove unused mmap compatibility hacks
Not sure how this worked. Only af_export.c and tvi_v4l2.c were
using mmap, but they didn't include osdep/mmap.h or mmap_anon.h. In
any case, we trust that the target system is sufficiently POSIX
compliant if mmap is actually defined (as checked by configure).
2013-07-07 21:44:37 +02:00
wm4 74b6d8f306 configure: simplify arch macros 2013-07-07 21:37:31 +02:00
wm4 fb1e2425ed configure: prune some more crap
All of the removed lines are hopefully useless and didn't do anything.
2013-07-07 21:29:14 +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
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 b2b3778a48 configure: rename --enable/disable-libquvi to --enable/disable-libquvi4
--disable-libquvi creates the impression that it disables libquvi 0.9
as well. It doesn't, because it refers to libquvi 0.4, and 0.4 and 0.9
are practically completely different libraries. Make this more explicit
by renaming the switch to include the "4" version number.
2013-07-05 22:53:59 +02:00
wm4 49fb242edb configure: prefer libquvi 0.4.x over libquvi 0.9.x
Because 0.4.x is the current series of stable releases.
2013-06-28 15:51:20 +02:00
wm4 5f664d78e6 core: add libquvi 0.9 support
This adds support for libquvi 0.9.x, and these features:
- start time (part of youtube URL)
- youtube subtitles
- alternative source switching ('l' and 'L' keys)
- youtube playlists

Note that libquvi 0.9 is still in development. Although this seems to
be API stable now, it looks like there will be a 1.0 release, which is
supposed to be the next stable release and the actual successor of
libquvi 0.4.x.
2013-06-28 15:47:35 +02:00
James Ross-Gowan 9fcce1c8a6 configure: fix wasapi0 checks 2013-06-26 22:55:04 +10:00
wm4 403a266d46 Merge branch 'sub_mess2'
...the return.
2013-06-25 00:43:04 +02:00
wm4 f48829b546 sub: libguess support for -subcp
Actually this is rather disappointing.
2013-06-25 00:11:57 +02:00
Stefano Pigozzi 97f38de07a configure: cocoa: link to libarclite
libarclite provides method stubs for the Subscripting headers added in
0407869ae3. This allows to correclty build mpv on OSX 10.7 (I had tested that
commit with OSX 10.8 running 10.7 SDK).

It seems on 10.8 this option does't make any difference in the linked libraries
(checked with otool -L) so I just add it unconditionally.

Warning: This doesn't mean mpv moved to ARC. To do that one would have to add
`-fobjc-arc` to the cflags.
2013-06-22 08:53:41 +02:00
Jonathan Yong a9f76c6d86 ao_wasapi0: add new wasapi event mode ao 2013-06-18 13:16:58 +02:00
Jonathan Yong 8d83837cdb configure: remove redundant WINVER set 2013-06-18 12:19:52 +02:00
wm4 171d1ef7fe osdep: remove shmem wrapper
This is unused now that the cache is always threaded.
2013-06-18 02:19:15 +02:00
wm4 819a368854 configure: make check for stream cache verbose
Also add a minor comment about the stream cache needing pthreads now
to DOCS/crosscompile-mingw.txt.
2013-06-16 22:12:56 +02:00
wm4 236577af09 cache: use threads instead of fork()
Basically rewrite all the code supporting the cache (i.e. anything other
than the ringbuffer logic). The underlying design is untouched.

Note that the old cache2.c (on which this code is based) already had a
threading implementation. This was mostly unused on Linux, and had some
problems, such as using shared volatile variables for communication and
uninterruptible timeouts, instead of using locks for synchronization.

This commit does use proper locking, while still retaining the way the
old cache worked. It's basically a big refactor.

Simplify the code too. Since we don't need to copy stream ctrl args
anymore (we're always guaranteed a shared address space now), lots of
annoying code just goes away. Likewise, we don't need to care about
sector sizes. The cache uses the high-level stream API to read from
other streams, and sector sizes are handled transparently.
2013-06-16 22:05:09 +02:00
wm4 7c4202b863 cache: make the stream cache a proper stream that wraps other streams
Before this commit, the cache was franken-hacked on top of the stream
API. You had to use special functions (like cache_stream_fill_buffer()
instead of stream_fill_buffer()), which would access the stream in a
cached manner.

The whole idea about the previous design was that the cache runs in a
thread or in a forked process, while the cache awa functions made sure
the stream instance looked consistent to the user. If you used the
normal functions instead of the special ones while the cache was
running, you were out of luck.

Make it a bit more reasonable by turning the cache into a stream on its
own. This makes it behave exactly like a normal stream. The stream
callbacks call into the original (uncached) stream to do work. No
special cache functions or redirections are needed. The only different
thing about cache streams is that they are created by special functions,
instead of being part of the auto_open_streams[] array.

To make things simpler, remove the threading implementation, which was
messed into the code. The threading code could perhaps be kept, but I
don't really want to have to worry about this special case. A proper
threaded implementation will be added later.

Remove the cache enabling code from stream_radio.c. Since enabling the
cache involves replacing the old stream with a new one, the code as-is
can't be kept. It would be easily possible to enable the cache by
requesting a cache size (which is also much simpler). But nobody uses
stream_radio.c and I can't even test this thing, and the cache is
probably not really important for it either.
2013-06-16 22:05:09 +02:00
wm4 74e3ac8bf8 sd_lavc_conv: add hack if AV_CODEC_PROP_TEXT_SUB is not available
Otherwise this could happily open decoders for image subtitles or even
audio/video decoders. AV_CODEC_PROP_TEXT_SUB is a preprocessor symbol,
but it's still better to detect this properly instead of using #ifdef,
because these flags might as well be changed into enums sooner or later.
2013-06-03 22:40:06 +02:00
wm4 60a7f3b8bc af_lavfi: add libavfilter bridge
Mostly copied from vf_lavfi. The parts that could be shared are minor,
because most code is about setting up audio and video, which are too
different.

This won't work with Libav. I used ffplay.c as guide, and noticed too
late that their setup methods are incompatible with Libav's. Trying to
make it work with both would be too much effort. The configure test for
av_opt_set_int_list() should disable af_lavfi gracefully when compiling
with Libav.

Due to option parser chaos, you currently can't have a "," as part of
the filter graph string - not even with quoting or escaping. This will
probably be fixed later.

The audio filter chain is not PTS aware. So we have to do some hacks
to make up a fake PTS, and we have to map the output PTS back to the
filter chain's method of tracking PTS changes and buffering, by
adjusting af->delay.
2013-05-23 17:44:06 +02:00
Stephen Hutchinson 08bfe8721c configure: map --enable-sdl2 to autodetection
Commit 02bbd87b disabled SDL linking by default. This commit followed
the ancient mplayer convention of disabling detection of compiler flags
with  --enable-* switches. Unfortunately, this makes compiling with SDL
enabled a pain.

Make --enable-sdl/sdl2 use autodetection, even if it's inconsistent with
most other --enable-* switches. The same is already done for
--enable-openal, though.

Based on a pull request by qyot27.
2013-05-21 00:14:42 +02:00
wm4 b5f07e86b8 configure: reject older libswresample
mpv still builds with ffmpeg 1.0.x, however libswresample keeps cuasing
trouble. In older releases, libswresample simply crashed when
downmixing. In somewhat newer versions, it produces distorted output and
downmixing isn't even close to correct.

With ffmpeg release 1.1 (ffmpeg git tag n1.1), everything seems to work
fine. The release uses 0.17.102 as libswresample version, so bump the
required minimum version to that.
2013-05-19 14:06:59 +02:00
wm4 279f4b59dc audio: fix compilation with older libavresample versions
The libavresample version of the current Libav stable release lacks the
avresample_set_channel_mapping() function. (FFmpeg's libswresample seems
to be fine, because they added swr_set_channel_mapping() first.)

Add a cheap/slow workaround to do channel reordering on our own. We
don't use the recently removed MPlayer code (see commit 586b75a),
because that is not generic enough.

The functionality should be the same as with full-featured
libavresample, and any differences are bugs. It's probably slower,
though.
2013-05-13 00:39:07 +02:00
Stefano Pigozzi afdc9c4ae2 OSX: use native Cocoa's event loop
Schedule mpv's playloop as a high frequency timer inside the main Cocoa event
loop. This has the benefit to allow accessing menus as well as resizing the
window without the playback being blocked and allows to remove countless hacks
from the code that involved manually pumping the event loop as well simulating
manually some of the Cocoa default behaviours.

A huge improvement consists in removing NSApplicationLoad. This is a C function
defined in the Cocoa header and implements a minimal OSX application under ther
hood so that you can use the Cocoa GUI toolkit from C/C++ without having to
respect the Cocoa standards in terms of application initialization. This was
bad because the behaviour implemented by NSApplicationLoad was hard to customize
and had several gotchas especially in the menu department.

mpv was changed to be just a nib-less application. All the Cocoa part is still
generated in code but the event handling is now not dissimilar to what is
present in a stock Mac application.

As a part of reviewing the initialization process, I also removed all of
`osdep/macosx_finder_args`. The useful parts of the code were moved to
`osdep/macosx_appication` which has the broaded responsibility of managing the
full lifecycle of the Cocoa application. By consequence the
`--enable-macosx-finder` configure switch was killed as well, as this feature
is always enabled.

Another change the users will notice is that when using a bundle the `--quiet`
option will be inserted much earlier in the initializaion process. This results
in mpv not spamming mpv.log anymore with all the initialization outputs.
2013-05-12 15:27:54 +02:00
Rudolf Polzer 02bbd87b2b For now, disable autodetection of sdl/sdl2
This is done because statically linked SDL libraries are incompatible
with direct X11 function use (e.g. vo_x11, vo_gl etc.) because of
clashing symbol names.

http://bugzilla.libsdl.org/show_bug.cgi?id=1828
2013-05-11 16:54:46 +02:00
Alexander Preisinger c0b8c35e3b wayland: use new function xkb_keymap_from_buffer
Bump xkbcommon version and use the new xkb_keymap_from_buffer. This is more
secure, because the from_string expects a 0 terminated string, but this cannot
be guaranteed with mmap.
2013-05-02 21:01:19 +02:00
wm4 d853abafc3 x11: use mpv internal key auto-repeat handling if possible
Block X11's native key repeat, and use mpv's key repeat handling in
input.c instead.

No configure check for XKB. Even though it's an extension, it has been
part of most (all?) xlibs since 1996. If XKB appears to be missing,
just refuse enabling x11.

This is a potentially controversial change. mpv will use its own key
repeat rate, instead of X11's. This should be better, because seeking
will have a standardized "speed" (seek events per seconds when keeping
a seek key held down). It will also allow disabling key repears for
certain commands, though this is not done anywhere yet.

The new behavior can be disabled with the --native-keyrepeat option.
2013-04-24 18:07:01 +02:00
wm4 7bb3929a5d configure: enable libavdevice by default
Used to be disabled by default, because libavdevice depends on
libavfilter, and earlier versions of libavfilter exports symbols that
clash with mpv's due to its MPlayer filter wrapper. Our configure script
explicitly detects these symbols now, and we can use that to safely
auto-detect libavdevice too. If we detect that libavfilter can't be
safely used, libavdevice is disabled as well.
2013-04-23 14:11:43 +02:00
wm4 7979718159 vf_lavfi: add libavfilter bridge
Requires recent FFmpeg/Libav git versions. Earlier versions will not
be supported, as the API is different. (A libavfilter version that
uses AVFrame instead of AVFilterBuffer is needed.)

Note that this is sort of useless, because the option parser prevents
you from making use of the full libavfilter graph syntax. This has to be
fixed later.

Most of the filter creation code (half of the config() function) has
been taken from avplay.c.

This code is not based on MPlayer's vf_lavfi. The MPlayer code doesn't
compile as it hasn't been updated through multiple libavfilter API
changes, making it completely useless as a starting point.
2013-04-21 04:39:58 +02:00
wm4 593aa1834b configure: add -mconsole on MinGW
At least libsdl adds -mwindows to the cflags, which marks the .exe
binary as GUI application. This means the program detaches from the
console when started in cmd.exe, instead of showing the playback
status, receiving console input, and so on.

Append -mconsole to the linker command line to disable -mwindows.
2013-04-10 17:15:29 +02:00
Stephen Hutchinson b224f37174 vcd_read_win32.h: fix compilation on MinGW-w64
ntddcdrm.h is no longer under the 'ddk' directory in MinGW-w64,
and since MPV focuses on it instead of the old MinGW32, there's no
reason to keep that dir prefix, as it stops VCD support from being
built at all for Windows.
2013-04-06 00:00:16 +02:00
wm4 8abce1effa configure: fix compilation on Linux
This line was accidentally removed by the previous commit.
2013-03-31 17:11:41 +02:00
Stefano Pigozzi c8fd9e50e4 remove Apple Remote related code
The OSX part of the Apple Remote was unmaintained for a long time and was not
working anymore. I tried to update the cookies to what the current versions of
OS X expect without much luck. I decided to remove it since Apple is not
including the IR receiver anymore in new hardware and it's clear that wifi
based remotes are the way to go.

A third party iOS app should be used in it's place. In the future we could look
into having a dedicated iOS Remote Control app like VLC and XBMC do.

The Linux side (`appleir.c`) was relatively tidy but it looks like LIRC can be
configured to work with any version of Apple Remote [1] and is more maintained.

[1] LIRC Apple Remote configs: http://lirc.sourceforge.net/remotes/apple/
2013-03-31 12:15:40 +02:00
Stefano Pigozzi 840c98d190 configure: fix OpenGL autodetection on OS X
Was broken from 746b5e6 since the OpenGL headers are under OpenGL/ and not GL/
on OS X. Thanks to @Kovensky for the initial patch.
2013-03-24 20:00:22 +01:00
Kovensky 746b5e6027 configure: check for presence of glext.h
vo_opengl depends on glext.h to build. Also link to Khronos' copy, which
should work on all compilers and is kept up-to-date with newer
extensions.
2013-03-23 21:04:39 +01:00
wm4 a9c9999973 video: use new method to get QP table
This only matters for those who want to use vf_pp. The old API is marked
as deprecated, and doesn't work on Libav. It was broken on FFmpeg, but
has recently started working again - the fields in question were not un-
deprecated though. Instead you're supposed to use a new API, which does
exactly the same thing (what...?).

Also don't pass the QP table with mp_image_copy_attributes() - it
probably does more harm than it's useful.

By the way, with -vf=dlopen=TOOLS/vf_dlopen/showqscale.so, it appears
the table as output by recent FFmpeg is offset by 1 macroblock in X
direction and 2 macroblocks in Y direction, which most likely will
interfere with normal vf_pp operation. However, this is not my problem.

The only real reason for this commit is that we can finally get rid of
all libav* related deprecation warnings. (Though they are constantly
deprecating APIs, so this will not last long.)
2013-03-15 14:21:42 +01:00
wm4 21e4f1680c configure: bump minimum FFmpeg/Libav versions, remove compat hacks
We consider FFmpeg 1.x and Libav 0.9.x releases compatible. Support
for FFmpeg 0.9.x and Libav 0.8.x is considered infeasible and has been
dropped in the previous commits. The bits that break compatibility are
mainly the CodecID renaming (trivial, but would require nasty hacks
everywhere), the avcodec_encode_video2() function (missing in older
releases, mandatory in newer ones), and the resampler changes (older
releases miss lib{av,sw}resample, newer versions removed the
libavcodec resampler).

Remove some other compatibility bits that were needed to for releases
for which we drop support.

The comment about Libav 0.9 in compat/libav.h is incorrect and should
have been 0.8 (the symbol is present in Libav 0.9).
2013-03-13 23:52:04 +01:00
Stefano Pigozzi 048ceef655 af_lavrresample: add new resampling filter to replace the old ones
Remove `af_resample` and `af_lavcresample`. The former is a mess while the
latter uses an API that was long deprecated in libavcodec and is now removed.

`af_lavrresample` rougly has the same features and structure of
`af_lavcresample`.

libswresample fallback by wm4.
2013-03-13 23:51:30 +01:00
wm4 514d8a7c9d video: make use of libavcodec refcounting
Now lavc_dr1.c is not used anymore if libavcodec is recent enough.
2013-03-13 23:51:30 +01:00
wm4 b52f3800c2 configure: add _GNU_SOURCE to CFLAGS by default
In theory, projects have to define feature test macros to enable various
system functionality in system headers. (This is done so to ensure new
identifiers can be added to system headers, without breaking old
programs by causing name conflicts.) This includes macros like
_GNU_SOURCE, _BSD_SOURCE, _POSIX_C_SOURCE etc.

Traditionally, gcc as well as glibc headers implicitly assumed
_GNU_SOURCE if no feature test macros were defined by the user.
clang did this too to ensure compatibility with gcc centric programs
(which in practice includes most Linux programs).

However, it appears recent clang versions started to prefer BSD
traditional function over the POSIX, which switches the definition
of a function used by mp_msg.c:

       pid_t getpgrp(void);                 /* POSIX.1 version */
       pid_t getpgrp(pid_t pid);            /* BSD version */

mp_msg.c expects the POSIX version, while clang gives us the BSD
version, resulting in a compilation failure.

Solve this by defining _GNU_SOURCE. This requests most features from
system headers, and explicitly prefers POSIX definitions over BSD,
which should fix the compilation issue.
2013-03-11 01:06:02 +01:00
wm4 28de5a7891 configure: remove -fomit-frame-pointer and -ffast-math from CFLAGS
-fomit-frame-pointer is enabled by default with recent gcc and clang
compilers if -O2 is used. It also breaks debugging when optimization is
disabled, so it makes absolutely no sense to have -fomit-frame-pointer
explicitly in the CFLAGS.

Get rid of -ffast-math too. It's little more than cargo-culting, and
might actually break NaN handling and such things.
2013-03-11 00:50:01 +01:00
Alexander Preisinger b4a4fddff8 wayland: change wayland-egl pkg-config version
wayland-egl is part of mesa and uses the mesa version.
2013-03-02 12:17:49 +01:00
Alexander Preisinger bf9b9c3bd0 wayland: add wayland support
All wayland only specific routines are placed in wayland_common.
This makes it easier to write other video outputs.

The EGL specific parts, as well as opengl context creation, are in gl_common.

This backend works for:
    * opengl-old
    * opengl
    * opengl-hq

To use it just specify the opengl backend
    --vo=opengl:backend=wayland
or disable the x11 build.

Don't forget to set EGL_PLATFORM to wayland.

Co-Author: Scott Moreau
(Sorry I lost the old commit history due to the file structure changes)
2013-02-28 20:01:33 +01:00
wm4 f7636474eb configure: fix recently added tests
Commit 4d016a9 added some configure tests using statement_check.
They wrongly used $_ld_tmp, which causes random failure, depending on
whether the previous test using $_ld_tmp was successful. This happened
because I blindly copied the statement_checks from somewhere else.
Fix them.
2013-02-11 01:08:48 +01:00
wm4 4d016a92c8 core: redo how codecs are mapped, remove codecs.conf
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.
2013-02-10 17:25:56 +01:00
wm4 37c5c114af Remove BSD legacy TV/radio support (BT848 stuff)
FreeBSD actually supports V4L2, and V4L2 supports this chip. Also,
this chip is from 1997. Farewell.
2013-02-06 23:03:39 +01:00
Uoti Urpala 458c41c5c7 stream_cdda: support latest libcdio version 2013-01-24 12:01:06 +01:00
Rudolf Polzer 8fa59d4655 configure: for now reject the newer libcdio API
A patch supporting the newer API AND the older API is in the works.
2013-01-24 10:45:36 +01:00
Stefano Pigozzi 1bbcb15d8e osxbundle: add header padding to the binary
This avoids install_name_tool to run out of header space when changing the
paths to the dylibs.
2013-01-16 22:16:28 +01:00
wm4 a27a494e66 configure: change libcaca test to pkg-config
Caca is important.
2013-01-13 17:32:39 +01:00
wm4 f064debfb7 configure: remove references to nas 2013-01-13 17:32:39 +01:00
wm4 177e9c4b41 configure: remove unused check for mkstemp()
Was used by the win32 loader to implement a similar win32 API function.
2013-01-13 17:32:39 +01:00
wm4 20c9dfa616 Replace strsep() uses
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.
2013-01-13 17:32:39 +01:00
wm4 41dbf07fc5 osdep: remove gettimeofday() emulation
Guaranteed by POSIX, and mingw provides it as well.
2013-01-13 17:32:39 +01:00
wm4 b87b0ef5ec osdep: remove broken vsscanf() emulation
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.
2013-01-13 14:27:10 +01:00
wm4 fe6c93eab8 configure: remove check for .align semantics
The check determined whether the argument for .align is in bytes, or
log2(bytes). Apparently it's always in bytes for ELF i386 systems, and
this check is used for x86 inline assembler only. Even if this
assumption should be wrong, it likely won't cause much damage: the
existing code uses it only in the form ".align 4", which means in the
worst case it will try to align to 16 bytes, which doesn't cause any
problems (unless the object file format does not support such a high
alignment).

Update the filters that used this.

Quoting the GNU as manual:

For other systems, including ppc, i386 using a.out format, arm and
strongarm, it is the number of low-order zero bits the location counter
must have after advancement. For example `.align 3' advances the
location counter until it a multiple of 8. If the location counter is
already a multiple of 8, no change is needed.
2013-01-13 14:10:43 +01:00
wm4 ec57c94ba2 configure: remove __builtin_expect check
Change the only usage of HAVE_BUILTIN_EXPECT, demux.h, to use an #ifdef
instead. In theory, a configure check is better, but nobody does it this
way anyway, and we seek to reduce the configure script.
2013-01-13 13:55:22 +01:00
wm4 93d1bff4d3 configure: cleanup: remove unused --datadir switch
Unused. mplayer-svn used it as fallback directory to locate the OSD
font, and for the GUI.
2013-01-13 13:38:32 +01:00
wm4 418f68d6ca configure: cleanup: remove unused xshape switches
They didn't do anything since the internal GUI was removed years ago.
2013-01-13 13:35:33 +01:00
Rudolf Polzer c3cc38e4c4 vo/ao: SDL 1.2+ audio driver, SDL 2.0+ accelerated video driver
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.
2012-12-28 08:40:28 +01:00
Rudolf Polzer 3ea3f72967 configure: clean up use of extra_ldflags and libs_mplayer
Now, extra_ldflags ought to only consider LDFLAGS, and all libraries
shall go into libs_mplayer. In the end, the command line first contains
extra_ldflags, and then libs_mplayer.

So altogether this change has the effect that libraries get added to the
linker command line in the order the configure script checks them.
Previously there was some reordering due to some checks adding libraries
to libs_mplayer and some to extra_ldflags.
2012-12-19 13:01:56 +01:00
Stefano Pigozzi fab9febdc3 path: add mp_find_config_file and reorganize some of the code
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.
2012-12-15 17:38:00 +01:00
wm4 58f3b75485 windows support: fix compilation with pthreads
This caused errors like:

    core/mplayer.c:4308:5: error: implicit declaration of function 'pthread_win32_thread_detach_np' [-Werror=implicit-function-declaration]

It turns out a pthread.h include was missing. It's not clear why this
used to work (or rather, why it happens only sometimes). Possibly some
libraries or system headers recursively include pthread.h under certain
circumstances or configurations.

Fix missing quoting in configure, which led to broken terminal output.

Closes #6.
2012-12-11 00:37:54 +01:00
wm4 323eb54b60 configure: remove --disable-sortsub
Apparently this was for debugging. There was a patch to remove it years
ago, but it has been forgotten.
2012-12-11 00:37:54 +01:00
wm4 7146a57cfe demux_gif: remove this demuxer in favor of libavformat
The gif support in libavformat/libavcodec as of ffmpeg commit 5603b2
can handle animated gif. The internal demuxer is not needed anymore.
2012-12-03 21:08:51 +01:00
wm4 dd3260185a demux_lavf: add support for libavdevice
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.
2012-12-03 21:08:51 +01:00
wm4 9ace4f1f49 configure: don't check for inttypes.h, it always exists
The presence of inttypes.h is guaranteed by POSIX. We don't need to
check for it. We don't need to provide a compatibility header either.

Apparently libc5 systems didn't provide inttypes.h. libc5 is ancient,
unmaintained, and not used by modern Linux systems.
2012-12-03 21:08:51 +01:00
wm4 08a7cdbfdd configure: remove unused libpng detection 2012-12-03 21:08:51 +01:00
wm4 6a025b97af configure: use pkg-config for detecting OpenAL
Pick 1.13 as minimal required version. (Arbitrary, but reasonable.)
2012-11-23 15:37:37 +01:00
wm4 62e78fab79 configure: make --enable-debug default
This may result in larger binaries by default, and should be harmless
otherwise. Users are advised to use "make install-strip" if they want
binaries without debug symbols.
2012-11-20 18:00:16 +01:00
wm4 fe97ab6059 configure: add --disable-optimization, change --enable-debug semantics
--disable-optimization removes -O2 from CFLAGS.

Now --enable-debug only adds -g to CFLAGS, and doesn't disable
optimization anymore.

As an obscure feature, --enable-optimization=<n> adds -O<n> to CFLAGS.

Also remove stray $def_debug from configure.
2012-11-20 18:00:16 +01:00
wm4 52fe0a4fe2 configure: remove --enable-profile
The --enable-profile switch simply adds -p to the CFLAGS, which enables
gcc's extremely worthless "prof" profiling support. This kind of
profiling is broken on the conceptual level and thus harmful, and even
if you want it, you can enable it manually with --extra-cflags.

Also remove $_march $_mcpu from the CFLAGS code. These variables were
always unset, as the code setting them has been removed earlier.
2012-11-16 21:21:14 +01:00
wm4 b60483a144 Makefile: don't strip by default, add install-strip targets
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.
2012-11-14 13:06:00 +01:00
wm4 9fc682d46f Improve compatibility with Libav 0.8.4 and ffmpeg 0.11.2
Libav 0.8.4 is ridiculously old (in relative terms), so I don't know
how many things are broken silently.

Encoding is disabled, because the required API hasn't been added yet.
(On the other hand, the old API can't be used in newer versions.)

This should improve compatibility with ffmpeg 0.11.2 as well, which
didn't define AV_CODEC_ID_SUBRIP yet.
2012-11-14 11:45:52 +01:00
wm4 94fc9f7558 build: build manpage by default if rst2man is detected
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.
2012-11-14 11:26:43 +01:00
wm4 97efafee8a build: remove doc/locale language auto-detection, simplify
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.
2012-11-14 11:26:43 +01:00
Stefano Pigozzi bec630c347 clang: fix all warnings except deprecations 2012-11-13 22:19:18 +01:00
wm4 4873b32c59 Rename directories, move files (step 2 of 2)
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.)
2012-11-12 20:08:18 +01:00
Kovensky fae7307931 Port several python scripts to Perl
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.
2012-11-08 00:28:59 +01:00
Stefano Pigozzi e0aef8cf12 configure: detect rst2man binary name 2012-11-02 14:37:02 +01:00
wm4 0c95e139a9 configure: bump required ffmpeg library versions
libavutil: for av_get_packed_sample_fmt()
libavcodec: for avcodec_encode_video2()

It's actually untested whether these are really the minimum required
versions. I didn't want to bump them further yet.
2012-10-30 19:50:24 +01:00
Stefano Pigozzi f5de0aac96 cocoa_common: use IOKit to perform power management
This allows to remove the call to the deprecated `UpdateSystemActivity`. The
additional benefit is power management is disabled only if the video is really
playing. A paused video will not stop the system from idling.
2012-10-16 07:19:32 +02:00
wm4 65fc530f0c Rename to "mpv"
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.)
2012-10-12 10:14:32 +02:00
wm4 abc0ab8f61 build: fix ao_dsound config checks
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.
2012-10-05 15:26:31 +02:00
wm4 e5afc1f405 Remove useless video filters
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
2012-10-03 01:28:40 +02:00
Kovensky 077b41971b windows support: set -mwin32 when building on Cygwin
This makes cygwin define _WIN32 / WIN32, which it doesn't otherwise
define.
2012-09-30 15:16:59 +02:00
Kovensky 5fca3a6ea5 windows support: define WINVER to 0x0500
This means that we require Windows 2000 or later.
2012-09-30 15:16:48 +02:00
wm4 6fb0e6bf1c build: use "python" instead of "python3" as interpreter name
This works regardless whether "python" starts a Python 2 or Python 3
interpreter.
2012-09-29 16:22:01 +02:00
wm4 c57883b71b configure: make --enable-openal use auto detection
OpenAL is disabled by default, because it supposedly inteferes with
some other configure tests and makes them fail silently.

Previously, --enable-openal followed configure's utterly braindead
semantics and disabled auto detection. However, since OpenAL was
disabled by default, there was no easy way to enable OpenAL at all,
even if it was explicitly requested. Solve this by making
--enable-openal use auto detection.
2012-09-23 14:56:49 +02:00
Rudolf Polzer f5b8b6ac12 encode: video encoding now supported using mencoder-like options 2012-09-18 21:08:20 +02:00
wm4 130beda407 configure: add version check for libquvi
I do not know what exactly is the minimum working version. Require the
latest version currently released, which is about half a year old.
2012-09-18 21:07:29 +02:00
Uoti Urpala 435d7c97c9 cleanup: remove pointless #defines
Remove the following #defines, which should never change in practice:

CONFIG_FAKE_MONO, OUTBURST, FAST_OSD, FAST_OSD_TABLE
The configure script hardcoded these to particular values in config.h.
They could only be changed by manually editing it. I don't think
anyone would want to.

X11_FULLSCREEN
This once did something, but became meaningless years ago and was now
always set to true if the files using it were compiled at all.

Conflicts:
	configure
	libvo/osd.c
	libvo/vo_gl.c

Merged from mplayer2. The OSD defines were already removed in this fork.
2012-09-18 21:04:46 +02:00