Commit Graph

46906 Commits

Author SHA1 Message Date
Anton Kindestam a776628d88 drm_common: Add option to toggle use of atomic modesetting
It is useful when debugging to be able to force atomic off, or as a
workaround if atomic breaks for some user. Legacy modesetting is less
likely to break by virtue of being a less complex API.
2019-05-04 14:17:11 +02:00
Philip Langdale 23a324215b vo/gpu: hwdec_cuda: Refactor gpu api specific code into separate files
The amount of code now present that's specific to Vulkan or OpenGL
has reached the point where we really want to split it out to
avoid a mess of #ifdefs.

At the same time, I'm moving the code to an api neutral location.
2019-05-03 18:02:18 +02:00
Anton Kindestam 738fda3677 context_drm_egl: Add support for presentation feedback
This implements presentation feedback for context_drm_egl using the
values that get fed to the page flip handler.
2019-05-03 18:01:56 +02:00
der richter 71ad1e2f4c cocoa-cb: remove all force unwrappings of optionals
the force unwrapping of optionals caused many unpredictable segfaults
instead of gracefully exiting or falling back. besides that, it is bad
practice and the code is a lot more stable now.
2019-04-25 23:02:19 +03:00
Jan Ekström edbc199914 vo_gpu/hwdec_cuda: fixup compilation with vulkan disabled
The actual code utilizing this enum was seemingly properly if'd,
but not the enum in the struct itself.

Fixes compilation.
2019-04-22 18:17:30 +03:00
Jan Ekström 9b8d3eff78 docs: add mentions of the Vulkan rendering abstraction replacement
From internal to libplacebo.
2019-04-22 15:58:10 +03:00
Philip Langdale 74831dd651 vo/gpu: hwdec_cuda: Reorganise backend-specific code
This tries to tidy up the GL vs Vulkan code to be a bit cleaner
and easier to read.
2019-04-21 23:55:22 +03:00
Philip Langdale 4005cda614 vo_gpu: hwdec_cuda: Implement interop for placebo
This change updates the vulkan interop code to work with the
libplacebo based ra_vk, but also introduces direct VkImage
sharing to avoid the use of the intermediate buffer.

It is also necessary and desirable to introduce explicit
semaphore bsed synchronisation for operations on the shared
images.

Synchronisation means we can safely reuse the same VkImage for every
mapped frame, by ensuring the frame is copied to the VkImage before
mapping the next frame.

This functionality requires a 417.xx or newer nvidia driver, due to
bugs in the VkImage interop in the earlier 411 and 415 drivers.

It's definitely worth the effort, as the raw throughput is about
twice that of implementation using an intermediate buffer.
2019-04-21 23:55:22 +03:00
Philip Langdale ffb8ffdd55 vo/gpu: ra_pl: Add helper to get pl_fmt from ra_format
When interacting directly with libplacebo, we may need to pass a
pl_fmt based on an ra_format. Although the mapping is currently
trivial, it's worth wrapping to make it easy to adapt if this
changes in the future.
2019-04-21 23:55:22 +03:00
Philip Langdale 4c133f3b45 vo_gpu: ra_pl: Add getter for pl_gpu
We need access to the underlying pl_gpu to make libplacebo calls
from hwdecs.
2019-04-21 23:55:22 +03:00
Philip Langdale b74b39dfb5 vo_gpu: vulkan: Add back context_win for libplacebo
Feature parity with the original ra_vk obviously requires win32 support,
so let's put it back in.
2019-04-21 23:55:22 +03:00
Niklas Haas 7006d6752d vo_gpu: vulkan: use libplacebo instead
This commit rips out the entire mpv vulkan implementation in favor of
exposing lightweight wrappers on top of libplacebo instead, which
provides much of the same except in a more up-to-date and polished form.

This (finally) unifies the code base between mpv and libplacebo, which
is something I've been hoping to do for a long time.

Note: The ra_pl wrappers are abstract enough from the actual libplacebo
device type that we can in theory re-use them for other devices like
d3d11 or even opengl in the future, so I moved them to a separate
directory for the time being. However, the rest of the code is still
vulkan-specific, so I've kept the "vulkan" naming and file paths, rather
than introducing a new `--gpu-api` type. (Which would have been ended up
with significantly more code duplicaiton)

Plus, the code and functionality is similar enough that for most users
this should just be a straight-up drop-in replacement.

