Commit Graph

2868 Commits

Author SHA1 Message Date
wm4 1fde09db6f Remove some demuxers and decoders
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()).
2012-07-30 22:14:32 +02:00
wm4 0f48820ecc mplayer: remove benchmarking/CPU accounting code
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).
2012-07-30 01:49:35 +02:00
wm4 cc0c0ef9b7 libmpcodecs: silence lines reading "AUDIO:" and "VIDEO:"
Both of these are not very interesting, and redundant with the
corresponding VO/AO initialization messages.
2012-07-30 01:46:04 +02:00
wm4 5b9d01bd49 vd: silence output about aspect ratio
Uninteresting.
2012-07-30 01:45:08 +02:00
wm4 35291b8ad9 vf_scale: don't pass CPU flags anymore
libav detects them automatically.
Also fix a bunch of other VFs, which use the get_sws_cpuflags()
function defined by vf_scale.c.
2012-07-30 01:38:53 +02:00
wm4 43da1e78c4 Rip out 3DNOW support
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.
2012-07-30 01:38:14 +02:00
wm4 74df1d8e05 Remove compile time/runtime CPU detection, and drop some platforms
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.
2012-07-30 01:37:28 +02:00
wm4 806461c5b6 ad_faad: include neaacdec.h instead of faad.h
The faad.h header printed a warning that this header is outdated.
The header neaacdec.h is probably the proper header, so use that.
2012-07-28 23:51:38 +02:00
wm4 08caadb9c0 bstr: rename bstr() function to bstr0(), and typedef bstr to struct bstr
Replace all uses of bstr() with bstr0().
Also remove the ridiculous C++ workaround.
2012-07-28 23:47:42 +02:00
wm4 74e7a1e937 osd: use libass for OSD rendering
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.
2012-07-28 23:36:07 +02:00
wm4 51e198c2a1 Merge remote-tracking branch 'origin/master'
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 2ba8b91a97. 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.
2012-07-28 17:24:05 +02:00
Uoti Urpala b7fb2daff4 vd_vfw.c: fix part missing from previous commit
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.
2012-07-26 17:46:44 +03:00
Uoti Urpala 8079f4ff82 demux, vd_ffmpeg: fix demux keyframe flag, set AV_PKT_FLAG_KEY
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.
2012-07-25 01:10:30 +03:00
Uoti Urpala 5f3c3f8c32 video, audio: use lavc decoders without codecs.conf entries
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.
2012-07-24 09:01:47 +03:00
wm4 2793e7eb70 Merge remote-tracking branch 'origin/master' 2012-05-20 11:42:44 +02:00
Thomas Orgis 9bf03e8b65 ad_mpg123: update libmpg123 API use
Improve ad_mpg123, including use of the more efficient framewise
decoding with mpg123 version 1.14 or later (older versions are still
supported).
2012-05-07 01:10:25 +03:00
wm4 97ac824124 Merge remote-tracking branch 'origin/master'
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 aadf1002f8 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.
2012-04-29 10:01:28 +02:00
Uoti Urpala deffd15a05 ad_ffmpeg: switch to avcodec_decode_audio4()
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.
2012-04-19 01:42:30 +03:00
wm4 1aa2e36122 Merge remote-tracking branch 'origin/master'
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
2012-04-01 22:52:33 +02:00
wm4 84b2c79c56 libmpcodecs: rename IMGFMT_GBR24P to IMGFMT_GBRP
This is more in line with the ffmpeg/libav names.
2012-03-25 23:12:57 +02:00
reimar bf3f28f0a8 vf_scale: prefer converting GBR24P to other 8 bit per component RGB formats
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
2012-03-25 23:09:58 +02:00
cehoyos b223805547 libmpcodecs: support planar GBR24 decoding
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.
2012-03-25 23:03:15 +02:00
Uoti Urpala 06e3dc8eba timeline: subs: keep subtitle tracks in source time
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.
2012-03-25 22:30:37 +03:00
Uoti Urpala a3b4f64df4 cosmetics: vf_vo.c: reformat 2012-03-25 22:30:37 +03:00
Uoti Urpala 4f1e4eae99 cosmetics: misc minor cleanups
The deleted ZRM* things were only relevant to vo_zr, which was deleted
earlier.
2012-03-25 22:30:37 +03:00
wm4 6de8120822 Merge remote-tracking branch 'origin/master' into my_master
Conflicts:
	command.c
	mp_core.h
	mplayer.c
	screenshot.c
