0
0
mirror of https://github.com/mpv-player/mpv.git synced 2024-09-20 12:02:23 +02:00
Commit Graph

43113 Commits

Author SHA1 Message Date
wm4
d04aa5ef4e mp_image: add mp_image_to_av_frame()
What mp_image_to_av_frame_and_unref() should have been. (The _unref
variant is still useful though.)
2016-04-15 15:33:53 +02:00
wm4
e6cdfdfa74 mp_image: simplify mp_image_steal_data()
Why was this so complex.
2016-04-15 15:31:23 +02:00
wm4
bbaedfd0c5 mp_image: pass through AVHWFramesContext
In both directions.
2016-04-15 15:07:02 +02:00
wm4
607ba5f235 ao_coreaudio_exclusive: list formats when searching substream
Should help debug problems with AC3 passthrough not working.
2016-04-15 14:19:22 +02:00
wm4
1aa943d8ab ao_coreaudio: remove unused function 2016-04-15 14:14:42 +02:00
wm4
b735c0e207 lcms: include math.h
Fixes #3053.
2016-04-15 13:58:41 +02:00
wm4
fbb5da0010 command: log property set calls
And remove the same thing from the client API code.

The command.c code has to deal with many specialized M_PROPERTY_SET_*
actions, and we bother with a subset only.
2016-04-15 13:20:05 +02:00
wm4
177f5d9e9c command: allow setting panscan etc. properties if no video is active
In that case, it merely changes the underlying option value.
2016-04-15 11:32:40 +02:00
wm4
a9bd4535d2 client API: improve mpv_set_property() handling of MPV_FORMAT_NODE
If a mpv_node wrapped a string, the behavior was different from calling
mpv_set_property() with MPV_FORMAT_STRING directly. Change this.

The original intention was to be strict about types if MPV_FORMAT_NODE
is used. But I think the result was less than ideal, and the same change
towards less strict behavior was made to mpv_set_option() ages ago.
2016-04-15 11:32:40 +02:00
wm4
8c02c92ab9 vo_opengl: rpi: don't include x11 header file
Copy & paste bug.
2016-04-15 09:45:15 +02:00
wm4
4ebac1e936 player: fix use-after-free with --screenshot-directory
Probably fixes #3049.
2016-04-14 22:48:12 +02:00
wm4
e13cc25a2c build: add check for AVHWFramesContext API
It's not used yet anywhere. Pushing this now so switching between
branches is less bothersome.
2016-04-14 18:20:13 +02:00
wm4
0467f5287d m_option: slightly improve --msg-level=help output
In particular get rid of the semi-deprecated ":" separator.
2016-04-13 22:25:51 +02:00
wm4
9a4120f21f m_option: add string conversion for --audio-channels
Requested in #3040.
2016-04-13 22:22:53 +02:00
Niklas Haas
e3e03d0f34 vo_opengl: simplify and improve up scale=oversample
Since what we're doing is a linear blend of the four colors, we can just
do it for free by using GPU sampling.

This requires significantly fewer texture fetches and calculations to
compute the final color, making it much more efficient. The code is also
much shorter and simpler.
2016-04-12 16:26:53 +02:00
wm4
f4142ab9ad demux_mkv: fix seeking with files that miss the first index entry
Now it will always be able to seek back to the start, even if the index
is sparse or misses the first entry.

This can be achieved by reusing the logic for incremental index
generation (for files with no index), and start time probing (for making
sure the first block is always indexed).
2016-04-12 15:41:44 +02:00
wm4
837b865c7f vf_vavpp: reindent 2016-04-11 22:03:26 +02:00
wm4
f5ff2656e0 vaapi: determine surface format in decoder, not in renderer
Until now, we have made the assumption that a driver will use only 1
hardware surface format. the format is dictated by the driver (you
don't create surfaces with a specific format - you just pass a
rt_format and get a surface that will be in a specific driver-chosen
format).

In particular, the renderer created a dummy surface to probe the format,
and hoped the decoder would produce the same format. Due to a driver
bug this required a workaround to actually get the same format as the
driver did.