Note: This commit excludes some changes; specifically, the updates to
context_win and hwdec_cuda are deferred to separate commits for
authorship reasons.
2019-04-21 23:55:22 +03:00
Niklas Haas 9f7dcc0726 mp_image: align stride to multiple of texel size
This helps with compatibility and/or performance in particular for
oddly-sized formats like rgb24. We use a loop to avoid having to
calculate the lcm (or waste bytes in the extremely common case of the
byte size and the stride align having shared factors).
2019-04-21 23:55:22 +03:00
Niklas Haas a3c808c6c8 vo_gpu: fix segfault when OSD tex creation fails
If !osd->texture, then mpgl_osd_draw_prepare fails.
2019-04-21 23:55:22 +03:00
Niklas Haas f0b6860d62 vo_gpu: index desc namespaces by ra
No reason to require them be constant. This allows them to depend on
runtime characteristics of the `ra`.
2019-04-21 23:55:22 +03:00
James Ross-Gowan 4e9dc60d9e appveyor: fix shaderc dependencies
Shaderc comes with a Python script that automatically fetches
"known-good" versions of its dependencies. Use that instead of manually
cloning dependencies to third-party.
2019-04-16 21:35:00 +03:00
JCount 7f1d7c38bc version.sh: update MPVCOPYRIGHT to include the current year, 2019 2019-04-16 20:11:30 +02:00
john e9fae413fd options/path: fix url detection per RFC3986 2019-04-05 20:48:24 +03:00
Aman Gupta 8b114e574a ao/audiounit: include AVAudioSession buffer in latency calc
Signed-off-by: Aman Gupta <aman@tmm1.net>
2019-04-05 10:29:44 +07:00
Aman Gupta e35aca3cb4 ao/audiounit: improve a/v sync
This more closely mimics ao_coreaudio, on which this driver was
originally based.

Signed-off-by: Aman Gupta <aman@tmm1.net>
2019-04-05 10:29:44 +07:00
NoSuck 6c91314900 man/input: clarify behavior of seek's +exact
As discussed here:

https://github.com/mpv-player/mpv/issues/6545#issuecomment-476015318
2019-04-02 09:09:14 +02:00
der richter 90e44d3ff2 cocoa-cb: add support for custom colored title bar 2019-04-02 02:09:01 +03:00
der richter 837e5058ff cocoa-cb: refactor title bar styling
half of the materials we used were deprecated with macOS 10.14, broken
and not supported by run time changes of the macOS theme. furthermore
our styling names were completely inconsistent with the actually look
since macOS 10.14, eg ultradark got a lot brighter and couldn't be
considered ultradark anymore.

i decided to drop the old option --macos-title-bar-style and rework
the whole mechanism to allow more freedom. now materials and appearance
can be set separately. even if apple changes the look or semantics in
the future the new options can be easily adapted.
2019-04-02 02:09:01 +03:00
Akemi 23f55569be cocoa-cb: add support for mac 10.14 Dark mode and run time switching
setting the appearance of the window to nil will always use the system
setting and changes on run time switches too. this is only the case for
macOS 10.14.
2019-04-02 02:09:01 +03:00
der richter d5be1e2729 cocoa-cb: move all title bar related functionality in its own file
quite a lot of the title bar functionality and logic was within our
window. since we recently added a custom title bar class to our window
i decided to move all that functionality into that class and in its
own file.

this is also a preparation for the next commits.
2019-04-02 02:09:01 +03:00
Akemi 9d5805fba4 cocoa-cb: remove an unused variable 2019-04-02 02:09:01 +03:00
Akemi 0bea384153 cocoa-cb: simplify CGL pixel format creation
i found the old pixel format creation a bit too messy. pixel format
attribute arrays and look ups were all over the place, the actual logic
what kind of format was created was inscrutable, the software pixel
format was hardcoded and no probing was done.

i split the attributes into mandatory and optional ones, one mandatory
for a hardware and software pixel format each, and moved those to the
top of the class. that way new attributes can be easily added to either
the mandatory or optional attributes and they don't mess up the actual
pixel creation logic any more. furthermore both hardware and software
pixel formats are being probed the same way now. to minimise code
duplications the probing was moved into its own function.
2019-04-02 02:05:11 +03:00
Akemi 716b871928 cocoa-cb: add support for dragging certain strings onto the window
only the dragged types NSFilenamesPboardType and NSURLPboardType were
supported to be dropped on the window, which was inconsistent with the
dragged types the dock icon supports. the dock icon additional supports
strings that represents an URL or a path. the system takes care of
validating the strings properly in the case of the dock icon, but in the
case of dropping on the window it needs to be done manually.

support for strings is added by also allowing the NSPasteboardTypeString
type and manually validating the strings. strings are split by new lines
and trimmed, to also support a list of URLs and paths. every new element
is checked if being an URL or path and only then being added to the
playlist.
2019-04-02 02:04:31 +03:00
Akemi 3f6be83350 cocoa-cb: synchronise the flush with the render
this could lead to a crash on deinit when flush
was called while the opengl state was cleaned up.

Fixes #6323
2019-04-02 02:02:02 +03:00
Akemi b207c1d4a1 cocoa-cb: fix a Cocoa window position on init bug
on init an NSWindow can't be placed on a none Main screen NSScreen
outside the Main screen's frame bounds.

To fix this we just check if the target screen is different from the
main screen and if that is the case we check the actual position with
the expect one. if they are different we try to reposition the window
to the wanted position.