2012-03-16 19:14:44 +01:00
wm4 a1244111a7 windows support: unicode filenames
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.
2012-03-09 20:48:54 +02:00
wm4 8dc0743571 Merge remote-tracking branch 'origin/master' into my_master
Conflicts:
	mplayer.c
	screenshot.c
2012-03-05 22:24:57 +01:00
wm4 24be34f1e9 cleanup: Silence compilation warnings on MinGW-w64
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.
2012-03-01 00:22:30 +02:00
wm4 8b69d8a366 screenshot: allow forcing taking screenshots with the video filter
If the screenshot_force video filter is inserted, taking screenshots will
always use the video filter, and skip the VO specific screenshot code.

This can be useful if the VO code causes problems, or if it's intended to
take screenshots from a specific location in the filter chain.

The 'screenshot' filter is intended as fallback, it's not used if possible.
2012-02-29 03:41:14 +01:00
Uoti Urpala a43a4aafd0 configure, build: support compiling without libpostproc
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.
2012-02-27 18:18:49 +02:00
wm4 93d4dd46bf mpcodecs: remove mp_image_t.x/y
These were never used.
2012-02-24 15:25:22 +01:00
Uoti Urpala da52c9400d vd_ffmpeg: fix flushing of buffered frames
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).
2012-02-03 20:15:16 +02:00
Uoti Urpala b317b92819 vd_ffmpeg: adjust buffered frame count based on threads again
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.
2012-02-03 20:03:00 +02:00
Uoti Urpala fc6a9e4a3e build: switch to libavutil bswap.h and intreadwrite.h
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.
2012-02-01 22:46:27 +02:00
Uoti Urpala db8cdc73e3 Update Libav API uses
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.
2012-02-01 22:46:27 +02:00
wm4 f0777d67ce i lost my brain
should be squashed with "screenshot: improve quality by using additional swscale flags"
2012-01-26 22:59:47 +01:00
wm4 bba96eca42 Merge branch 'gradfun' into my_master 2012-01-18 04:22:48 +01:00
wm4 f341b21a90 Merge remote-tracking branch 'origin/master' into my_master 2012-01-18 04:18:41 +01:00
wm4 4e76c7514f screenshot: improve quality by using additional swscale flags
Adding these flags improves the quality of the YUV->RGB conversion when
screenshots are taken. It trades precision for performance.

This doesn't affect any other swscale uses, such as vf_scale or vo_x11.

Based on a patch by cantabile. Fixes #140.
2012-01-18 02:53:30 +01:00
wm4 3b03f4995d subtitles: create only one instance of ASS_Render instead of two
This simplifies the code. It also can make loading of mkv files faster, as
initializing two ASS_Render instances required scanning mkv font
attachments twice.
2012-01-18 02:53:30 +01:00
Uoti Urpala c4093e7d87 vd_ffmpeg: explicitly set thread count even if 1
Libav started automatically enabling threaded decoding a while ago.
This is not safe, as it means callbacks can suddenly get called from
other threads and outside calls to libavcodec. We need to know when
threading will be used and disable thread-unsafe callbacks in those
cases. Explicitly set thread count to 1 instead of leaving it at 0
(which triggers the autodetection) when we are not requesting more
threads; this should make sure that autodetection on libavcodec side
will not be used.
2012-01-17 00:07:27 +02:00
wm4 7142d2e4c0 vf_gradfun: change default parameters 2012-01-10 21:18:26 +01:00
wm4 278094e233 vf_gradfun: add size parameter, which sets radius according to movie diagonal
This patch adds a "size" parameter, which scales the filter radius
according to movie diagonal, the unit being percent of diagonal.
This makes the effect far more predictable across movies of different
resolutions.

