Commit Graph

2868 Commits

Author SHA1 Message Date
wm4 8f8f6e6d9d sub: remove logic for disabling hinting on scaled EOSD
This was an extremely obscure setting, as it was used only with vo_gl
if its scaled-osd suboption was used. If you really want this, you can
set the desired ass-hinting value directly, and there will be literally
no loss in functionality.

Note that this didn't actually test whether the EOSD was scaled.
Basically, it only checked whether vo_gl had the scaled-osd suboption
set.
2012-10-16 07:26:31 +02:00
wm4 ffb7a2fe17 sub: create sub_bitmap array even when using libass
One sub_bitmaps struct could contain either a libass ASS_Image list, or
a mplayer native list of sub-bitmaps. This caused code duplication in
vo_vdpau.c and bitmap_packer.c.

Avoid this by creating such a sub_bitmap array even with libass. This
basically copies the list and recreates it in mplayer's native format.
It gets rid of the code duplication, and will make implementing extended
subtitle and OSD rendering in other VOs easier.

Also do some cosmetic changes and other preparations for the following
commits.
2012-10-16 07:26:28 +02:00
Rudolf Polzer 5a3045f1a2 vf_scale: do the upscale detection AFTER calculating dimensions
Otherwise it heavily violates the manpage's description, and describing
what it did before in the documentation is something too complicated to
describe in the English language.
2012-09-24 16:41:12 +02:00
Rudolf Polzer 416c03417e vf_rectangle: remove as it is very dirty and we have a replacement now 2012-09-18 21:08:20 +02:00
Rudolf Polzer 9343c1d3ab vf_dlopen: improve performance for 1-frame-for-1-frame filters
This is done by requesting a buffer from the next filter in the chain, instead
of always allocating our own. This allows the next filter to e.g. ensure its
own preferred memory layout.
2012-09-18 21:08:20 +02:00
wm4 c8154630bf ad_dvdpcm: add back PCM decoder for DVD
This is needed by demux_mpg (and possibly by demux_ts) for PCM playback.
The decoder does the mapping from MPEG headers to the actual PCM format,
and also unpacks sample data for 20/24 bit formats.
2012-09-18 21:08:14 +02:00
Uoti Urpala 1959ba006c subs, vo_vdpau: support RGBA color for PGS subtitles
Support passing bitmap subtitles to VOs in full RGBA color, and
implement this for libavcodec-decoded subtitle formats on decoding
side and vo_vdpau on display side. Currently this is enabled for PGS
(blu-ray) and DVB subtitles.

VDPAU seems to have sampling issues similar to known GL ones when
drawing a sub-rectangle from a larger texture with scaling, where
adjacent pixels outside the specified source rectangle affect the
result. As the bitmap subtitles may be scaled, add padding support to
the bitmap packer code.

In principle, this could be used for colored DVD subtitles too.
However, the libavcodec DVD decoder lacks parts of the resolution and
palette handling that are present in spudec.c.

Conflicts:
	libvo/vo_gl.c
	sub/dec_sub.h
	sub/sd_lavc.c
2012-09-18 21:07:30 +02:00
wm4 1ba5a8f283 rawaudio: use mplayer audio format for format option
The rawaudio demuxer had a rather hard to use way to set the audio
format with the --rawaudio=format=value option. The user had to pass a
numeric value, which then was set as wFormatTag member in the
WAVEFORMATEX header.

Make it use the mplayer audio format (the same as --af=format=value).
Add a new internal pseudo audio codec tag, which is hopefully unused,
which makes ad_pcm use the value in wFormatTag as internal mplayer
audio format.

Playing non-PCM formats is disabled. (At least AC3 can be played
directly.)
2012-09-18 21:07:29 +02:00
wm4 1f5635d02c dec_audio: do not overwrite sh_audio->wf->wFormatTag
No decoder actually used this value (except ad_acm, which was removed a
while ago), so this change shouldn't have any bad consequences.
ad_ffmpeg passes wf to libavcodec decoders, but only the extra data
portion.

