Commit Graph

37580 Commits

Author SHA1 Message Date
wm4 780f172a8a lua: rename mp.register_script_command() to mp.register_script_message()
More consistent naming.
2014-03-17 18:27:25 +01:00
wm4 637664d95a command, lua: change script_message semantics
Change script_message to broadcast the message to all clients. Add a new
script_message_to command, which does what the old script_message
command did.

This is intended as simplification, although it might lead to chaos too.
2014-03-17 18:26:56 +01:00
wm4 422af1b948 vaapi: solve potential problem with ambiguous image formats
VAAPI has some ambiguous image formats, like VA_FOURCC_I420,
VA_FOURCC_IYUV, VA_FOURCC_YV12 (the latter exactly the same as the first
two, just with swapped planes). There is potentially a problem when one
specific VAAPI format was picked, and converting it to a mpv format and
back to a VAAPI FourCC would result in a numerically different format
(even if it's actually the same). Then it could e.g. happen that
functions like va_surface_upload() reallocate the underlying VAImage,
which would be inefficient. Change the code so that this can't happen.

(Probably not a problem in practice with the current VAAPI usage.)
2014-03-17 18:23:24 +01:00
wm4 123c34a12e vaapi: simplify
Merge va_surface_priv into va_surface.
2014-03-17 18:22:48 +01:00
wm4 49d13f76ca vaapi: make struct va_surface private
It's not really needed to be public. Other code can just use mp_image.
The only disadvantage is that the other code needs to call an accessor
to get the VASurfaceID.
2014-03-17 18:22:35 +01:00
wm4 31fc5e8563 vaapi: replace image pool implementation with mp_image_pool
Although I at first thought it would be better to have a separate
implementation for hwaccels because the difference to software images
are too large, it turns out you can actually save some code with it.

Note that the old implementation had a small memory management bug. This
got painted over in commit 269c1e1, but is hereby solved properly.

Also note that I couldn't test vf_vavpp.c (due to lack of hardware), and
I hope I didn't accidentally break it.
2014-03-17 18:22:25 +01:00
wm4 88aa3b8c98 mp_image_pool: add features needed for use with hwaccel
The plan is to get rid of the custom VAAPI and possibly VDPAU surface
allocators.

Add custom surface allocation, because hwaccel surfaces are allocated
completely differently from software surfaces.

Add optional LRU allocation, which is (probably) helpful for hwaccel,
but (probably) less optimal for software surfaces.

mp_image_pool_get_no_alloc() is specifically for VAAPI, which can't
allocate new decoder surfaces after decoder init.
2014-03-17 18:21:29 +01:00
wm4 6389507314 vdpau: remove legacy pixel formats
They were used by ancient libavcodec versions. This also removes the
need to distinguish vdpau image formats at all (since there is only
one), and some code can be simplified.
2014-03-17 18:21:11 +01:00
wm4 4e70335c2f vdpau: remove unused type 2014-03-17 18:20:44 +01:00
wm4 5ed24862c0 video: change image format from unsigned int to int in some places
Image formats used to be FourCCs, so unsigned int was better. But now
it's annoying and the only difference is that unsigned int is more to
type than int.
2014-03-17 18:19:57 +01:00
wm4 6aa2d1f120 img_format: AV_PIX_FMT_FLAG_ALPHA is always available
We no more support ancient libavutil versions.
2014-03-17 18:19:28 +01:00
wm4 8fbf0300d8 vd_lavc: reinit hwdec on profile changes
Needed in theory. I don't know if there are even any real-world files
which change the profile mid-stream.
2014-03-17 18:19:03 +01:00
wm4 3db3653227 video: fix FFmpeg or Libav being a special snowflake 2014-03-16 16:23:12 +01:00
wm4 2963d84a9b vd_lavc: remove unused field 2014-03-16 15:05:46 +01:00
wm4 269c1e1f41 vd_lavc: reduce hardware decoder mid-stream reinitializations
Instead of doing it on every seek (libavcodec calls get_format on every
seek), reinitialize the decoder only if the video resolution changes.

Note that this may be relatively naive, since we e.g. (or: in
particular) don't check for profile changes. But it's not worse than the
state before the get_format change, and at least it paints over the
current vaapi breakage (issue #646).
2014-03-16 14:54:21 +01:00
wm4 61f3b188a5 manpage: remove author field
There's already a more detailed "AUTHORS" section.

Closes #647.
2014-03-16 13:20:30 +01:00
wm4 113ec0aba1 af_lavcac3enc: use new AVFrame API 2014-03-16 13:19:29 +01:00
wm4 05e3a5a2b4 ao_lavc: set AVFrame.format
Seems kind of wrong that this wasn't done, although it didn't have any
bad consequences.
2014-03-16 13:19:29 +01:00
wm4 62c88a52c4 encode: use new AVFrame API 2014-03-16 13:19:29 +01:00
wm4 62ab6a91bd image_writer: use new AVFrame API 2014-03-16 13:19:29 +01:00
wm4 f2374f4e4b ad_lavc: use new AVFrame API
Set refcounted_frames, because in some versions of libavcodec mixing the
new AVFrame API and non-refcounted decoding could cause memory
corruption. Likewise, it's probably still required to unref a frame
before calling the decoder.
2014-03-16 13:19:29 +01:00
wm4 8e6bd496ca vf_delogo: remove internal implementation
See previous commit.
2014-03-16 13:19:29 +01:00
wm4 48e32e13fe vf_hqdn3d: remove internal implementation
See previous commit.
2014-03-16 13:19:29 +01:00
wm4 2520249b16 vf_yadif: remove internal implementation
See previous commit.
2014-03-16 13:19:29 +01:00
wm4 04a74ea3e2 vf_unsharp: remove internal implementation
See previous commit.
2014-03-16 13:19:29 +01:00
wm4 b2ec5c4b66 vf_gradfun: remove internal implementation
This follows the (only slowly progressing) plan to replace all internal
video filters with libavfilter.

All what's left in vf_gradfun.c is the weird wrapper around vf_lavfi.c.
2014-03-16 13:19:29 +01:00
wm4 98cd2c4122 build: simplify libavfilter configure checks
This is all not needed anymore. In particular, remove all configure
switches except --enable-libavfilter.
2014-03-16 13:19:29 +01:00
wm4 c9d328319e demux: use av_packet_ref()
av_copy_packet() was FFmpeg specific, av_packet_ref() is now available
on all supported libavcodec releases.
2014-03-16 13:19:28 +01:00
wm4 64c01a814c Remove some more unneeded version checks
All of these check against things that happened before the latest
supported FFmpeg/Libav release.
2014-03-16 13:19:28 +01:00
wm4 5506c8d0f6 ad_lavc: remove deprecated downmixing by channel count
Downmixing by channel layout now hopefully works with all supported
libavcodec versions.
2014-03-16 13:19:28 +01:00
wm4 822e040ddb ao_dsound: remove duplicated code 2014-03-16 13:19:28 +01:00
wm4 c7e620df96 af_lavrresample: remove avresample_set_channel_mapping() fallbacks
This function is now always available.

Also remove includes of reorder_ch.h from some AOs (these are just old
relicts).
2014-03-16 13:19:28 +01:00
wm4 bb0290145a sub: remove old MPlayer DVD sub decoder
The DVD sub decoder in Libav 9 was broken/incomplete, so we kept the
MPlayer decoder around. Now it's not needed anymore.
2014-03-16 13:19:28 +01:00
wm4 3ec7f528c4 vd_lavc: remove compatibility crap
All this code was needed for compatibility with very old libavcodec
versions only (such as Libav 9).

Includes some now-possible simplifications too.
2014-03-16 13:19:19 +01:00
wm4 75b185dfc5 travis-ci: update ffmpeg stable tarball 2014-03-16 02:57:41 +01:00
wm4 f50455507e build: drop support for Libav 9
I have no tolerance for this garbage anymore. There are tons of issues
with it (see e.g. previous commit), and there is no reason to use it
either. Use Libav git, or Libav 10 when it's released.

This also drops support for earlier FFmpeg release, which have exactly
the same issues as Libav 9. FFmpeg 2.1.4 is still supported, because
it's the latest release, and is reasonably recent. (Although this will
probably also be dropped as soon as FFmpeg 2.2 is released.)

Assumed version table (lots of nonsensical numbers):

        FFmpeg 2.1.4    FFmpeg (n2.2-rc2)   Libav (v10_beta2)

lavu    52.48.101       52.66.100           53.3.0
lavc    55.39.101       55.52.102           55.34.1
lavf    55.19.104       55.33.100           55.12.0
lsws    2.5.101         2.5.101             2.1.2
lavi    3.90.100        4.2.100             4.2.0
lswr    0.17.104        0.18.100            -
lavr    1.1.0           1.2.0               1.1.0

libpostproc and libavdevice are not interesting.

Following this commit, code needed just to support old Libav versions
will start to be removed.
2014-03-16 02:45:58 +01:00
wm4 ba160f5c84 vd_lavc: ridiculous workaround for Libav 9 compatibility
This "sometimes" crashed when seeking. The fault apparently lies in
libavcodec: the decoder returns an unreferenced frame! This is
completely insane, but somehow I'm apparently still expected to
work this around. As a reaction, I will drop Libav 9 support in the
next commit. (While this commit will go into release/0.3.)
2014-03-16 01:38:13 +01:00
wm4 86689f7bf2 demux_libass: change how external ASS subtitles are loaded
Instead of parsing the ASS file in demux_libass.c and trying to pass the
ASS_Track to the subtitle renderer, just read all file data in
demux_libass.c, and let the subtitle renderer pass the file contents to
ass_process_codec_private(). (This happens to parse full files too.)

Makes the code simpler, though it also relies harder on the (messy)
probe logic in demux_libass.c.
2014-03-15 22:17:51 +01:00
wm4 f6b4f60264 command: rename dvd- properties to disc-
Since these are not DVD-only, but can also be used with BDs.
2014-03-15 20:53:59 +01:00
wm4 e09a8ec4fa DOCS/coding-style: add another requirement for commit messages 2014-03-15 18:44:32 +01:00
wm4 5dde276018 options: fix off-by-1 error in option help output 2014-03-15 18:42:10 +01:00
wm4 8a75b19cd4 command: prefix DVD title properties with "dvd-"
They're strictly DVD-only, so it's better to mark them as such. This
also documentes the "title" (now renamed to "dvd-title") property.

This also avoids collision with the --title option. (Technically, there
was no problem. But it might be confusing for users, since we have a
policy of naming properties and options the same if they refer to the
same underlying functionality.)
2014-03-15 18:42:10 +01:00
xylosper 746666f096 command: add new property 'title'
This commit adds new property 'title' which indicates current
playing title of disc. This property is useful when using a stream
whose title can be changed during playback, e.g., dvdnav.
2014-03-15 18:42:10 +01:00
xylosper 9e4014d876 stream_dvdnav: implement STREAM_CTRL_GET_NUM_TITLES for dvdnav
This commit provides impelmentation of STREAM_CTRL_GET_NUM_TITLES
for dvdnav stream. Other streams for DVD or Blu-ray are already
provide STREAM_CTRL_GET_NUM_TITLES.
2014-03-15 18:42:07 +01:00
wm4 16596d025a ao: print (estimated) device buffer size on init in verbose mode 2014-03-14 22:37:46 +01:00
wm4 c473635f66 af_volume: don't print missing replaygain tags as error
There's no reason to. Audio files often lack them.
2014-03-14 22:37:46 +01:00
wm4 dc0f2308d1 af_volume: add detach option
Maybe this should be default. On the other hand, this filter does
something even if the volume is neutral: it clips samples against the
allowed range, should the decoder or a previous filter output garbage.
2014-03-14 22:37:46 +01:00
wm4 b72ba3f744 af_volume: separate softvol volume control from replaygain level
Currently, both replaygain adjustment and user volume control (if
softvol is enabled) share the same variable. Sharing the variable would
cause especially if --volume is used; then the replaygain volume would
always be overwritten.

Now both gain values are simple added right before doing filtering.
2014-03-14 22:37:46 +01:00
wm4 66bfb17979 manpage: af: minor syntax improvements 2014-03-14 22:37:45 +01:00
wm4 f8f69cdffe af_volume: remove double-negated suboption
You had to use "no-replaygain-noclip" to set this option. Rename it, so
that only one negation is needed.
2014-03-14 22:37:45 +01:00