1
mirror of https://github.com/mpv-player/mpv synced 2024-11-03 03:19:24 +01:00
Commit Graph

44499 Commits

Author SHA1 Message Date
wm4
55834d70e6 travis: disable OSX
Travis being a POS again.

Why does the travis config even have tol be part of the source code
repo? This makes no sense.
2017-02-18 13:21:34 +01:00
Aman Gupta
4d33b622ce lavc_conv: pass pkt_timebase to ffmpeg
Similar to code used everywhere else we create a lavc context.
2017-02-18 12:53:11 +01:00
wm4
48f601ae9e manpage: discourage vo_vaapi further
I don't know what's this comment about hardware decoding. Possibly it
was written before vo_opengl had vaapi decoding support.
2017-02-17 21:01:59 +01:00
Aman Gupta
53fab20c6d vo_opengl: implement videotoolbox hwdec on iOS
Implements --hwdec=videotoolbox on iOS. Similar to hwdec_osx.c, but
using CVPixelBuffer APIs available on iOS instead of the equivalent
IOSurface APIs in macOS.
2017-02-17 11:43:24 -08:00
wm4
f02752c0d5 vo_opengl: don't crash on unsupported formats
Regression from recent refactor.
2017-02-17 19:48:29 +01:00
wm4
b3488822fd build: update waf
Seems like it has been long enough since we last updated.
2017-02-17 18:54:21 +01:00
wm4
d8bf000d29 vo_opengl: hwdec_vaegl: use new format setup function
Plus add a helper.
2017-02-17 17:26:01 +01:00
wm4
e59e917e71 vo_opengl: hwdec_osx: use new format setup function
We can drop the custom table.

For some reason, the interop does not accept GL_RGB_RAW_422_APPLE as
internal format for GL_RGB_422_APPLE, so switch the format table to use
GL_RGB (this way both interop and real textures work the same).

Another victim of the apparent requirement of exactly matching texture
formats is kCVPixelFormatType_32BGRA. vo_opengl wants to handle this as
normal RGBA texture, with a swizzle applied in the shader.
CGLTexImageIOSurface2D() rejects this, because it wants the exact
internal format. Just drop the format, because it's useless anyway.

(Maybe this is a bit too fragile...)
2017-02-17 17:08:37 +01:00
wm4
91a2ddfdd7 vo_opengl: hwdec_cuda: use new format setup function
Gives us automatically support for all formats vo_opengl supports.
2017-02-17 16:39:10 +01:00
wm4
eda69f5333 vo_opengl: move texture mapping of pixel formats to helper function
All supported pixel formats have a specific "mapping" of CPU data to
textures. This function determines the number and the formats of these
textures. Moving it to a helper will be useful for some hardware decode
interop backends, since they all need similar things.
2017-02-17 16:28:31 +01:00
wm4
9c54b224d8 vo_opengl: handle GL_LUMINANCE_ALPHA and integer textures differently
GL_LUMINANCE_ALPHA is the only reason why per-plane swizzles exist.
Remove per-plane swizzles (again), and regrettably handle them as
special cases (again). Carry along the logical texture format (called
gl_format in some parts of the code, including the new one).

We also don't need a use_integer flag, since the new gl_format member
implies whether it's an integer texture. (Yes, the there are separate
logical GL formats for integer textures. This aspect of the OpenGL API
is hysteric at best.)

This should change nothing about actual rendering logic and GL API
usage.
2017-02-17 16:28:31 +01:00
wm4
b5eb326dcb videotoolbox: fix RGB format
Wrong colors. This didn't matter for the OpenGL interop code, because
the CV format was mapped to the correct texture format.
2017-02-17 14:14:58 +01:00
wm4
2b5577901d videotoolbox: remove weird format-negotiation between VO and decoder
Originally, there was probably some sort of intention to restrict it to
formats supported by the interop, or something. But in the end it was
overcomplicated nonsense.

In the future, we could use mp_hwdec_ctx.supported_formats or other
mechanisms to handle this in a better way.

mp_hwdec_ctx.ctx is not set to a dummy pointer - hwdec_devices_load() is
only used to detect whether to vo_opengl interop is present, and the
common hwdec code expects that the .ctx field is not NULL.