This change is needed by the next commit.
2012-09-18 21:06:40 +02:00
wm4 ee65b39cbe ad_pcm: add back raw decoder
This was removed in commit 6a26b4a665. Add it back, because it was
needed by demuxer_rawaudio and for PCM audio with demuxers other than
demux_lavf. (In practice, this broke rawaudio and PCM-in-Matroska only.)

Unlike with raw video, there is no single raw audio "decoder" in
libavcodec. Instead of trying to mess raw audio input into ad_ffmpeg
using a table to map audio formats to the respective libavcodec
decoders, it seems advantageous to simply add back ad_pcm.
2012-09-18 21:04:47 +02:00
wm4 dd3e1217eb demuxer: remove ImageDesc field
This was needed by the now-removed mov demuxer for QuickTime video, or
to be more specific, the Sorenson 3 video codec. QuickTime can
(probably) still decoded by libavcodec, but this field is not needed
for this.

The reference in demux_mkv was apparently for decoding QuickTime in
Matroska, using binary QuickTime codecs (QTX stuff). It's possible that
this has been broken with the binary codecs removal (see commit
aebfbbf2bd), because it removed related code from demux_mkv.  On the
other hand, the code section in question was enabled only if binary
win32 codecs were enabled. The win32 codec loader worked on 32 bit x86
only. This means QuickTime-in-Matroska was broken on all other
architectures, including 64 bit x86. Despite being possibly broken on a
major platform, nobody has complained about it yet, and since I couldn't
find a sample of such a mkv file, so don't bother with it.
2012-09-18 21:04:46 +02:00
Uoti Urpala fd52cb65f4 subs, vo: do sub bitmap change detection by comparing IDs
vo_vdpau and vo_gl cache the last subtitle bitmaps uploaded to video
card in case they stay the same over multiple frames. Detecting
whether the bitmaps have changed and should be re-uploaded was
somewhat fragile. Change the VO API to provide a bitmap ID which can
be compared with what the VO has to determine whether a new upload of
the bitmaps is needed.

Conflicts:
	libvo/vo_gl.c

Note: the changes for vo_gl.c were not merged. Instead, eosd_packer is
modified to use the new way of detecting EOSD changes. This takes care
of vo_gl, vo_gl3 and vo_direct3d, which all render EOSD. They don't
need to be updated in turn.
2012-09-18 21:04:46 +02:00
Uoti Urpala 89a5714893 subs: always use sub decoder framework for libass rendering
Remove subtitle selection code setting osd->ass_track directly and
vf_ass/vf_vo code rendering the track directly with libass. Instead,
do track selection and rendering with dec_sub.c functions.

Before, mpctx->set_of_ass_tracks[] contained bare libass tracks
generated from external subtitle files. For use with dec_sub.c, it now
contains struct sh_sub instances with decoder already initialized.

This commit breaks the sub_step command ('g' and 'y' keys) for
libass-rendered subtitles. It could be fixed, but it's so useless -
especially as with the existing implementation there's no practical
way to get subtitle delay back to normal after using it - that I
didn't bother.

Conflicts:
	command.c
	mp_core.h
	mplayer.c
2012-09-18 21:04:46 +02:00
Uoti Urpala 9bb03b7db4 subs: libass: use a single persistent renderer for subtitles
To draw libass subtitles, the code used ASS_Renderer objects created
in vf_vo (VO rendering) or vf_ass. They were destroyed and recreated
together with the video filter  chain. Change the code to use a single
persistent renderer instance stored in the main osd_state struct.
Because libass seems to misbehave if fonts are changed while a
renderer exists (even if ass_set_fonts() is called on the renderer
afterwards), the renderer is recreated after adding embedded fonts.