Usage example (with possibly useless values):
-vf gradfun=strength=1.2:size=2.3

Based on a patch by Radosław Szkodziński <astralstorm@gmail.com>
2012-01-10 01:31:11 +01:00
wm4 ae16c751c8 vf_gradfun: use option parser 2012-01-10 01:30:56 +01:00
Uoti Urpala 62e3877417 ad_ffmpeg: pass packet side data from libavformat
Pass avpacket->side_data when using a libavcodec audio decoder
together with libavformat demuxer (this was already done for video).
2012-01-08 23:32:40 +02:00
Uoti Urpala c32b3edfea vf_fspp: make compile without Libav internals
Make vf_fspp compile without using internal Libav/FFmpeg files and
compile it by default.
2012-01-02 06:15:52 +02:00
Uoti Urpala 1bd5871762 Libav API updates (remove most deprecated-in-0.7 uses)
Update various code using Libav libraries to remove use of API
features that were deprecated at Libav release 0.7. I think this
removes them all with the exception of URLContext functions still used
in stream_ffmpeg.c (at least other uses that generated deprecation
warnings with libraries from 0.7 are removed).
2011-12-22 04:43:02 +02:00
Uoti Urpala 37e4a928ca configure, build: require at least Libav 0.7
Require versions of the Libav libraries corresponding to Libav release
0.7. These are:
libavutil   51.7.0
libavcodec  53.5.0
libavformat 53.2.0
libswscale   2.0.0
libpostproc 52.0.0

Also disable the fallback to simple header check if these libraries
could not be found with pkg-config; now compiling without pkg-config
support for these always requires explicitly setting --enable-libav
and any needed compiler/linker flags. The simple check would have let
compilation proceed even if a version mismatch was detected.
2011-12-22 01:27:45 +02:00
wm4 827faa3843 vf_expand: always clear the added borders
Using the "expand" filter makes the image area larger by adding
borders to the video frame. These borders are supposed to be always
black. The filter relied on the borders in its output buffer staying
black without redrawing them for each frame. However, when using
direct rendering, a video filter inserted after vf_expand can draw
into these borders, for example the "unsharp" and "ass" filters. These
changes incorrectly stayed visible in the the following video frames.

Fix this by always clearing the borders in vf_expand. In some cases,
this might be more work than necessary, but vf_expand has no way of
detecting whether a subsequent filter draws into the borders or not,
and this avoids fragile assumptions about the existing contents of the
output buffer(s).

This also deals with frame size changes when config() is called again.
Before this commit, remains of the old video were visible if the new
video frame size was smaller than before.

Since we now always clear the borders, there's no more need for the
complicated code that cleared only the regions that were covered by the
OSD. Delete that.
2011-12-19 21:56:00 +02:00
wm4 4478acd618 vf_dsize, vf_scale: fix behavior on multiple config() calls
When config() is called multiple times (e.g. aspect ratio changes
while the same file is playing), the user settings are not honoured,
because config() overwrites them. Don't do that.
2011-12-19 02:02:32 +02:00
wm4 efe28bf2ab vf_dsize: cleanup identation (tabs to 4 spaces) 2011-12-19 01:57:56 +02:00
wm4 52f9abefa3 vo: reset EOSD change detection when VO is re-configured
This fixes a crash with vo_gl when the switch_ratio slave command is used
while a displaying an animated subtitle. switch_ratio will cause a config()
call to vo_gl, which will reset all state, including the EOSD state. Next
time the EOSD is rendered, its change detection will indicate that only
subtitle positions have changed. The render code will attempt to access
the EOSD data structures which have been deleted with config().

Fix this by forcing the change detection to indicate a full change if
config() has been called.

