summaryrefslogtreecommitdiffstats
path: root/Makefile
Commit message (Collapse)AuthorAgeFilesLines
* switch the build system to wafStefano Pigozzi2013-11-211-564/+0
| | | | | | | | | | | | | | | | | | | | | | | This commit adds a new build system based on waf. configure and Makefile are deprecated effective immediately and someday in the future they will be removed (they are still available by running ./old-configure). You can find how the choice for waf came to be in `DOCS/waf-buildsystem.rst`. TL;DR: we couldn't get the same level of abstraction and customization with other build systems we tried (CMake and autotools). For guidance on how to build the software now, take a look at README.md and the cross compilation guide. CREDITS: This is a squash of ~250 commits. Some of them are not by me, so here is the deserved attribution: - @wm4 contributed some Windows fixes, renamed configure to old-configure and contributed to the bootstrap script. Also, GNU/Linux testing. - @lachs0r contributed some Windows fixes and the bootstrap script. - @Nikoli contributed a lot of testing and discovered many bugs. - @CrimsonVoid contributed changes to the bootstrap script.
* timeline: remove support for the mplayer2 EDL formatwm42013-11-191-1/+0
| | | | | It was a bit too complicated and inconvenient, and I doubt anyone actively used it. The mpv EDL format should cover all use cases.
* timeline: add edl:// URIswm42013-11-191-0/+1
| | | | | Questionable change from user perspective, but internally needed to implement the next commit. Also useful for testing timeline stuff.
* timeline: add new EDL formatwm42013-11-191-0/+1
| | | | | | | | | | Edit Decision Lists (EDL) allow combining parts from multiple source files into one virtual file. MPlayer had an EDL format (which sucked), which mplayer2 tried to improve with its own format (which sucked). As logic demands, mpv introduces its very own format (which sucks). The new format should actually be much simpler and easier to use, and its implementation is simpler and smaller too.
* audio/filter: rename af_tools.c to tools.cwm42013-11-181-1/+1
| | | | This always bothered me.
* stream: split out pthread helper functionwm42013-11-171-0/+1
| | | | Also split the function itself into 3.
* Merge branch 'planar_audio'wm42013-11-121-0/+1
|\ | | | | | | | | Conflicts: audio/out/ao_lavc.c
| * audio: add mp_audio_bufferwm42013-11-121-0/+1
| | | | | | | | | | | | Implementation wise, this could be much improved, such as using a ringbuffer that doesn't require copying data all the time. This is why we don't use mp_audio directly instead of mp_audio_buffer.
* | demux: kill libmng supportwm42013-11-111-1/+0
|/ | | | It's a dead format that was never used anywhere.
* vo_opengl: support for vdpau hardware decodingwm42013-11-051-0/+1
| | | | | | | | | | | | This uses vdpau OpenGL interop to convert a vdpau surface to a texture. Note that this is a bit weak and primitive. Deinterlacing (or any other form of vdpau postprocessing) is not supported. vo_opengl chroma scaling and chroma sample position are not supported. Internally, the vdpau video surfaces are converted to a RGBA surface first, because using the video surfaces directly is too complicated. (These surfaces are always split into separate fields, and the vo_opengl core expects progressive frames or frames with weaved fields.)
* vo_opengl: add support for VA-API OpenGL interopwm42013-11-041-0/+1
| | | | | | | | VA-API's OpenGL/GLX interop is pretty bad and perhaps slow (renders a X11 pixmap into a FBO, and has to go over X11, probably involves one or more copies), and this code serves more as an example, rather than for serious use. On the other hand, this might be work much better than vo_vaapi, even if slightly slower.
* Split mplayer.cwm42013-10-301-1/+9
| | | | | | | | | | | | | | | | | | | | mplayer.c was a bit too big. Split it into multiple files. I hope the way it's split makes sense. Maybe some things don't make too much sense, or go against intuition. These will fixed as soon as I notice them. Some files are a bit questionable (misc.c, osd.c, configfiles.c), and suggestions how to organize this better are welcome. Regressions are possible due to reorganized include statements. Obviously I didn't just copy mplayer.c's orgy of include statements, but recreated them for each file. It's easily possible that there are oversights and mistakes, which will show up on other platforms. There is one actual change: the public avutil.h include is removed from encode.h, and I tried to replace most FFMIN/FFMAX/av_clip uses. I consider using libavutil too much as dangerous, because the set of include files they recursively pull in is rather arbitrary and is different between FFmpeg and Libav.
* Move files part of the playback core to player sub-directorywm42013-10-301-16/+16
| | | | | | | | All these files access mp_core.h and MPContext, and form the actual player application. They should be all in one place, and separate from the other sources that are mere utility helpers. Preparation for splitting mplayer.c into multiple smaller parts.
* audio/filter: rename af_force.c to af_format.cwm42013-10-231-1/+1
| | | | The filter itself was already renamed earlier - but rename the file too.
* audio/filter: split af_format into separate filters, rename af_forcewm42013-10-231-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | af_format is the old audio conversion filter. It could do all possible conversions supported by the audio chain. However, ever since the addition of af_lavrresample, most conversions are done by libav/swresample, and af_format is used as fallback. Separate out the fallback cases and remove af_format. af_convert24 does 24 bit <-> 32 bit conversions, while af_convertsignendian does sign and endian conversions. Maybe the way the conversions are split sounds a bit odd. But the former changes the size of the audio data, while the latter is fully in-place, so there's at least different buffer management. This requires a quite complicated algorithm to make sure all these "partial" conversion filters can actually get from one format to another. E.g. s24le->s32be always requires convertsignendian and convert24, but af.c has no idea what the intermediate format should be. So I added a graph search (trying every possible format and filter) to determine required format and filter. When I wrote this, it seemed this was still better than messing everything into af_lavrresample, but maybe this is overkill and I'll change my opinion. For now, it seems nice to get rid of af_format though. The AC3->IEC61937 conversion isn't supported anymore, but I don't think this is needed anywhere. Most AOs test all formats explicitly, or use the AF_FORMAT_IS_IEC61937() macro (which includes AC3). One positive consequence of this change is that conversions always include dithering (done by libav/swresample), instead of possibly going through af_format, which doesn't do anything fancy. Rename af_force to af_format. It's essentially compatible with command line uses of af_format. We retain a compatibility alias for af_force.
* Replace tallocwm42013-10-131-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are multiple reasons to do this. One big reason is the license: talloc is LGPLv3+, which forces mpv to be licensed as GPLv3+. Another one is that our talloc copy contains modifications, which makes it essentially incompatible with upstream talloc (in particular, our version aborts on out of memory conditions - well, it wasn't my idea). Updating from upstream is also a bit involved - the talloc source is not really organized in a way to allow copying it into projects (and this isn't an intended use-case). Finally, talloc is kind of big and bloated. The replacement halves the amount of code - mainly because we didn't use all talloc features. It's even more extreme if you compare upstream talloc (~4700 lines) and the new allocator without talloc compat (~900 lines). The replacement provides all features we need. It also doesn't clash with talloc. (The talloc compatibility wrapper uses macros to avoid introducing linker-level symbols which could clash with libtalloc.) It also tries to lower the overhead (only 4 words opposed to 10 words in talloc for leaf nodes in release mode). Debugging features like leak reporting can be enabled at compile time and add somewhat more overhead. Though I'm not sure whether the overhead reduction was actually successful: allocations with children need an "extra" header, which adds plenty of overhead, and it turns out that almost half of all allocations have children. Maybe the implementation could be simplified and the extra header removed - even then, overhead would be lower than talloc's. Currently, debugging features can be entirely deactivated by defining NDEBUG - I'm not sure if anything defines this directly yet, though. Unlike in talloc, the leak reporting stuff is thread-safe. (That's also why it's far less elegant, and requires extra list pointers.) Comes with a compatibility layer, so no changes to mpv source code are needed. The idea is that we will pretend to be using talloc for a while, so that we can revert to our old talloc implementation at any time for debugging purposes. Some inspiration was taken from Mesa's ralloc: http://cgit.freedesktop.org/mesa/mesa/tree/src/glsl/ralloc.h This is another talloc replacement, but lacks some features we need (getting size of an allocation, debugging features, being able to access children in the dtor). There's some information in ta/README what will happen next and how the transition is expected to progress.
* audio/out: add sndio supportChristian Neukirchen2013-10-031-0/+2
| | | | Based on an earlier patch for mplayer by Alexandre Ratchov <alex@caoua.org>
* cocoa_common: split the code, refactoring and cleanupsStefano Pigozzi2013-09-281-3/+7
| | | | | | | | | Split the code to several files. The GUI elements now each have they own files and private state. The original code was a mess to respect the retarded mplayer convention of having everything in a single file. This commit also seems to fix the long running bug of artifacts showing randomly when going fullscreen using nVidia GPUs.
* Add the on-screen-controllerChrisK22013-09-261-0/+5
| | | | Signed-off-by: wm4 <wm4@nowhere>
* Add initial Lua scripting supportwm42013-09-261-0/+12
| | | | | | | | | | | | | | | | | | | | | | This is preliminary. There are still tons of issues, and any aspect of scripting may change in the future. I decided to merge this (preliminary) work now because it makes it easier to develop it, not because it's done. lua.rst is clear enough about it (plus some sarcasm). This requires linking to Lua. Lua has no official pkg-config file, but there are distribution specific .pc files, all with different names. Adding a non-pkg-config based configure test was considered, but we'd rather not. One major complication is that libquvi links against Lua too, and if the Lua version is different from mpv's, you will get a crash as soon as libquvi uses Lua. (libquvi by design always runs when a file is opened.) I would consider this the problem of distros and whoever builds mpv, but to make things easier for users, we add a terrible runtime test to the configure script, which probes whether libquvi will crash. This is disabled when cross-compiling, but in that case we hope the user knows what he is doing.
* vaapi: add vf_vavpp and use it for deinterlacingxylosper2013-09-251-1/+3
| | | | | | | | Merged from pull request #246 by xylosper. Minor cosmetic changes, some adjustments (compatibility with older libva versions), and manpage additions by wm4. Signed-off-by: wm4 <wm4@nowhere>
* install: don’t force append /mpv to docdirMartin Herkt2013-09-231-3/+3
|
* macosx: move bundle path stuff to path-macosx.mStefano Pigozzi2013-09-181-1/+1
| | | | This makes the code uniform to how stuff was handled for Windows in 1cb55ceb.
* path, win32: redo user configfile path handlingwm42013-09-181-0/+1
| | | | | | | | | | | | | | | | | Remove the ifdef hell from mp_find_user_config_file(). Move the win32 specific code (for MinGW and Cygwin) to path-win.c. The behavior should be about the same, but I can't be sure due to lack of testing and because the old path.c code was hard to follow. (I expect those who care about windows will fix things, should issues pop up - sorry.) One difference is that the new code will always force MPV_HOME. It looks like the old code preferred the mpv config dir in the exe dir if it exists. Also, make sure MP_PATH_MAX has enough space, even if the equivalent wchar_t string is not 0-terminated with PATH_MAX (because apparently the winapi doesn't require this). (Actually, maybe we should just kill all uses of PATH_MAX/MP_PATH_MAX.)
* Add mpv.desktop, let Makefile install the desktop file and the iconswm42013-09-151-4/+24
| | | | | | | | | | | | | | | | | | | The mpv.desktop file is taken from the Arch package [1]. It appears to be based on the mplayer2 git mplayer.desktop file (e.g. very similar MimeType field), with minor modifications applied by Arch package maintainers. Note that for now, this doesn't show a terminal (Terminal=false), which might not always be ideal. For example, if the file is audio only, or if VO initialization fails for some reason, mpv will run in the background and play audio without showing a window. But users prefer running it without terminal, and don't want to play audio files with it. Maybe a --force-window option will be added in the future, which would always create a VO window, and compensate for these issues. [1] https://aur.archlinux.org/packages/mpv-git/
* macosx: always active bundle path lookup if cocoa is activeStefano Pigozzi2013-09-121-1/+1
| | | | | This is not really something you want to disable anyway. If there is no bundle the code already does it's falbacks anyway.
* Makefile: update DIRS to fix cleaningStefano Pigozzi2013-09-111-1/+2
| | | | Commits 40624100 and 72f2942df didn't update the variable accordingly.
* Makefile: restore manpage dependency ruleswm42013-09-101-0/+9
| | | | | | Broken by commit 0054073. Also add them to the pdf target.
* Add PDF manual targetMartin Herkt2013-09-091-13/+23
| | | | | | This builds a PDF version of the manpage using rst2latex and pdflatex, and installs it to PREFIX/share/doc/mpv by default.
* x11: add window iconwm42013-09-011-0/+5
| | | | | | | | | | | | | | | | | | | | | The png file added to etc/ are taken from the link mentioned in commit 303096b, except that they have been converted to 16 bit, sRGB (with color profile info dropped, if there was one), and transparent pixels reset for better compression. The file x11_icon.bin is generated by gen-x11-icon.sh. I'm adding it to the git repo directly, because the script requires ImageMagick, and we don't want to make building even more complicated. The way how this is done is basically a compromise between effort required in x11_common.c and in gen-x11-icon.sh. Ideally, x11_icon.bin would be directly in the format as required by _NET_WM_ICON, but trying to write the binary width/height values from shell would probably be a nightmare, so here we go. The zlib code in x11_common.c is lifted from demux_mkv.c, with some modifications (like accepting a gzip header, because I don't know how to make gzip write raw compressed data).
* stream: add uncompressed rar supportwm42013-08-261-0/+2
| | | | | | | | | | | | | | | | | Apparently, it is popular to store large files in uncompressed rar archives. Extracting files is not practical, and some media players suport playing directly from uncompressed rar (at least VLC and some DirectShow components). Storing or accessing files this way is completely idiotic, but it is a common practice, and the ones subjected to this practice can't do much to change this (at least that's what I assume/hope). Also, it's a feature request, so we say yes. This code is mostly taken from VLC (commit f6e7240 from their git tree). We also copy the way this is done: opening a rar file by itself yields a playlist, which contains URLs to the actual entries in the rar file. Compressed entries are simply skipped.
* core: add a playlist demuxerwm42013-08-261-1/+2
| | | | | | | | | Modeled after the old playlist_parser.c, but actually new code, and it works a bit differently. Demuxers (and sometimes streams) are the component that should be used to open files and to determine the file format. This was already done for subtitles, but playlists still use a separate code path.
* wayland: shm based software renderingAlexander Preisinger2013-08-251-0/+1
| | | | | | | | | | | | | | | | | | | | A wayland output based on shared memory. This video output is useful for x11 free systems, because the current libGL in mesa provides GLX symbols. It is also useful for embedded systems where the wayland backend for EGL is not implemented like the raspberry pi. At the moment only rgb formats are supported, because there is still no compositor which supports planar formats like yuv420p. The most used compositor at the moment, weston, supports only BGR0, BGRA and BGR16 (565). The BGR16 format is the fastest to convert and render without any noticeable differences to the BGR32 formats. For this reason the current (very basic) auto-detection code will prefer the BGR16 format. Also the weston source code indicates that the preferred format is BGR16 (RGB565). There are 2 options: * default-format (yes|no) Which uses the BGR32 format * alpha (yes|no) For outputting images and videos with transparencies
* video: add vda decode support (with hwaccel) and direct renderingStefano Pigozzi2013-08-221-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Decoding H264 using Video Decode Acceleration used the custom 'vda_h264_dec' decoder in FFmpeg. The Good: This new implementation has some advantages over the previous one: - It works with Libav: vda_h264_dec never got into Libav since they prefer client applications to use the hwaccel API. - It is way more efficient: in my tests this implementation yields a reduction of CPU usage of roughly ~50% compared to using `vda_h264_dec` and ~65-75% compared to h264 software decoding. This is mainly because `vo_corevideo` was adapted to perform direct rendering of the `CVPixelBufferRefs` created by the Video Decode Acceleration API Framework. The Bad: - `vo_corevideo` is required to use VDA decoding acceleration. - only works with versions of ffmpeg/libav new enough (needs reference refcounting). That is FFmpeg 2.0+ and Libav's git master currently. The Ugly: VDA was hardcoded to use UYVY (2vuy) for the uploaded video texture. One one end this makes the code simple since Apple's OpenGL implementation actually supports this out of the box. It would be nice to support other output image formats and choose the best format depending on the input, or at least making it configurable. My tests indicate that CPU usage actually increases with a 420p IMGFMT output which is not what I would have expected. NOTE: There is a small memory leak with old versions of FFmpeg and with Libav since the CVPixelBufferRef is not automatically released when the AVFrame is deallocated. This can cause leaks inside libavcodec for decoded frames that are discarded before mpv wraps them inside a refcounted mp_image (this only happens on seeks). For frames that enter mpv's refcounting facilities, this is not a problem since we rewrap the CVPixelBufferRef in our mp_image that properly forwards CVPixelBufferRetain/CvPixelBufferRelease calls to the underying CVPixelBufferRef. So, for FFmpeg use something more recent than `b3d63995` for Libav the patch was posted to the dev ML in July and in review since, apparently, the proposed fix is rather hacky.
* video: add vaapi decode and output supportwm42013-08-121-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is based on the MPlayer VA API patches. To be exact it's based on a very stripped down version of commit f1ad459a263f8537f6c from git://gitorious.org/vaapi/mplayer.git. This doesn't contain useless things like benchmarking hacks and the demo code for GLX interop. Also, unlike in the original patch, decoding and video output are split into separate source files (the separation between decoding and display also makes pixel format hacks unnecessary). On the other hand, some features not present in the original patch were added, like screenshot support. VA API is rather bad for actual video output. Dealing with older libva versions or the completely broken vdpau backend doesn't help. OSD is low quality and should be rather slow. In some cases, only either OSD or subtitles can be shown at the same time (because OSD is drawn first, OSD is prefered). Also, libva can't decide whether it accepts straight or premultiplied alpha for OSD sub-pictures: the vdpau backend seems to assume premultiplied, while a native vaapi driver uses straight. So I picked straight alpha. It doesn't matter much, because the blending code for straight alpha I added to img_convert.c is probably buggy, and ASS subtitles might be blended incorrectly. Really good video output with VA API would probably use OpenGL and the GL interop features, but at this point you might just use vo_opengl. (Patches for making HW decoding with vo_opengl have a chance of being accepted.) Despite these issues, decoding seems to work ok. I still got tearing on the Intel system I tested (Intel(R) Core(TM) i3-2350M). It was also tested with the vdpau vaapi wrapper on a nvidia system; however this was rather broken. (Fortunately, there is no reason to use mpv's VAAPI support over native VDPAU.)
* core: move contents to mpvcore (2/2)Stefano Pigozzi2013-08-061-39/+39
| | | | Followup commit. Fixes all the files references.
* Remove m_structwm42013-08-021-1/+0
| | | | Not needed anymore.
* vo_corevideo: move to C from Objective-CStefano Pigozzi2013-08-011-1/+1
| | | | | This file was alredy written in C. The only remaining part was the file exension and `#import`s.
* mpv.rc: update Windows iconJames Ross-Gowan2013-07-301-1/+1
| | | | Based on the OSX bundle icon.
* build: fix build with vdpau, simplifywm42013-07-291-4/+0
| | | | | | | | | | | | Instead of generating vdpau_template.c with a Perl script, just include the generated file in git. This is ok because it changes very rarely, and the script is larger than the output it generates. It also simplify the Makefile, and fixes the build. The problem was that transitive dependencies do not work with generated files: there is no dependency information yet when building it the first time. I overlooked this because I didn't delete the .d files for testing (which contained the correct dependencies, but only _after_ a first successful build).
* build: fix vdpau_template.c generationwm42013-07-291-1/+1
|
* vdpau: split off decoder parts, use "new" libavcodec vdpau hwaccel APIwm42013-07-281-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Move the decoder parts from vo_vdpau.c to a new file vdpau_old.c. This file is named so because because it's written against the "old" libavcodec vdpau pseudo-decoder (e.g. "h264_vdpau"). Add support for the "new" libavcodec vdpau support. This was recently added and replaces the "old" vdpau parts. (In fact, Libav is about to deprecate and remove the "old" API without deprecation grace period, so we have to support it now. Moreover, there will probably be no Libav release which supports both, so the transition is even less smooth than we could hope, and we have to support both the old and new API.) Whether the old or new API is used is checked by a configure test: if the new API is found, it is used, otherwise the old API is assumed. Some details might be handled differently. Especially display preemption is a bit problematic with the "new" libavcodec vdpau support: it wants to keep a pointer to a specific vdpau API function (which can be driver specific, because preemption might switch drivers). Also, surface IDs are now directly stored in AVFrames (and mp_images), so they can't be forced to VDP_INVALID_HANDLE on preemption. (This changes even with older libavcodec versions, because mp_image always uses the newer representation to make vo_vdpau.c simpler.) Decoder initialization in the new code tries to deal with codec profiles, while the old code always uses the highest profile per codec. Surface allocation changes. Since the decoder won't call config() in vo_vdpau.c on video size change anymore, we allow allocating surfaces of arbitrary size instead of locking it to what the VO was configured. The non-hwdec code also has slightly different allocation behavior now. Enabling the old vdpau special decoders via e.g. --vd=lavc:h264_vdpau doesn't work anymore (a warning suggesting the --hwdec option is printed instead).
* Remove subopt-helperwm42013-07-221-1/+0
| | | | Finally not used by anything anymore. Farewell.
* ao_coreaudio: split ao_coreaudio_common in two filesStefano Pigozzi2013-07-221-1/+3
| | | | | | | | | * ao_coreaudio_utils: contains several utility function * ao_coreaudio_properties: contains functions to set and get audio object properties. Conflicts: audio/out/ao_coreaudio.c
* audio/decod