The known benefits are simpler code and avoiding delays when switching
between timeline parts from different files (libass fontconfig
initialization, needed when creating a new renderer, can take a long
time in some cases; switching between files rebuilds the video filter
chain, and this required recreating the renderers). On the other hand,
I'm not sure whether this could cause inefficient bitmap caching in
libass; explicitly resetting the renderer in some cases could be
beneficial. The new code does not keep the distinction of separate
renderers for vsfilter munged aspect vs normal; this means that
changing subtitle tracks can lose cache for the previous track.

The new code always sets some libass parameters on each rendering
call, which were previously only set if they had potentially changed.
This should be harmless as libass itself has checks to see if the
values differ from previous ones.

Conflicts:
	command.c
	libmpcodecs/vf_ass.c
	libmpcodecs/vf_vo.c
	mplayer.c
	sub/ass_mp.c
2012-09-18 21:04:46 +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
wm4 cafa00841f libaf: rename af_format.h to format.h
af_format.h declares some symbols which are defined in format.c. The
fact that af_format.c is a completely unrelated file is rather
confusing. Having the header and implementation file use the same base
name is more uniform. (af_format.c is the audio conversion filter, while
af_format.h and format.c are about audio formats and their properties.)

Also fix all source files which include this file.
2012-08-29 00:50:26 +02:00
wm4 7bb95cd8a5 options, codecs.conf, img_format: unify imgfmt name handling
Remove the duplication of image format name lists from codec-cfg.c
and img_format.c. Remove the list of "long" image format names from
img_format.c.

One user visible change is that now mplayer won't print "long" format
names anymore: e.g. instead of "Planar 420P 10-bit little-endian",
the name "420p10le" is used. This is consistent with the names used
by the option parser, and also less noisy.

Partially based on mplayer2 commit f98e47574de15, with some differences.
2012-08-29 00:14:11 +02:00
Uoti Urpala d5aa8dc88f cleanup: remove XvMC remains, reformat img_format.c
Remove remaining references to XvMC. It was already not supported;
remove references to the imgfmt too. Reformat img_format.c.
2012-08-28 23:26:16 +02:00
Rudolf Polzer 2adc81f0a2 vf_dlopen: add a generic filter to load external filters
Usage: -vf dlopen=filename.so:args...

Examples of such filters are provided in TOOLS/vf_dlopen/
2012-08-23 13:13:53 +02:00
wm4 2e6450c7cc img_format, m_option: make image format name list globally available
And add functions for converting them from/to the name string.
2012-08-23 13:12:43 +02:00
Uoti Urpala 009d9d8706 Adjust ffmpeg/libav #includes to work with recent upstream changes
The <libavutil/avutil.h> stopped including <libavutil/common.h>
recursively in recent ffmpeg/libav git revisions. As a result, some
files no longer got needed definitions, causing a build failure.
Modify #include lines in various files to fix build with the latest
versions of ffmpeg/libav headers.
2012-08-21 18:22:00 +02:00
cantabile a1380f3945 video: honor the video's colormatrix and color range flags
If either of them is not defined, the old behavior is used:
- the colormatrix is guessed based on resolution.
- the color range is assumed to be tv aka limited range.
2012-08-21 18:17:41 +02:00
wm4 53f6eba06c vd_ffmpeg, demux_mng: allow general raw formats, fix MNG demuxer
Change vd_ffmpeg such that if sh_video->format is a mplayer pixel
format, and there's no other codec information, try to play it as raw
video. (The case of no codec information happens if the "generic" ffmpeg
decoder is instantiated, which is tried last. This means clashes with
actual existing formats are less likely.)

demux_mng did not initialize all fields of the bih, which made vd_ffmpeg
do invalid memory accesses when trying to copy the extradata. Also, use
IMGFMT_RGB32 instead of creating the FourCC directly. (They should be
the same, but what if mplayer changes the IMGFMT_* values.)

