Commit Graph

3035 Commits

Author SHA1 Message Date
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