This only happens when doing switch_ratio with vo_gl, and the current
subtitle is only changing positions, i.e. mp_eosd_images_t.changed == 1.
2011-12-12 21:39:20 +02:00
Uoti Urpala 2e1cdcb9e6 configure, build: remove --disable-libav support
Remove support for building the player without libavcodec and
libavformat. These libraries are now always required.
2011-12-11 07:48:26 +02:00
Uoti Urpala fe69b49ccc Merge remote-tracking branch 'wm4/window_title' 2011-12-07 00:13:51 +02:00
wm4 d4de92e808 libvo: remove title argument from struct vo_driver.config
This affects only the "new" VO API. The config() title argument was barely
used, and it's hardcoded to "MPlayer" in vf_vo.c. The X11 and the Cocoa
GUI backends, which are the only ones properly supporting window titles,
ignored this argument. Remove the title argument.

Add the vo_get_window_title function. All GUI VOs are supposed to use it
for the window title.
2011-12-06 20:32:33 +01:00
Uoti Urpala 92e5414897 ad_ffmpeg: avoid avcodec_close() if avcodec_open() failed
Avoid calling avcodec_close() in uninit() if avcodec_open() failed.
Calling avcodec_close() on a non-open codec context causes a crash
with recent Libav versions.
2011-12-06 19:54:03 +02:00
Uoti Urpala ad0348cf0a core, vo: modify OSD redraw architecture, support EOSD
Previously the core sent VFCTRL_REDRAW_OSD to change OSD contents over
the current frame. Change this to VFCTRL_REDRAW_FRAME followed by
normal EOSD and OSD drawing calls, then vo_flip_page(). The new
version supports changing EOSD contents for libass-rendered subtitles
and simplifies the redraw support code needed per VO. vo_xv doesn't
support EOSD changes because it relies on vf_ass to render EOSD
contents earlier in the filter chain.

vo_xv logic is additionally simplified because the previous commit
removed the need to track the status of current and next images
separately (now each frame is guaranteed to become "visible" soon
after we receive it as "next", with no VO code running in the interval
between).
2011-12-06 05:03:39 +02:00
Uoti Urpala 8d6fc26bb9 Merge branch 'screenshot' (early part) 2011-11-25 23:59:23 +02:00
wm4 a661bd8f0d video: use talloc for mp_image, abort if out of memory
Make new_mp_image() allocate the struct with talloc and abort() if the
av_malloc for image plane data fails.
2011-11-25 23:56:28 +02:00
wm4 01cf896a2f core: add infrastructure to get screenshots from VOs
Add a VO command (VOCTRL_SCREENSHOT) which requests a screenshot
directly from the VO. If VO support is available, screenshots will be
taken instantly (no more 1 or 2 frames delay). Taking screenshots when
hardware decoding is in use will also work (vdpau). Additionally, the
screenshots will now use the same colorspace as the video display.
Change the central MPContext to be allocated with talloc so that it
can be used as a talloc parent context.

This commit does not yet implement the functionality for any VO (added
in subsequent commits).

The old screenshot video filter is not needed anymore if VO support is
present, and in that case will not be used even if it is present in
the filter chain. If VO support is not available then the filter is
used like before. Note that the filter still has some of the old
problems, such as delaying the screenshot by at least 1 frame.
2011-11-25 23:56:28 +02:00
Uoti Urpala 3a39fc1fea commands, vd_ffmpeg: fix switch_ratio slave command
The implementation of the switch_ratio command was hacky and called
mpcodecs_config_vo() to reconfigure the filter/VO chain from under an
existing decoder. This call no longer worked properly with vd_ffmpeg
after that started using mpcodec_config_vo2(). Add new video decoder
control command VDCTRL_RESET_ASPECT and use this to tell vd_ffmpeg to
reinitialize the output chain properly.
2011-11-14 20:24:39 +02:00
Uoti Urpala 505f94cef9 vd_ffmpeg: disable slice use that fails with size changes
When not using direct rendering, vd_ffmpeg created an mp_image struct
before calling libavcodec decoder, so that possible slice support
could be checked from the mpi_image and output would be ready for
slice-drawing calls. However, this behavior is unsound with decoders
that can change output size, as the parameters can change after the
mp_image was created. Disable the code creating the mp_image at that
point, which also disables use of slices in this case. Slices are
disabled with threading anyway, so I think trying to add workarounds
to support them is not a high priority.