Change this so that the format is determined in the decoder. The format
is then passed down as hw_subfmt, which allows the renderer to configure
itself with the correct format. If the hardware surface changes its
format midstream, the renderer can be reconfigured using the normal
mechanisms.

This calls va_surface_init_subformat() each time after the decoder
returns a surface. Since libavcodec/AVFrame has no concept of sub-
formats, this is unavoidable. It creates and destroys a derived
VAImage, but this shouldn't have any bad performance effects (at
least I didn't notice any measurable effects).

Note that vaDeriveImage() failures are silently ignored as some
drivers (the vdpau wrapper) support neither vaDeriveImage, nor EGL
interop. In addition, we still probe whether we can map an image
in the EGL interop code. This is important as it's the only way
to determine whether EGL interop is supported at all. With respect
to the driver bug mentioned above, it doesn't matter which format
the test surface has.

In vf_vavpp, also remove the rt_format guessing business. I think the
existing logic was a bit meaningless anyway. It's not even a given
that vavpp produces the same rt_format for output.
2016-04-11 22:03:26 +02:00
Rudolf Polzer
49431626cb Revert "build: disable encoding mode by default"
Reverting because the use of deprecated API has been fixed.

This reverts commit d0238711dc.
2016-04-11 14:59:33 -04:00
Rudolf Polzer
160497b8ff encode_lavc: Migrate to codecpar API. 2016-04-11 14:57:20 -04:00
Niklas Haas
b968d779af aspect: rework --video-unscaled
In the past, --video-unscaled also disabled zooming and aspect ratio
corrections. But this didn't make much sense in terms of being a useful
option. The new behavior just sets the initial video size to be
unscaled, but it's still affected by zoom commands and aspect ratio
corrections.

To get the old behavior back, --video-aspect=0 --video-zoom=0 need to be
added as well (in the general case). Most of the time it should not make
a difference though.