This also fixes demux_rawvideo.
2012-08-20 15:36:04 +02:00
wm4 6a26b4a665 libmpcodecs: remove redundant audio and video decoders
Probably all of these are supported by libavcodec. Missing things can
be added back.

Also remove qtpalette.h. It was used by demux_mov.c, and should have
been deleted with commit 1fde09db6f.
2012-08-20 15:36:04 +02:00
wm4 6f7ba66817 Remove support for libdv
This removes the libdv demuxer and audio/video decoders. FFmpeg has
support for it, and it's even preferred over the internal decoders.
2012-08-20 15:36:03 +02:00
wm4 aebfbbf2bd Remove win32/qt/xanim/real binary codecs loading
Remove the win32 loader - the win32 emulation layer, as well as the
code for using DirectShow/DMO/VFW codecs. Remove loading of xanim,
QuickTime, and RealMedia codecs.

The win32 emulation layer is based on a very old version of wine.
Apparently, wine code was copied and hacked until it was somehow able
to load a limited collection of binary codecs. It poked around in the
code segment of some known binary codecs to disable unsupported win32
API calls to make them work. Example from module.c:

    for (i=0;i<5;i++)  RVA(0x19e842)[i]=0x90; // make_new_region ?
    for (i=0;i<28;i++) RVA(0x19e86d)[i]=0x90; // call__call_CreateCompatibleDC ?
    for (i=0;i<5;i++)  RVA(0x19e898)[i]=0x90; // jmp_to_call_loadbitmap ?
    for (i=0;i<9;i++)  RVA(0x19e8ac)[i]=0x90; // call__calls_OLE_shit ?
    for (i=0;i<106;i++) RVA(0x261b10)[i]=0x90; // disable threads

Just to show how utterly insane this code is. You wouldn't want even
your worst enemy to have to maintain this. In fact, it seems nobody
made major changes to this code ever since it was committed.

Most formats can be decoded by libavcodecs these days, and the loader
couldn't be used on 64 bit platforms anyway. The same is (probably)
true for the other binary codecs.

General note about how support for win32 codecs could be added back:

It's not possible to replace the win32 loader code by using wine as
library, because modern wine can not be linked with native Linux
programs for certain reasons. It would be possible to to move DirectShow
video decoding into a separate process linked with wine, like the
CoreAVC-for-Linux patches do. There is also the mplayer-ww fork, which
uses the dshownative library to use DirectShow codecs on Windows.
2012-08-16 17:16:33 +02:00
Uoti Urpala 7f0926498c ad_ffmpeg: add sanity check against decoder overreads
The libavcodec Musepack SV8 decoder returned 2 bytes consumed for 1
byte input, which triggered a crash due to negative input packet size
later. Add a sanity check to prevent crashes with this type of minor
decoder overreads. Also add a check to parser consumed data.
2012-08-16 17:16:33 +02:00
wm4 43bd4ab3a2 vf_expand: remove OSD support
It's not clear why this video filter supported OSD rendering.
The manpage says:
    "Can be used for placing subtitles/OSD in the resulting black bands."
But every single VO already does this if vf_expand adds black borders.
This feature is 100% pointless.
2012-08-16 00:00:58 +02:00
wm4 2287245136 VO: remove old VO glue
This transition to a new VO API started over 4 years ago. It's time to
finally end it, and get rid of the horrible hacks.

Also removes some previously undetected dead code from spudec.c.
2012-08-07 01:29:56 +02:00
mplayer-svn 0b8540657a vf_unsharp: direct rendering fixes
unsharp: actually process the frame we got.

Previously it would always process the last frame
allocated, but that might be a different one than the
one first returned.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@34975 b3059339-0415-0410-9bf9-f77b7e298cf2
Author: reimar

Request a sufficiently large image for direct rendering.

Fixes broken video near the borders.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@34979 b3059339-0415-0410-9bf9-f77b7e298cf2
Author: ib
2012-08-03 03:38:45 +02:00
wm4 14b545eb2a vf_ass: use correct height when copying image
The target image can be larger than the image size the video filter was
configured for.