This also changes videotoolbox-copy to use --videotoolbox-format,
instead of the FFmpeg-set default.
2017-02-17 14:14:22 +01:00
wm4
b5bbcc9f93 videotoolbox: add reverse format mapping function
Introduce mp_imgfmt_to_cvpixelformat(), and change the existing
mp_imgfmt_from_cvpixelformat() to a table to avoid duplication.
2017-02-17 13:51:03 +01:00
wm4
1e4fd996bb videotoolbox: factor some duplicated code
The code for copying a videotoolbox surface to mp_image was duplicated
(with some minor differences - I picked the hw_videotoolbox.c version,
because it was "better"). mp_imgfmt_from_cvpixelformat() is somewhat
duplicated with the vt_formats[] table, but this will be fixed in a
later commit, and moving the function to shared code is preparation.
2017-02-17 13:32:27 +01:00
wm4
e8137ee881 manpage: remove stale --volume-restore-data entry
The option was removed a while ago.
2017-02-17 12:08:12 +01:00
Akemi
9ac05a575c cocoa: refactor mouse events and cursor visibility
we reported some unnecessary mouse movements and not all mouse enter
and leave events. that lead to wrongly reported activity on hover areas
like on the OSC or comparable lua scripts. sometimes menu items were
shown that shouldn't be shown or they didn't vanish because of the
missing mouse leave event.

this incorporates @torque's fix for mouse leave events that weren't
triggered during a transition, like going to fullscreen. the
tracking area was updated but the mouse never left that area because
it was never over it.

besides some known cursor visibility bugs the aforementioned changes
also revealed some other bugs that weren't reproducible before because
of the missbehavior.
known issues, in some cases the cursor doesn't show or hide properly.
for example when switching spaces, switching Apps via CMD+Tab or a
system notification. former two could be fixed while keeping our current
blank cursor approach. though the notification case couldn't. there is
no event or similar to detect a notification and the cursor visibility
couldn't be recovered in any way.

new issues, i noticed that our event view isn't initialised yet when the
first VOCTRL_SET_CURSOR_VISIBILITY event gets dispatched, which depends
on the event view to be initialised. so the mouse cursor couldn't be
hidden when mpv was opened and the cursor was within the window bounds.
this wasn't noticeable before because of various bugs and unwanted
behavior that have been fixed with this. now, in case the event view
isn't ready yet, we set the visibility at a later point when the event
view is ready and a helper flag is set.

Fixes #1817 #3856 #4147
2017-02-16 22:22:11 +01:00
Akemi
a5b97104cf osx: improve bundle handling
we have two problems here. first when mpv is started from the bundle it
uses its own environment variables and possibly can't find for example
the youtube-dl binary for our youtube-dl hook. second we couldn't
reliable determine when mpv was started from the bundle, which led to
the pseudo-gui usage even when the binary was invoked from a shell.

to prevent this we will wrap the bundle binary with a shell script,
which will only be called when we start mpv from the bundle. this way
we can get the same environment variables, like $PATH, for our bundle
and additional we can set the pseudo-gui only when started through this
script. it is also possible to detect the bundle usage properly and
accurately through the usage of another environment var.

Fixes #2061
2017-02-16 22:21:03 +01:00
wm4
fdd1ef6028 vd_lavc: fix inverted error check
Dumb.
2017-02-16 17:00:37 +01:00
wm4
807147d9c0 vd_lavc: move most vaapi hwaccel setup code to generic code
Now hw_vaapi.c contains only the device setup, which could probably also
be abstracted.
2017-02-16 17:00:20 +01:00
wm4
b949f2cee6 vd_lavc: remove some leftover vaapi locking infrastructure 2017-02-16 17:00:20 +01:00
Akemi
05eb42f6e1 cocoa: gracefully quit from the Dock's context menu
quitting mpv from the Dock's context menu leaves the shell in a bad
state where you can't see your input any more and other weirdnesses.

in a big refactor (afdc9c4) the method to handle this case was actually
copied over but the the code to register the event itself was removed or
forgotten by accident, leaving some lines of dead code. i re-added the
event and slightly adjusted the function. the function was slightly
changed so the head of it is consistent with our other events and it is
associated with this commit and functionality in the future.
2017-02-16 16:36:34 +01:00
wm4
b304d89e36 Copyright: list specific exceptions to stated rules
The "Files without Copyright notice are licensed as LGPLv2.1+."
statement makes it sound like the manpage and some other stuff are LGPL.
But the rule actually affects only some source files that were added in
mpv.