I think this code has always been buggy, but before common thread use
it was rarely executed because the direct-rendering case was used
instead.
2011-11-14 20:24:39 +02:00
Uoti Urpala dd1b848d92 cleanup: vf_scale.c, vf.c: replace numbers by flag macro names 2011-11-14 20:24:39 +02:00
Uoti Urpala 991d7387b3 cosmetics: vf.[ch]: reformat
Also a couple of smaller changes to other files.
2011-11-14 20:24:36 +02:00
Uoti Urpala c0b7851f23 vd_ffmpeg.c: remove useless realvideo avctx->sub_id setting
Libavcodec has ignored the caller-set sub_id value since 2006.
2011-10-25 20:35:03 +03:00
Uoti Urpala 3dd8b7326c cosmetics: vd_ffmpeg.c: reformat 2011-10-22 03:51:37 +03:00
Uoti Urpala 3595dcc089 audio/video: delete buggy "dynamic plugin" code
Codec selection for audio and video decoding had a "dynamic plugin"
feature that tried to load a shared library for any codec that had not
been enabled at compilation (disabled by default, but could be enabled
with --enable-dynamic-plugins configure switch; for unknown reasons
some distro packages have enabled it). The implementation was buggy
and could cause normal codec selection fallback to fail if the feature
was enabled. I'm not aware of any real uses of such dynamic plugins
and the feature seems questionable anyway (there are no ABI guarantees
that would make it safe to use). Remove the buggy feature.
2011-10-20 02:16:35 +03:00
wm4 75eab4f72a video, options: implement better YUV->RGB conversion control
Rewrite control of the colorspace and input/output level parameters
used in YUV-RGB conversions, replacing VO-specific suboptions with new
common options and adding configuration support to more cases.

Add new option --colormatrix which selects the colorspace the original
video is assumed to have in YUV->RGB conversions. The default
behavior changes from assuming BT.601 to colorspace autoselection
between BT.601 and BT.709 using a simple heuristic based on video
size. Add new options --colormatrix-input-range and
--colormatrix-output-range which select input YUV and output RGB range.
Disable the previously existing VO-specific colorspace and level
conversion suboptions in vo_gl and vo_vdpau. Remove the
"yuv_colorspace" property and replace it with one named "colormatrix"
and semantics matching the new option. Add new properties matching the
options for level conversion.

Colorspace selection is currently supported by vo_gl, vo_vdpau, vo_xv
and vf_scale, and all can change it at runtime (previously only
vo_vdpau and vo_xv could). vo_vdpau now uses the same conversion
matrix generation as vo_gl instead of libvdpau functionality; the main
functional difference is that the "contrast" equalizer control behaves
somewhat differently (it scales the Y component around 1/2 instead of
around 0, so that contrast 0 makes the image gray rather than black).
vo_xv does not support level conversion. vf_scale supports range
setting for input, but always outputs full-range RGB.

The value of the slave properties is the policy setting used for
conversions. This means they can be set to any value regardless of
whether the current VO supports that value or whether there currently
even is any video. Possibly separate properties could be added to
query the conversion actually used at the moment, if any.

Because the colorspace and level settings are now set with a single
VF/VO control call, the return value of that is no longer used to
signal whether all the settings are actually supported. Instead code
should set all the details it can support, and ignore the rest. The
core will use GET_YUV_COLORSPACE to check which colorspace details
have been set and which not. In other words, the return value for
SET_YUV_COLORSPACE only signals whether any kind of YUV colorspace
conversion handling exists at all, and VOs have to take care to return
the actual state with GET_YUV_COLORSPACE instead.