Based on mplayer-svn commit 34973.
2012-08-03 03:34:39 +02:00
mplayer-svn f0965d8356 vf_ass: request a sufficiently large image for direct rendering
Request a sufficiently large image for direct rendering.

Due to alignment and similar, we might need a buffer
larger than the output of the ASS filter.
Fixes out of bound writes and/or broken video near the
borders.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@34970 b3059339-0415-0410-9bf9-f77b7e298cf2
Author: reimar
2012-08-03 03:34:39 +02:00
mplayer-svn ca2be52db5 ad_mad: cleanups
Remove unnecessary casts.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@34827 b3059339-0415-0410-9bf9-f77b7e298cf2

Replace malloc+memset by calloc.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@34828 b3059339-0415-0410-9bf9-f77b7e298cf2

libmad: set i_bps only if it is not already set.

Since that value is only based on the very first MP3 frame,
it is very likely to be much less accurate than any existing
value from a demuxer.

Patch by Benoît Thébaudeau.

Signed-off-by: "Benoît Thébaudeau" <benoit.thebaudeau@advansee.com>

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@34829 b3059339-0415-0410-9bf9-f77b7e298cf2

Author: reimar
2012-08-03 02:18:22 +02:00
mplayer-svn a428aaf3af vf_spp, vf_fspp: replace use of deprecated libav function
Replace use of deprecated dsputil_init() by ff_dsputil_init().

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@34816 b3059339-0415-0410-9bf9-f77b7e298cf2
Author: diego
2012-08-03 02:12:37 +02:00
mplayer-svn 14a67dd301 vf_uspp: fix possible crash when the output format is Y8
Fix possible crash when using -vf uspp,format=y8
i.e. the destination format is Y8.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@34805 b3059339-0415-0410-9bf9-f77b7e298cf2
Author: reimar
2012-08-03 01:54:10 +02:00
mplayer-svn 81048def58 vf.c: increase default alignment values
Adjust MPlayer default alignment values to match FFmpeg's.
Fixes "stride changed" errors when using e.g. MPEG-2 decoder
with -vf unsharp.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@34753 b3059339-0415-0410-9bf9-f77b7e298cf2
Author: reimar
2012-08-03 01:47:59 +02:00
mplayer-svn 3dc0cfc1fe dec_audio: add sanity check against 0 channels
Add a safeguard to avoid crash if the decoder e.g. claims 0 channels.
That would be a decoder bug, but an extra check can still help.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@34738 b3059339-0415-0410-9bf9-f77b7e298cf2
Author: reimar
2012-08-03 01:47:47 +02:00
mplayer-svn b615b66322 vf_yadif: fix green bottom line
Fix green bottom line on yadif with certain parity.

This implementation of the filter method needs a padding,
that mplayer allocates but never fills with data.
Do the padding properly and tweak the height alignment to
even number of lines, instead of rounding to 32.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@34691 b3059339-0415-0410-9bf9-f77b7e298cf2
Author: iive
2012-08-03 01:46:43 +02:00
mplayer-svn cb2f0e7c38 libmpcodecs: use 128 instead of 64 to define non-native RGB image formats
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@34659 b3059339-0415-0410-9bf9-f77b7e298cf2
Author: cehoyos
2012-08-03 01:46:25 +02:00
mplayer-svn 2e12790324 libmpcodecs: add support for 422P9
For some reason only 9-bit 422 wasn't added before.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@34524 b3059339-0415-0410-9bf9-f77b7e298cf2
Author: reimar
2012-08-03 01:43:03 +02:00
mplayer-svn d9d80705e6 vf_expand: add sanity checks
Make vf expand more picky:
refuse operating on compressed or hwaccel formats and
fix up offsets that would cause color corruption for YUV
formats with downsampled chroma.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@34356 b3059339-0415-0410-9bf9-f77b7e298cf2
Author: reimar
2012-08-03 01:35:03 +02:00
mplayer-svn 7e2b159f02 mp_image: set chroma_x_shift for 1-plane YUV formats
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@34355 b3059339-0415-0410-9bf9-f77b7e298cf2
Author: reimar
2012-08-03 01:34:43 +02:00
mplayer-svn 78f51230d7 libmpcodecs: add ad_spdif.c, S/PDIF passthrough decoder
patch by Naoya OYAMA, naoya.oyama gmail com

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@34191 b3059339-0415-0410-9bf9-f77b7e298cf2