Also, there seems to have been some additional dst_rect clamping code
inside src_dst_split_scaling that didn't seem to either be necessary nor
ever get triggered. (The code immediately above it already makes sure to
crop the video if it's larger than the dst_rect)

No idea why it was there, but I just removed it.
2016-04-10 18:29:20 +02:00
wm4
b18bfd0352 aspect: remove useless debug messages
Never needed them. This makes the code slightly more readable.
2016-04-10 16:29:33 +02:00
wm4
87cb2339a6 vo_opengl: improve rotation handling (again)
Apply basic transformations like rotation by 90° and mirroring when
sampling from the source textures. The original idea was making this
part of img_tex.transform, but this didn't work: lots of code plays
tricks on the transform, so manipulating it is not necessarily
transparent, especially when width/height are switched. So add a new
pre_transform field, which is strictly applied before the normal
transform.

This fixes most glitches involved with rotating the image.

Cropping and rotation are now weirdly separated, even though they could
be done in the same step. I think this is not much of a problem, and
has the advantage that changing panscan does not trigger FBO
reallocations (I think...).
2016-04-08 22:21:38 +02:00
Philip Sequeira
a2db0105ab TOOLS/zsh.pl: properly escape last change
I'm an idiot.

Fixes #3032.
2016-04-08 19:48:12 +02:00
wm4
89571312bf command: add keepaspect property
Just a bridge to the option.

(Did I ever mention that I hate the property/option separation.)
2016-04-08 15:08:23 +02:00
st4t1k
5f4b246bcc osd: add italic font for osd 2016-04-08 10:58:06 +02:00
Philip Sequeira
4561649f2d TOOLS/zsh.pl: don't complete URLs by default
...unless no files match. Fixes #2892.

To get the old behaviour back, use something like:
zstyle ':completion:*:*:mpv:*' tag-order
2016-04-08 10:57:54 +02:00
wm4
6325bdf197 vo_opengl: log if glGetString(GL_VERSION) returns NULL
Typically happens with some implementations if no context is currrent,
or is otherwise broken. This is particularly relevant to the opengl_cb
API, because the API user will have no other indication what went wrong.
2016-04-08 10:57:21 +02:00
wm4
813372d6e9 d3d: fix Windows build
Commit f009d16f accidentally broke it.

Thanks to RiCON for noticing and testing.
2016-04-07 21:04:31 +02:00
wm4
0812719497 vo_opengl: videotoolbox: use kCVPixelBufferLock_ReadOnly for screenshots
Why not.
2016-04-07 19:55:51 +02:00
wm4
f033481551 videotoolbox: change how videotoolbox format is managed
The underlying intention of this code is to make changing
--videotoolbox-format at runtime work. For this reason, the format can't
just be statically setup, but must be read from the option at runtime.

This means the format is not fixed anymore, and we have to make sure the
renderer is property reinitialized if the format changes. There is
currently no way to trigger reinit on this level, which is why the
mp_image_params.hw_subfmt field was introduced.

One sketchy thing remains: normally, the renderer is supposed to be
involved with VO format negotiation, which would ensure that the VO
can take the format at all. Since the hw_subfmt is not part of this
format negotiation, it's implied the get_vt_fmt() callback only
returns formats supported by the renderer. This is not necessarily
clear because vo_opengl checks this with converted_imgfmt separately.
None of this matters in practice though, because we know all formats
are always supported.

(This still requires somehow triggering decoder reinit to make the
change effective.)
2016-04-07 19:54:58 +02:00
wm4
f34d086cb9 mp_image: introduce a hw_subfmt field
For hwaccel formats, mp_image will merely point to a hardware surface
handle. In these cases, the mp_image_params.imgfmt field describes the
format insufficiently, because it mostly only describes the type of the
hardware format, not its underlying format.

Introduce hw_subfmt to describe the underlying format. It makes sense to
use it with most hwaccels, though for now it will be used with the
following commit only.
2016-04-07 18:47:32 +02:00
wm4
8a67606c20 vd_lavc: let hardware decoder request delaying frames explicitly
Until now, the presence of the process_image() callback was used to set
a delay queue with a hardcoded size. Change this to a vd_lavc_hwdec
field instead, so the decoder can explicitly set this if it's really
needed.

Do this so process_image() can be used in the VideoToolbox glue code for
something entirely unrelated.
2016-04-07 18:47:32 +02:00
wm4
f009d16f36 vd_lavc: fix codec vs. decoder confusion
Some functions which expected a codec name (i.e. the name of the video
format itself) were passed a decoder name. Most "native" libavcodec
decoders have the same name as the codec, so this was never an issue.

This should mean that e.g. using "--vd=lavc:h264_mmal --hwdec=mmal"
should now actually enable native surface mode (instead of doing copy-
back).
2016-04-07 17:48:00 +02:00
wm4
32a92071b4 vo: don't reset vsync statistics on seeks etc.
The sync-by-display mode relies on using the vsync statistics for
timing. As a consequence discontinuities must be handled somehow. Until
now we have done this by completely resetting these statistics.

This can be somewhat annoying, especially if the GL driver's vsync
timing is not ideal. So after e.g. a seek it could take a second until
it locked back to the proper values.

Change it not to reset all statistics. Some state obviously has to be
reset, because it's a discontinuity. To make it worse, the driver's
vsync behavior will also change on such discontinuities. To compensate,
we discard the timings for the first 2 vsyncs after each discontinuity
(via num_successive_vsyncs). This is probably not fully ideal, and
num_total_vsync_samples handling in particular becomes a bit
questionable.
2016-04-06 22:56:12 +02:00
wm4
a606b92f4a sub: interpret "text" subtitles as srt
Most players will interpret HTML-style tags (aka srt) in almost any kind
of text subtitles; make mpv do this too.
2016-04-06 12:36:13 +02:00
wm4
796b32c4d7 vo_opengl: fix build breakage 2016-04-06 01:21:16 +02:00
wm4
7a5312e9a6 vo_opengl: minor simplification
It's the same functionally.
2016-04-05 20:58:22 +02:00
wm4
afd685490d vo_opengl: fix nnedi + rectangle textures
Shader compilation error due to incompatible samplers.
2016-04-05 20:57:02 +02:00
wm4
da3489353b cache: disable useless "Cache is not responding" warning
Tuning it in a way to be actually useful is too much effort.

As alternative, there's the "buffering" detection, which operates on a
much higher level. The only disadvantage is that it's harder to guess
for the user whether this is a network problem, or if e.g. libavformat
is probing too much data when opening a stream. Maybe the cache-speed
property is helpful here.

For now, do not remove the associated code, but just silence the
warning.

Fixes #3019.
2016-04-03 19:45:09 +02:00
wm4
2720e60ad0 x11: do not set _NET_WM_BYPASS_COMPOSITOR by default
It's pretty "unfriendly" and causes too many issues. (Probably. At least
they're more obvious to a user than e.g. broken frame timing.)

Potentially we could apply heuristics like applying this only on
fullscreen, but let's not. It's up to the user to configure this to
get best results.

Fixes #2997.
2016-04-03 19:42:07 +02:00
Niklas Haas
c0e13d54a8 aspect: make video-zoom logarithmic
The past behavior was a bit weird, especially when zooming out. There
was no simple way to zoom in or out in consistent increments using
keybindings alone.

The new behavior preserves most of the old behavior's semantics but
scales out to infinity better. It coincidentally also makes it
really easy to get clean power of 2 ratios (e.g. 2x, 4x, 8x and their
inverses).

Fixes #3004.
2016-04-03 14:51:31 +02:00
Kevin Mitchell
669a3228a2 manpage: change underscore to hyphen in input command
fixes #3018
2016-04-03 04:10:23 -07:00
Kevin Mitchell
d8ba84134f manpage: fix typo 2016-04-02 20:15:56 -07:00
wm4
e5af1d9061 manpage: add example for --msg-level
I guess the syntax is not necessarily very obvious.
2016-04-02 20:57:20 +02:00
wm4
67888a41e7 build: make DVB test stricter
I got a report that the build on a recent aarch64 Linux kernel failed.
DVB support was detected, but errored on compilation:

In file included from ../stream/stream_dvb.c:57:0:

../stream/dvbin.h:72:5: error: unknown type name 'fe_bandwidth_t'

     fe_bandwidth_t bw;

Make the test stricter, which should take care of this. (I couldn't find
out what exactly triggered the failure, nor could I attempt to reproduce
it.)

The change in stream/dvbin.h is to make sure that this isn't caused by
incorrect header inclusion. It now includes the same files as the
configure test.
2016-04-02 20:51:39 +02:00
wm4
aec928d753 build: fix AVCodecParameters FFmpeg API check (again)
Commit 0d746522 was complete non-sense. The description and the code
mention the wrong struct.

This time I actually tested it.
2016-04-02 18:45:09 +02:00
wm4
7089175d8d sd_lavc: use decoder-reordered PTS for PGS
There is an obscure feature which requires essentially reordering PTS
from different packets.

Unfortunately, libavcodec introduced a ridiculously shitty API for
this, which works very much unlike the audio/video API. Instead of
simply passing through the PTS, it wants to fuck with it for no reason,
and even worse, fucks with other fields and changes their semantivcs
(??????). This affects AVSubtitle.end_display_time. This probably will
cause issues for us, and I have no desire to find out whether it will.
Since only PGS requires this, and it happens not to use
end_display_time, do it for PGS only.

Fixes #3016.
2016-04-02 17:41:12 +02:00
wm4
eb740673b8 sd_lavc: add a comment about duration==0 handling
Basically, this information is useless, because some muxers (hurr
libavformat) write bogus information anyway. This means if we e.g. see
PGS packets in mkv with duration explicitly set to 0, we must not trust
that value anyway. (The FFmpeg API problem is leaking into files, how
nice.)
2016-04-02 17:35:42 +02:00
wm4
a54f6717c2 sd_lavc: fix subtitle display with unknown end timestamps
This is a theoretical issue, because subtitle end timestamps for all but
the current subtitle are always known.
2016-04-02 17:32:05 +02:00