To be changed in later commits: add missing option documentation.
2011-10-16 21:11:11 +03:00
Uoti Urpala 83fc5b6004 options: move libass-related options to struct 2011-09-03 14:26:14 +03:00
Uoti Urpala a24e333fca ad_ffmpeg: free resources on init failure
ad_ffmpeg init() function did not free resources if opening failed.
Outside code (dec_audio.c) does not automatically call uninit() if
init() returns failure, and the uninit function would have crashed in
some cases had it been called (it did freed lavc_context->extradata,
but lavc_context could have been NULL after early init failure). Add
explicit calls to uninit() after failure and make uninit function safe
to call at any point.
2011-08-21 23:04:20 +03:00
Uoti Urpala 68df2b2b3f ad_ffmpeg: handle timing for partially decoded packets better
At least the libavcodec WavPack decoder can return output for an audio
frame in multiple parts and return 0 bytes input consumed for the
initial parts. Timing info was not set correctly in this case:
sh_audio->pts and pts_bytes were reset each time when decoding more
from the packet, as if the packet had been new (ds_get_packet_pts()
has a check to return MP_NOPTS_VALUE if the packet has already been
partially read, but that didn't trigger since libavcodec returned
exactly 0 bytes read so the demuxer-visible packet state didn't
change).

Add a field to keep track of whether a packet has already been decoded
from, and don't reset timing info again if so. Adding the field
requires adding a decoder context to store it (there wasn't one
before).

BTW the WavPack decoder behavior and avcodec_decode_audio3()
documentation don't match - the documentation says the return value is
"zero if no frame data was decompressed (used) from the input
AVPacket", while the decoder DOES return some frame data which comes
from the input packet.
2011-08-21 22:47:59 +03:00
Uoti Urpala da2b884c70 cosmetics: ad_ffmpeg.c: reformat 2011-08-21 22:20:07 +03:00
Uoti Urpala 9c7c4e5b7d core, demux, vd_ffmpeg: pass side data from demux_lavf to vd_ffmpeg
Pass the libavformat packet side_data field from demux_lavf to
vd_ffmpeg. Libavcodec/libavformat use this field for palette data, and
passing it is required for the playback of some paletted video codecs.