fix ad_spdif

Call av_register_all() before initialising the SPDIF muxer.

Fixes playback with -demuxer mpegts -ac spdifac3.
Patch by Naoya OYAMA, naoya D oyama gmail

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@34291 b3059339-0415-0410-9bf9-f77b7e298cf2

Use new API avformat_new_stream() instead of the deprecated
av_new_stream().

Patch by Naoya OYAMA, naoya D oyama gmail

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@34292 b3059339-0415-0410-9bf9-f77b7e298cf2

Cosmetics: Remove empty statement.

Patch by Naoya OYAMA, naoya D oyama gmail

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@34293 b3059339-0415-0410-9bf9-f77b7e298cf2

Use init_avformat() instead of av_register_all().

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@34294 b3059339-0415-0410-9bf9-f77b7e298cf2

Author: diego
2012-08-03 01:30:08 +02:00
mplayer-svn 060e581f06 vf_stereo3d.c: half-width side-by-side formats for stereo3d
Half-width side-by-side formats for stereo3d.

Patch by Steaphan Greene [sgreene cs.binghamton.edu]

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@33877 b3059339-0415-0410-9bf9-f77b7e298cf2
Author: reimar
2012-08-03 01:09:18 +02:00
wm4 ebaaa41f2a Remove teletext support
Teletext requires special OSD support. Because I can't even test
teletext, I can't restore support for it. Since teletext can be
considered ancient and obscure, and since it doesn't make sense to keep
the remaining teletext code without being able to use it, I'm removing
it.
2012-08-03 00:12:46 +02:00
wm4 e48b21dd87 VO: remove VO direct rendering
This was disabled by default, and could be enabled with -dr. It was
disabled by default because it was buggy: there were issues with OSD
corruption.

It wasn't entirely sane for OpenGL based VOs either. OpenGL can chose
to drop mapped pixel buffer objects, requiring the application to map
and fill the buffer again. But there was no mechanism in mplayer to
fill the lost buffer again. (It seems this rarely happened in practice,
though.)

On the other side, users liked the --dr flag, because it promised them
more speed. I'm not sure if it actually helped with speed, but it's
unlikely it had any real advantages on modern systems.

In order to evade the --dr cargo culting in mplayer config files, it's
best to get rid of it.
2012-08-02 22:07:38 +02:00
wm4 ed3f0c3e4b vf: remove VFCAP_FLIPPED and VFCAP_CONSTANT
These were unused.
2012-08-02 02:51:33 +02:00
wm4 c92538dfaa Remove dead code
This was done with the help of callcatcher [1]. Only functions which
are statically known to be unused are removed.

Some unused functions are not removed yet, because they might be needed
in the near future (such as open_output_stream for the encode branch).

There is one user visible change: the --subcc option did nothing, and is
removed with this commit.

[1] http://www.skynet.ie/~caolan/Packages/callcatcher.html
2012-08-01 17:07:35 +02:00
wm4 f752212c62 Change <endian.h> include to <sys/types.h>
This seems to be more portable. Should fix compilation on OSX and
FreeBSD. Apparently also works on MinGW-w64.
2012-07-31 23:37:56 +02:00
wm4 6e8633c734 configure: remove checks for malloc.h and alloca()
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().
2012-07-30 22:14:33 +02:00