Change the wording, and also explicitly list the licenses for some non
source files. There might be more such cases.
2017-02-16 11:43:02 +01:00
Pedro Pombeiro
ea297c53c7 DOCS/waf-buildsystem.rst: fix typo
Signed-off-by: wm4 <wm4@nowhere>
2017-02-15 10:41:26 +01:00
wm4
05f63edc7b Revert "dvb: add support for DVB-T2"
This reverts commit df91e492fd.

Multiple issues such as weird code with undefined behavior (like
(like conf_file*). The PR wasn't properly reviewed anyway (my error),
so this commit should be reviewed and then merged again.
2017-02-14 13:31:06 +01:00
wm4
3e474f4654 vo_opengl: hwdec_vaegl: fix potentially undefined memory access 2017-02-14 13:30:48 +01:00
Akemi
9a45932984 cocoa: fix black edges on live resize
this fixes a small bug with black edges on live resize, due to the
synchronisation with the DisplayLink. we just pause the DisplayLink for
the duration of the live resize. i also added some convenience functions
for reoccurring calls and simplified some DisplayLink related screen
info.
2017-02-13 22:52:47 +01:00
Akemi
64b0d81c32 cocoa: add --ontop-level option for modifying ontop window level
since there are different views on what ontop is, we make the ontop
window level modifiable. at the moment only support for macOS was added.
the default for macOS was changed from 'system' to 'window' since this
fixes an unwanted behaviour in fullscreen and in general causes less
issues with expected behaviour.

Fixes #2376 #3974
2017-02-13 22:49:11 +01:00
wm4
34b7d52317 lavfi: fix minor memory leak
The AVFrame in the tmp_frame field was never actually deallocated.

Since this AVFrame holds data temporarily only, and is unreferenced
immediately after use, there is actually no need to make it per-pad, so
simplify it a bit.

(There's also no real value in caching this tmp_frame at all, but I
guess it makes the control flow slightly simpler.)
2017-02-13 13:12:29 +01:00
wm4
a779ce6eac mp_image: use AVFrame.opaque_ref to pass through mpv-only fields
We can do this now, which means we can pass a mp_image through
libavfilter without loss. Currently, this affects relatively obscure
fields only.
2017-02-13 13:12:29 +01:00
scootergrisen
27cc06e39c mpv.desktop: add translation for [da] 2017-02-13 11:18:08 +01:00
ivan-83
df91e492fd dvb: add support for DVB-T2
Probably does much more:

+ add support DVB-T2
* DVB params set to AUTO by default
* MAX_CARDS: 4 -> 16
* DMX_SET_BUFFER_SIZE: 64kb -> 256kb
+ add DTV_CLEAR call before tune
+ add logic from https://github.com/olifre/mpv/commits/dvb-mixed-api-scan
* rename type to delsys
* single playlist per adapter
* card -> adapter
* fix channels order in playlist
* update internal api
* auto fallback to old DVB API on tune
* fix DELSYS_SUPP_MASK value
* remove tone - unused
* add channel mem zeroize in config parser
+ add code from libdvbv5 for detect delivery systems
* SYS_DVBC_ANNEX_AC replaced to SYS_DVBC_ANNEX_A + SYS_DVBC_ANNEX_C

Signed-off-by: wm4 <wm4@nowhere>
2017-02-13 11:17:51 +01:00
Michael Forney
212f6c8206 Fix build with HAVE_GL==0
video/out/opengl/hwdec.h includes video/out/opengl/common.h, which tries
to include opengl headers.
2017-02-13 11:16:20 +01:00
wm4
81efe20cd7 atomic: remove __atomic builtin usage
Using these was a temporary solution while some compilers implemented
the underlying atomic mechanisms, but not the C11 language parts (or
that's what I guess). Not really useful for us anymore. Also, there is
the slight risk of having subtly incorrect semantics by using
potentially changing compiler internals and such.
2017-02-13 06:45:40 +01:00
pavelxdd
3739d1318f win32: update the fullscreen state on restoring
If a maximized window restored from fullscreen,
the fullscreen state needs to be updated manually.
2017-02-12 02:49:25 +11:00
wm4
8432514c5f DOCS/contribute.md: adjust coding style for if/else bracing 2017-02-11 16:48:29 +01:00
James Ross-Gowan
8bc335e3db vo_opengl: angle: log the device/surface implementation
This should be useful for debugging, since otherwise it's hard to tell
which implementation has been auto-detected or if any failed to init.
2017-02-12 02:40:49 +11:00
Ricardo Constantino
6ac3d77e90
ytdl_hook: support livestream segmented DASH VODs
Seen with a VOD of a recently ended livestream on Youtube.

They seem to use segmented DASH but unlike normal Youtube
segmented DASH, the segments don't seem to need the initialization
segment.

The video actually fails to start to play if the init segment is
prepended with a lot of 'Found duplicated MOOV Atom. Skipped it' errors
popping up.
2017-02-10 20:24:03 +00:00
wm4
d0f1d382e6 DOCS/mplayer-changes.rst: fix syntax
The missing newline made the github rst renderer (which is a POS) hide
the entire section.

Also, add some more warning text.
2017-02-10 15:27:45 +01:00
Thomas V
1672204dc5 dvb: move priv allocation to dvb_open
This fixes a crash when changing channels; previously stream->priv would not
be initialized when dvb_get_state reused the existing state.

Signed-off-by: Thomas VanSelus <tvanselus@diospyros.us>
2017-02-10 08:19:28 +01:00
wm4
f89ff14195 lavfi: cosmetics: more consistent variable naming 2017-02-09 11:33:04 +01:00
Kevin Mitchell
cc3eb531eb ao_oss: fix mixer channel message 2017-02-08 21:03:40 -08:00
Kevin Mitchell
f4d75376fe ao_oss: use --audio-device if --oss-device isn't set.
Fall back on PATH_DEV_DSP if nothing is set.

This mirrors the behaviour of --audio-device / --alsa-device.

There doesn't appear to be a general way to list devices with oss, so
--audio-device=help doesn't list oss devices except for the default one if the
file exists.

Previously --audio-device was ignored entirely by ao_oss.

fixes #4122
2017-02-08 21:03:40 -08:00
wm4
5085cf295f lavfi: slightly better disconnected output handling
If we have a disconnected output, read data only passively (and don't
cause input to be written). Otherwise, we're in danger of making
libavfilter queue too many frames on other outputs which are connected
to the same input, but don't read as quickly.

Also don't set pad->output_needed in this specific case, because it
would nonsensically make lavfi_process() return true, even if nothing is
going on.

This commit breaks if there is a simple filter chain with a connected
input, but a disconnected output, like

   --lavfi-complex='[aid1] copy [ao]'

and the audio output didn't initialize correctly. This will eventually
starve video as the audio packet queue get full (it will print a
warning, and then assume video EOF and exit).

But whatever.

Probably fixes #4118.
2017-02-08 20:29:38 +01:00
wang-bin
e285e22143 Use AV_INPUT_BUFFER_PADDING_SIZE instead of deprecated one
Signed-off-by: wm4 <wm4@nowhere>
2017-02-08 16:55:16 +01:00
wm4
c94ede9e62 manpage: fix incorrect option name for --record-file
Also the one in interface-changes.rst.

Fixes #4121.
2017-02-08 06:54:47 +01:00
wm4
6d236bd96e mp_image_tool: guard hw downloading against allocation failures
Small oversight, matters for OOM errors.
2017-02-07 17:06:20 +01:00
wm4
96a45a16af player: add experimental stream recording feature
This is basically a WIP, but it can't remain in a branch forever. A
warning is print when using it as it's still a bit "shaky".
2017-02-07 17:05:17 +01:00
James Ross-Gowan
061b752217 vo_opengl: egl_helpers: fix for non-Windows
Whoops. Fixes #4119
2017-02-08 01:27:17 +11:00
James Ross-Gowan
e0250b9604 vo_opengl: angle: rewrite with custom swap chain
This replaces the old backend that exclusively used EGL windowing with
one that can also use ANGLE's ability to render to directly to a
texture. The advantage of this is that it allows mpv to create the swap
chain itself and this allows mpv to use a flip-mode swap chain on a HWND
(which avoids problems with DirectComposition) and to use a longer swap
chain that has six backbuffers by default (which reportedly fixes
problems with rendering 24fps video on 24Hz monitors.)

Also, "screenshot window" should now work on DXGI 1.2 and up (Windows 8
and up.)
2017-02-07 22:45:07 +11:00