Fixes #6453
2019-04-02 02:01:02 +03:00
Akemi 9aa0905c10 cocoa-cb: fix Space switching when quitting fs
when quitting mpv in fullscreen the System always switchs to Space 1
regardless of which Space mpv was on previous to switching to fs. to fix
this we close the window before quitting fs. that way the System
switches back the the Space mpv was previous on before fs.
2019-04-02 01:59:52 +03:00
Akemi 0caaa1a37c cocoa-cb: notify vo when window is minimised 2019-04-02 01:51:42 +03:00
Akemi 731804a27e cocoa-cb: fix crash when querying window state
Fixes #6489
2019-04-02 01:51:42 +03:00
Akemi 48a463d641 cocoa-cb: wakeup vo when new events are available
new events were added but not fetched by the vo, because we didn't
signal the vo that new events were available.

actually wakeup the vo when new events are available.
2019-04-02 01:46:52 +03:00
Akemi 61005e10ea build: bump minimum swift version to 3.0.2
#6299 reported problems with earlier 3.0.x swift versions. i tested with
3.0.2/SDK 10.12.2 and just assumed it also works with the older 3.0.x
swift and 10.12.x SDK versions. due to the unstable nature of swift
there were slight API differences that caused build problems.

since swift is bundled with the SDK we just bump the minimum swift
version.
2019-04-02 01:43:54 +03:00
der richter c90f083614 build: slightly adjust swift check output messages on fail
to make it consistent with the other checks and their output messages.
2019-04-02 01:43:54 +03:00
Akemi a3e6b81305 build: use StrictVersion for swift version comparison 2019-04-02 01:43:54 +03:00
zc62 de2b1920f3 demux: support cue sheets longer than 100 minutes
Remove the 2-digit-number restriction when reading the number of
minutes in the cue sheet INDEX command.

Fixes #6481
2019-04-01 23:39:08 +02:00
Aman Gupta 9c22bd4898 player: show restart position
Signed-off-by: Aman Gupta <aman@tmm1.net>
2019-04-01 23:38:38 +02:00
Leo Izen fcb320fd3f DOCS/man/mpv.rst: Fix big-cache profile example
The cache options were changed, and this commit
fixes the example big-cache profile to use the
new cache options.
2019-03-16 21:17:56 +01:00
Philip Sequeira 98eea65605 x11: fix cursor hiding initial state
Regression from 8e3308d687.

Broken cases were:
* --no-cursor-autohide acted like --cursor-autohide=always.
* --cursor-autohide-fs-only always hid the cursor if starting
  non-fullscreen; entering fullscreen at least once fixed it.
2019-03-16 21:17:32 +01:00
Bin Jin dd83b66652 vo_gpu: increase user shader size limit
The old size limit was chosen before LUT texture was supported in user
shader. At that time, the whole user shader will be compiled and run
on GPU, which makes large user shader impractical to be used.

With the introduction of LUT texture, the old size limit doesn't make
any sense. For example, a 1024x1024 rgba16f LUT will cost 32MB shader
size.

Fix this by increasing the size limit to a value that's unlikely be
reached.
2019-03-13 21:47:24 +02:00
Akemi 92e9b6da71 build: fix adding of object files to linking with cplugins disabled
this was meant to be fixed by 546f038, but with --disable-cplugins the
do_the_symbol_stuff function was never called and the handle_add_object
function was again always called before the actual linking task was
created.

to fix this we explicitly call handle_add_object only after all the
tasks the do_the_symbol_stuff function is called after too.

Fixes #6028
2019-03-13 21:44:43 +02:00
Rodger Combs 4fd3af14cd macosx_events: fix crash when shutting down during window animations 2019-03-13 19:44:34 +01:00
Rodger Combs ec0b5e527b build: enable swift debug information when requested 2019-03-13 19:44:34 +01:00
Avi Halachmi (:avih) d6ca985831 player: fix core activity state check
Adds the negation missed in 8816e1117e
when moving from a positive-is-active to positive-is-idle variable.

This leads to proper updates to properties such as "eof-reached",
as well as fixes screensaver state updates.

Separately found and fixed by avih and wnoun.

Co-authored-by: wnoun <wnoun@outlook.com>
2019-03-12 01:56:32 +02:00
wnoun 94203436c4 vo_libmpv: fix null pointer dereference
Closes: #6507
2019-03-11 01:55:59 +02:00
Jan Ekström 199aabddcc Merge branch 'master' into pr6360
Manual changes done:
  * Merged the interface-changes under the already master'd changes.
  * Moved the hwdec-related option changes to video/decode/vd_lavc.c.
2019-03-11 01:00:27 +02:00
Bin Jin 1d0349d3b5 vo_gpu: add two useful operators to user shader
modulo operator could be used to check if size is multiple of a
certain number.

equal operator could be used to verify if size of different textures
aligns.
2019-03-09 12:56:11 +01:00
Bin Jin b3cbd46509 vo_gpu: make texture offset available to CHROMA hooks
Before this commit, texture offset is set after all source textures
are finalized. Which means CHROMA hooks won't be able to align with
luma planes. This could be problematic for chroma prescalers utilizing
information from luma plane.

Fix this by find the reference texture early, and set global texture
offset early.
2019-03-09 12:56:11 +01:00