summaryrefslogtreecommitdiffstats
path: root/libmpcodecs
Commit message (Collapse)AuthorAgeFilesLines
* Change <endian.h> include to <sys/types.h>wm42012-07-315-5/+5
| | | | | This seems to be more portable. Should fix compilation on OSX and FreeBSD. Apparently also works on MinGW-w64.
* configure: remove checks for malloc.h and alloca()wm42012-07-308-30/+0
| | | | | | | | Including <malloc.h>, especially if all you want is malloc(), has no legitimate uses (on sane platforms at least). Remove the check for it, and remove all uses in the code. Remove unused check for alloca().
* Remove some demuxers and decoderswm42012-07-3012-2601/+0
| | | | | | | | | | | | | | | | | | Most of these demuxers and decoders are provided in better form by libav, while the mplayer builtin ones are essentially unmaintained. The only legimitate use case for not using the libav ones was working around libav bugs or bugs related to the way mplayer uses libav. Instead of trying to keep dead code alive, development effort should go into improving libav or the mplayer libav glue code. Note that the libav demuxer have been preferred over the mplayer builtin ones for a while in mplayer2. There were some exceptions: playing DVDs with dvdnav or playing network sources. (That's because some stream modules and network.c requested explicit file formats, such as DEMUXER_TYPE_MPEG_PS, which mapped to builtin demuxers.) With this commit, they are switched to use libav. One caveat is that the requested format is not passed to libavformat, instead we rely on the auto probing to select the correct libav demuxer (see code in demux_open_stream()).
* mplayer: remove benchmarking/CPU accounting codewm42012-07-301-18/+1
| | | | | | | | | | The code used for benchmarking and showing CPU stats in the status line was inaccurate, misleading and fragile. The final nail in the coffin is the fact that many libav decoders are multithreaded now, and mplayer couldn't possibly measure the CPU time consumed by them. Add the --untimed option. This makes the video untimed, just like --benchmark did (still requires disabling audio synchronization).
* libmpcodecs: silence lines reading "AUDIO:" and "VIDEO:"wm42012-07-302-2/+2
| | | | | Both of these are not very interesting, and redundant with the corresponding VO/AO initialization messages.
* vd: silence output about aspect ratiowm42012-07-301-1/+1
| | | | Uninteresting.
* vf_scale: don't pass CPU flags anymorewm42012-07-305-18/+6
| | | | | | libav detects them automatically. Also fix a bunch of other VFs, which use the get_sws_cpuflags() function defined by vf_scale.c.
* Rip out 3DNOW supportwm42012-07-308-78/+4
| | | | | | | | Ancient AMD specific enhancement to the MMX instruction set. Officually discontinued by AMD. Note that support for this was already disabled in the previous commit. This commit removes the actual code.
* Remove compile time/runtime CPU detection, and drop some platformswm42012-07-306-11/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | mplayer had three ways of enabling CPU specific assembler routines: a) Enable them at compile time; crash if the CPU can't handle it. b) Enable them at compile time, but let the configure script detect your CPU. Your binary will only crash if you try to run it on a different system that has less features than yours. This was the default, I think. c) Runtime detection. The implementation of b) and c) suck. a) is not really feasible (it sucks for users). Remove all code related to this, and use libav's CPU detection instead. Now the configure script will always enable CPU specific features, and disable them at runtime if libav reports them not as available. One implication is that now the compiler is always expected to handle SSE (etc.) inline assembly at runtime, unless it's explicitly disabled. Only checks for x86 CPU specific features are kept, the rest is either unused or barely used. Get rid of all the dump -mpcu, -march etc. flags. Trust the compiler to select decent settings. Get rid of support for the following operating systems: - BSD/OS (some ancient BSD fork) - QNX (don't care) - BeOS (dead, Haiku support is still welcome) - AIX (don't care) - HP-UX (don't care) - OS/2 (dead, actual support has been removed a while ago) Remove the configure code for detecting the endianness. Instead, use the standard header <endian.h>, which can be used if _GNU_SOURCE or _BSD_SOURCE is defined. (Maybe these changes should have been in a separate commit.) Since this is a quite violent code removal orgy, and I'm testing only on x86 32 bit Linux, expect regressions.
* ad_faad: include neaacdec.h instead of faad.hwm42012-07-281-1/+1
| | | | | The faad.h header printed a warning that this header is outdated. The header neaacdec.h is probably the proper header, so use that.
* bstr: rename bstr() function to bstr0(), and typedef bstr to struct bstrwm42012-07-281-1/+1
| | | | | Replace all uses of bstr() with bstr0(). Also remove the ridiculous C++ workaround.
* osd: use libass for OSD renderingwm42012-07-282-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The OSD will now be rendered with libass. The old rendering code, which used freetype/fontconfig and did text layout manually, is disabled. To re-enable the old code, use the --disable-libass-osd configure switch. Some switches do nothing with the new code enabled, such as -subalign, -sub-bg-alpha, -sub-bg-color, and many more. (The reason is mostly that the code for rendering unstyled subtitles with libass doesn't make any attempts to support them. Some of them could be supported in theory.) Teletext rendering is not implemented in the new OSD rendering code. I don't have any teletext sources for testing, and since teletext is being phased out world-wide, the need for this is questionable. Note that rendering is extremely inefficient, mostly because the libass output is blended with the extremely strange mplayer OSD format. This could be improved at a later point. Remove most OSD rendering from vo_aa.c, because that was extremely hacky, can't be made work with osd_libass, and didn't work anyway in my tests. Internally, some cleanup is done. Subtitle and OSD related variable declarations were literally all over the place. Move them to sub.h and sub.c, which were hoarding most of these declarations already. Make the player core in mplayer.c free of concerns like bitmap font loading. The old OSD rendering code has been moved to osd_ft.c. The font_load.c and font_load_ft.c are only needed and compiled if the old OSD rendering code is configured.
* Merge remote-tracking branch 'origin/master'wm42012-07-287-66/+122
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: .gitignore bstr.c cfg-mplayer.h defaultopts.c libvo/video_out.c The conflict in bstr.c is due to uau adding a bstr_getline function in commit 2ba8b91a97e7e8. This function already existed in this branch. While uau's function is obviously derived from mine, it's incompatible. His function preserves line breaks, while mine strips them. Add a bstr_strip_linebreaks function, fix all other uses of bstr_getline, and pick uau's implementation. In .gitignore, change vo_gl3_shaders.h to use an absolute path additional to resolving the merge conflict.
| * vd_vfw.c: fix part missing from previous commitUoti Urpala2012-07-261-2/+3
| | | | | | | | | | | | vd_vfw.c was missing a change to rename field used from 'flags' to 'keyframe'. This broke compilation with 32-bit Windows codec support enabled.
| * demux, vd_ffmpeg: fix demux keyframe flag, set AV_PKT_FLAG_KEYUoti Urpala2012-07-251-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There was some confusion about the "flags" field in demuxer packets. Demuxers set it to either 1 or 0x10 to indicate a keyframe (and the field was not used to indicate anything else). This didn't cause visible problems because nothing read the value. Replace the "flags" field with a boolean "keyframe" field. Set AV_PKT_FLAG_KEY based on this field in packets fed to libavcodec video decoders (looks like PNG and ZeroCodec are the only ones which depend on values from demuxer; previously this was hardcoded to true for PNG). Make demux_mf set the keyframe field in every packet. This matters for PNG files now that the demuxer flag is forwarded to libavcodec. Fix logic setting the field in demux_mkv. It had probably not been updated when adding SimpleBlock support. This probably makes no difference for any current practical use.
| * video, audio: use lavc decoders without codecs.conf entriesUoti Urpala2012-07-246-62/+115
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add support for using libavcodec decoders that do not have entries in codecs.conf. This is currently only used with demux_lavf, and the codec selection is based on codec_id returned by libavformat. Also modify codec-related terminal output somewhat to make it use information from libavcodec and avoid excessively long default output. The new any-lavc-codec support is implemented with codecs.conf entries that invoke vd_ffmpeg/ad_ffmpeg without directly specifying any libavcodec codec name. In this mode, the decoders now instead select the libavcodec codec based on codec_id previously set by demux_lavf (if any). These new "generic" codecs.conf entries specify "status buggy", so that they're tried after any specific entries with higher-priority status. Add new directive "anyinput" to codecs.conf syntax. This means the entry will always match regardless of fourcc. This is used for the above new codecs.conf entries (so the driver always gets to decide whether to accept the input, and will fail init() if it can't find a suitable codec in libavcodec). Remove parsing support for the obsolete codecs.conf directive "cpuflags". This directive has not had any effect and has not been used in default codecs.conf since many years ago. Shorten codec-related terminal output. When using libavcodec decoders, show the libavcodec long_name field rather than codecs.conf "info" field as the name of the codec. Stop showing the codecs.conf entry name and "vfm/afm" name by default, as these are rarely needed; they're now in verbose output only. Show "VIDEO:" line at VO initialization rather than at demuxer open. This didn't really belong in demuxer code; the new location may show more accurate values (known after decoder has been opened) and works right if video track is changed after initial demuxer open. The vd.c changes (primarily done for terminal output changes) remove round-to-even behavior from code setting dimensions based on aspect ratio. I hope nothing depended on this; at least the even values were not consistently guaranteed anyway, as the rounding code did not run if the video file did not specify a nonzero aspect value.
* | Merge remote-tracking branch 'origin/master'wm42012-05-201-167/+81
|\|
| * ad_mpg123: update libmpg123 API useThomas Orgis2012-05-071-167/+81
| | | | | | | | | | | | Improve ad_mpg123, including use of the more efficient framewise decoding with mpg123 version 1.14 or later (older versions are still supported).
* | Merge remote-tracking branch 'origin/master'wm42012-04-291-69/+112
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: bstr.c bstr.h libvo/cocoa_common.m libvo/gl_common.c libvo/video_out.c mplayer.c screenshot.c sub/subassconvert.c Merge of cocoa_common.m done by pigoz. Picking my version of screenshot.c. The fix in commit aadf1002f8a will be redone in a follow-up commit, as the original commit causes too many conflicts with the work done locally in this branch, and other work in progress.
| * ad_ffmpeg: switch to avcodec_decode_audio4()Uoti Urpala2012-04-191-69/+112
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Switch libavcodec audio decoding from avcodec_decode_audio3() to avcodec_decode_audio4(). Instead of decoding directly to the output buffer, the data is now copied from the libavcodec output packet, adding an extra memory copy (optimizing this would require some interface changes). After libavcodec added avcodec_decode_audio4() earlier, it dropped support for splitting large audio packets into output chunks of size AVCODEC_MAX_AUDIO_FRAME_SIZE or less. This caused a regression with the previous API: audio files with huge packets could fail to decode, as libavcodec refused to write into the AVCODEC_MAX_AUDIO_FRAME_SIZE buffer provided by mplayer2. This occurrend mainly with some lossless audio formats. This commit restores support for those files; there are now no fixed limits on packet size.
* | Merge remote-tracking branch 'origin/master'wm42012-04-015-110/+106
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: bstr.c bstr.h etc/input.conf input/input.c input/input.h libao2/ao_pulse.c libmpcodecs/vf_ass.c libmpcodecs/vf_vo.c libvo/gl_common.c libvo/x11_common.c mixer.c mixer.h mplayer.c
| * timeline: subs: keep subtitle tracks in source timeUoti Urpala2012-03-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Timeline handling converted the pts values from demuxed subtitles to timeline scale. Change the code to do most subtitle handling in original subtitle source pts, and instead convert current playback timeline pts to those units when deciding which subtitle to show. The main functionality changes are that now demuxed subtitles which overlap chapter boundaries are handled correctly (at least for libass subtitles), and external subtitles are assumed to use same pts scale as current source (this needs improvements later). Before, a video subtitle that had a duration continuing past the end of the chapter would continue to be shown for the original duration, even if the chapter ended and playback switched to a position in the source where the subtitle shouldn't exist. Now, the subtitle will correctly end. Before, external subtitle files were interpreted as specifying pts values in timeline scale. Now, they're interpreted as specifying pts values in source file time scale, for _every_ source file. This is probably more likely to be what the user wants for the "main" source file in case there is one, but almost certainly not quite right for multiple source files where the same subs could be shown over different scenes. If the user wants them to match some main source file, it's probably still better to have incorrect extra subs for video from some files than to have every subtitle appearing at the wrong time. The new code makes it easier to change the interpretation of the subtitle times, and some configurability should be added in the future.
| * cosmetics: vf_vo.c: reformatUoti Urpala2012-03-251-102/+107
| |
| * cosmetics: misc minor cleanupsUoti Urpala2012-03-253-11/+1
| | | | | | | | | | The deleted ZRM* things were only relevant to vo_zr, which was deleted earlier.
* | libmpcodecs: rename IMGFMT_GBR24P to IMGFMT_GBRPwm42012-03-254-8/+8
| | | | | | | | This is more in line with the ffmpeg/libav names.
* | vf_scale: prefer converting GBR24P to other 8 bit per component RGB formatsreimar2012-03-251-0/+4
| | | | | | | | | | | | | | | | Compared to converting to Y444 this should be faster and lossless. Based on patch by Hans-Kristian Arntzen [maister archlinux us] git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@34317 b3059339-0415-0410-9bf9-f77b7e298cf2
* | libmpcodecs: support planar GBR24 decodingcehoyos2012-03-254-1/+10
| | | | | | | | | | | | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@34245 b3059339-0415-0410-9bf9-f77b7e298cf2 Note: ffmpeg first introduced PIX_FMT_GBR24P, which was used in this commit. Later, it was renamed to PIX_FMT_GBRP in ffmpeg and libav. This was updated in revision 34492 in mplayer, but the mplayer specific names (such as IMGFMT_GBR24) were left unchanged.
* | Merge remote-tracking branch 'origin/master' into my_masterwm42012-03-165-7/+8
|\| | | | | | | | | | | | | | | Conflicts: command.c mp_core.h mplayer.c screenshot.c
| * windows support: unicode filenameswm42012-03-091-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Windows uses a legacy codepage for char* / runtime functions accepting char *. Using UTF-8 as the codepage with setlocale() is explicitly forbidden. Work this around by overriding the MSVCRT functions with wrapper macros, that assume UTF-8 and use "proper" API calls like _wopen etc. to deal with unicode filenames. All code that uses standard functions that take or return filenames must now include osdep/io.h. stat() can't be overridden, because MinGW-w64 itself defines "stat" as a macro. Change code to use use mp_stat() instead. This is not perfectly clean, but still somewhat sane, and much better than littering the rest of the mplayer code with MinGW specific hacks. It's also a bit fragile, but that's actually little different from the previous situation. Also, MinGW is unlikely to ever include a nice way of dealing with this.
| * cleanup: Silence compilation warnings on MinGW-w64wm42012-03-014-7/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some of the code, especially the dshow and windows codec loader parts, are extremely hacky and likely full of bugs. The goal is merely getting rid of warnings that could obscure more important warnings and actual bugs, instead of fixing actual problems. This reduces the number of warnings from over 500 to almost the same as when compiling on Linux. Note that many problems stem from using the ancient wine-derived windows headers. There are some differences to the "proper" windows header. Changing the code to compile with the proper headers would be too much trouble, and it still has to work on Unix. Some of the changes might actually break compilation on legacy MinGW, but we don't support that anymore. Always use MinGW-w64, even when compiling to 32 bit. Fixes some warnings in the win32 loader code on Linux too.
* | Merge remote-tracking branch 'origin/master' into my_masterwm42012-03-0513-58/+53
|\| | | | | | | | | | | Conflicts: mplayer.c screenshot.c
| * configure, build: support compiling without libpostprocUoti Urpala2012-02-271-0/+2
| | | | | | | | | | | | libpostproc has been removed from Libav and the library now exists as a separate project. Because it's not essential, separate it from the Libav library check and allow compiling without it.
| * vd_ffmpeg: fix flushing of buffered framesUoti Urpala2012-02-031-3/+0
| | | | | | | | | | | | | | | | | | The vd_ffmpeg decode() function returned without doing anything if the input packet had size 0. This meant that flushing buffered frames at EOF did not work. Remove this test. Have the core code skip such packets coming from the file being played instead (Libav treats 0-sized packets as flush signals anyway, so better assume such packets do not represent real frames with any codec).
| * vd_ffmpeg: adjust buffered frame count based on threads againUoti Urpala2012-02-031-0/+2
| | | | | | | | | | | | | | | | | | Libav has changed back to not modifying avctx->has_b_frames based on the extra buffering caused by thread use. Add back the code to do the adjustment on the player side once again. The timing mode using the buffering info is no longer the default, so in most cases having this right or not won't matter for playback.
| * build: switch to libavutil bswap.h and intreadwrite.hUoti Urpala2012-02-019-11/+19
| | | | | | | | | | | | | | | | | | | | | | | | Remove the private bswap and intreadwrite.h implementations and use libavutil headers instead. Originally these headers weren't publicly installed by libavutil at all. That already changed in 2010, but the pure C bswap version in installed headers was very inefficient. That was recently (2011-12) improved and now using the public bswap version probably shouldn't cause noticeable performance problems, at least if using a new enough compiler.
| * Update Libav API usesUoti Urpala2012-02-014-44/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change various code to use the latest Libav API. The libavcodec error_recognition setting has been removed and replaced with different semantics. I removed the "--lavdopts=er=<value>" option accordingly, as I don't think it's widely enough used to be worth attempting to emulate the old option semantics using the new API. A new option with the new semantics can be added later if needed. Libav dropped APIs that were necessary with all Libav versions until quite recently (like setting avctx->age), and it would thus not be possible to keep compatibility with previous Libav versions without adding workarounds. The new APIs also had some bugs/limitations in the recent Libav release 0.8, and it would not work fully (at least some avcodec options would not be set correctly). Because of those issues, this commit makes no attempt to maintain compatibility with anything but the latest Libav git head. Hopefully the required fixes and improvements will be included in a following Libav point release.
* | screenshot: allow forcing taking screenshots with the video filterwm42012-02-292-1/+13
| | | | | | | | | | | |