The implementation works by giving vd_ffmpeg a copy of the struct
demux_packet used to store the video packet (from which it can access
the avpacket field). The definition of struct demux_packet is moved to
new file demux_packet.h so that vd_ffmpeg.c can use it without
including all of demuxer.h.
2011-08-20 20:25:43 +03:00
harklu a7fee50ca0 vf_screenshot: better check for pixel format swscale support
vf_screenshot checked for a list of pixel formats that were known to
work with swscale. However, the list was incomplete. If a pixel format
was used that was not on the vf_screenshot list, but was supported
both by swscale and the VO driver, mplayer2 would insert a useless
scale filter to convert to a format supported by vf_screenshot. Fix
this by making vf_screenshot check directly whether the pixel format
is supported by swscale with sws_isSupportedInput().
2011-08-17 01:18:45 +03:00
harklu 9e6933440a options, subs: add --ass-vsfilter-aspect-compat
Add option --ass-vsfilter-aspect-compat and corresponding property
ass_vsfilter_aspect_compat. The setting controls whether to enable the
emulation of traditional VSFilter behavior where subtitles are
stretched if the video is anamorphic (previously always enabled for
native SSA/ASS subtitles). Enabled by default. Add 'V' as a new
default keybinding to toggle the property.
2011-08-12 14:19:10 +03:00
Uoti Urpala 8d1e5354e4 subs: libass: apply option changes to all track types
Libass rendering uses two renderer objects to support both VSFilter
aspect ratio (mis)behavior emulation and correct rendering. When
option values were changed during playback the changes were applied to
the renderer used for the currently active track only, and old values
could be used if the user then switched to a track using the other
renderer object. Fix to update both renderers.
2011-08-08 07:02:01 +03:00
Uoti Urpala 9920d64650 cleanup: move global ass_force_reload to struct osd_state 2011-08-08 05:59:23 +03:00
Uoti Urpala b33bb28ea3 build: fix --enable-debug, remove some "#ifdef MP_DEBUG"
Recent commit 5d5ca22a6d ("options: commandline: accept --foo=xyz
style options") left some bad code under "#ifdef MP_DEBUG" in
playtree.c, which caused a compilation failure if configured with
"--enable-debug". Fix this. Having the "#ifdef MP_DEBUG" there was
completely unnecessary; it only increased the risk for this kind of
problems for no real benefit - executing the asserts under it would
have no noticeable performance or other penalty in default builds
either. Remove several cases of such harmful "#ifdef MP_DEBUG".
2011-07-30 19:03:20 +03:00
Uoti Urpala e873d703e9 options: change option parsing to use bstr
Using bstr allows simpler parsing code, especially because it avoids
the need to modify or copy strings just to terminate extracted
substrings.
2011-07-29 05:50:38 +03:00
Uoti Urpala a4f4130819 cleanup: do libav* initialization on startup
Do the global initialization of libavcodec and libavformat
(avcodec_register_all(), av_register_all()) immediately on program
startup and remove the initialization calls from various individual
modules that use libavcodec/libavformat functionality.
2011-07-18 00:57:05 +03:00
Uoti Urpala 4e2b15fc5e vf_qp: enable compilation depending on libavutil eval API
Libavutil eval API seems to be enough for vf_qp, so enable the filter
if the API is available. Also clean up some left over lines for other
filters in Makefile.
2011-07-18 00:57:05 +03:00
Uoti Urpala e62fcc3a0e img_format.h, vo_gl: fix IMGFMT_IS_YUVP16() definition
Commit aba8a1838a which added 9- and 10-bit formats failed to change
the definition of the IMGFMT_IS_YUVP16() macro (which is misnamed btw,
it matches 9, 10 and 16 bits). This prevented vo_gl from accepting
input in supported 9 and 10 bit colorspaces. Fix.
2011-07-14 01:19:07 +03:00
Uoti Urpala 13151d7b69 vd_ffmpeg: make "-lavdopts lowres" handling more robust
Remove the copy of the "lowres" field that vd_ffmpeg kept in its
private struct and use the value from AVCodecContext directly instead.
The copy gave no benefit and it could be set to the wrong value if
someone used "-lavdopts o=lowres=X" (which would change the real value
but not the copy).
2011-07-09 14:14:38 +03:00
Uoti Urpala 1a7ef3b39c vd_ffmpeg: fix "-lavdopts skipframe" support
Support for -lavdopts skipframe had been broken since commit bc767c2a9
as framedrop logic now set the same field and thus overwrote the value
set from the option. Change that code to set it to the original value
instead of 0 when not dropping frames.
2011-07-09 13:50:16 +03:00
reimar f572826883 cosmetics: img_format.h: document some formats
Document the meaning of some of the packed YUV formats.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@33692 b3059339-0415-0410-9bf9-f77b7e298cf2
2011-07-06 13:01:07 +03:00
reimar b0a88d1362 vf_stereo3d: Add support for converting to interleaved 3D
Patch by Steaphan Greene [sgreene cs.binghamton.edu]

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

Improve stereo3d interleaved man page description.

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

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

Change memcpy_pic to force it to never write to image parts between
width and stride if creating a row-interleaved format, otherwise
the second memcpy_pic might overwrite what the first wrote.
Changing the first should not be necessary but might result in
better performance.

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

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@33690 b3059339-0415-0410-9bf9-f77b7e298cf2
2011-07-06 13:01:07 +03:00
reimar 20ea5a1cfc vf_ilpack: fix incompatible function types
Do not call functions through a function pointer specifying more
arguments. It is theoretically possible to have calling models
where this would break horribly.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@33536 b3059339-0415-0410-9bf9-f77b7e298cf2
2011-07-06 09:24:31 +03:00
Uoti Urpala 3cbde4da84 cosmetics: vf_ilpack.c: tabs to 4 spaces 2011-07-06 09:23:53 +03:00
reimar be4d3d3491 vf_dint, vf_divtc: fix code assuming "char" is signed
Use int as type, there is no reason to use char which also
causes issues since it may be either signed or unsigned.

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

Fix code assuming that "char" is signed.

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

Fix code incorrectly assuming "char" is signed.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@33531 b3059339-0415-0410-9bf9-f77b7e298cf2
2011-07-06 09:15:57 +03:00
cigaes 4f4fae851d vf_delogo: allow to change the rectangle based on the time
NOTE: the memory for the "file" argument will be leaked; dynamic
options are not automatically freed. Not fixing that now as I might
implement more general handling later. -uau

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

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@33498 b3059339-0415-0410-9bf9-f77b7e298cf2
2011-07-06 07:13:08 +03:00
Uoti Urpala ecfffe6466 cosmetics: vf_delogo.c: remove tabs to allow direct merge
Remove tab characters to make the file match MPlayer 1 and thus allow
directly applying change from there.
2011-07-06 07:11:03 +03:00
Uoti Urpala befed529bc debug output: reduce verbosity of some frequent messages
Drop from frequent (per-frame) messages from DBG2 to DBG3. Drop VDPAU
clock adjustment messages from V to DBG2.
2011-07-05 00:50:41 +03:00
Uoti Urpala c8b3088c18 audio: move ready-for-ao data buffer from decoder to AO
Move the buffer storing audio data ready to be fed to the audio output
driver from the audio decoder object to the AO object. This will help
encoding code deal with end of input, and may also be useful to
improve other general gapless audio behavior (as AOs which do not
accept chunks smaller than a certain size may keep them in the buffer
while the decoder changes).

Less data may be dropped now when changing audio filters or switching
timeline parts.
2011-07-02 09:22:32 +03:00
Clément Bœsch 480f3fb8d0 cleanup: fix mp_dbg() format string warnings 2011-07-01 03:37:34 +03:00
reimar 57f48fc1bf vo_gl: don't accept 9/10-bit formats as input
Make mp_get_chroma_shift() simpler/more generic and add an argument
to get the per-component bit depth.
Use this to check more properly for supported formats in
gl and gl2 vos (only 8 and 16 bit are supported, 9 and 10 are not).

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@33452 b3059339-0415-0410-9bf9-f77b7e298cf2
2011-06-29 10:49:41 +03:00
iive 49b31c2b43 vd_ffmpeg.c: fix one case of "-lavdopts vstats" crashing
Fix segfault with -lavdopts vstats and some codecs.
The vstats option relies on avctx->coded_frame being filled.
Unfortunately not all codecs do that (e.g. VP8) thus causing
NULL dereference.
FFmpeg code seems to always check if coded_frame != NULL,
so we should do the same.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@33347 b3059339-0415-0410-9bf9-f77b7e298cf2
2011-06-29 06:30:49 +03:00
Diego Biurrun 017c173d74 configure: Remove checks for default inline asm features
Remove checks for compiler support of >= 10 assembler operands and
named assembler arguments. Just assume the features are always
available. These features were only missing from obsolete GCC versions
which are not supported any more.
2011-06-28 19:04:22 +03:00
Uoti Urpala d3bef0286b vd_ffmpeg: autoselect output colorspaces without codecs.conf
Selecting the colorspace to output from a decoder is done in the
function mpcodecs_config_vo(). Add a new version of this function,
mpcodecs_config_vo2(), that allows the decoder to specify a list of
candidate colorspaces instead of always using a hardcoded list
specified in the codecs.conf entry. If the codecs.conf entry has any
"out" lines then those still take priority and the decoder-provided
list (if any) is ignored. Make vd_ffmpeg provide a list of the
colorspaces it's willing to output. Remove "out" lines from most
entries for libavcodec video decoders in codecs.conf, so that the
automatic values are now used instead.
2011-06-26 06:27:50 +03:00
Uoti Urpala aba8a1838a video/colorspaces: add new 9/10-bit formats from libavcodec
Add new internal 9/10-bit IMGFMT values and mappings to the
corresponding libav* PIX_FMT_* values.

Partially based on a patch from Arne Bochem <arneb.mp@ccan.de>.
2011-06-26 06:27:50 +03:00