| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
| |
Old-style commands using _ as separator (e.g. show_progress) were still
used in some places, including documentation and configuration files.
This commit updates all such instances to the new style (show-progress)
so that commands are easier to find in the manual.
|
|
|
|
| |
This change helps avoiding conflict with talloc.h from libtalloc.
|
|
|
|
| |
Keep it internal, so we can synchronize access to it properly.
|
|
|
|
|
|
| |
And split the Cocoa and Unix cases. Simplify the Cocoa case slightly by
calling mpv_main directly, instead of passing a function pointer. Also
add a comment explaining why Cocoa needs a special case at all.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This unbreaks compiling command line player and libmpv at the same
time. The problem was that doing so silently disabled the OSX
application thing - but the command line player can not use the
vo_opengl Cocoa backend without it.
The OSX application code is basically dead in libmpv, but it's not
that much code anyway.
If you want a mpv binary that does not create an OSX application
singleton (and creates a menu etc.), you must disable cocoa
completely, as cocoa can't be used anyway in this case.
|
|
|
|
| |
Signed-off-by: wm4 <wm4@nowhere>
|
|
|
|
|
|
|
| |
The player now relies on the (slightly obscure) requirement that argv is
NULL-terminated.
Might fix #1652.
|
| |
|
|
|
|
|
|
|
|
| |
Commit e920a00eb assumed that terminate_cocoa_application() actually
would exit. But apparently that is not always the case; e.g. mpv --help
will just hang. The old code had a dummy exit(0), which was apparently
actually called. Fix by explicitly exiting if mpv_main() returns and
terminate_cocoa_application() does nothing.
|
|
|
|
| |
This is almost equivalent, and gets rid of the ifdef.
|
|
|
| |
similar to some of the code deleted in 685b8b7a but simpler
|
|
|
|
|
| |
Previously when using the bundle we used a custom bizarro thing to wait for
events. Just use `--idle` and greatly simplify the code.
|
|
|
|
| |
fixes #635
|
|
|
|
|
|
| |
This fixes using the mpv:// custom protocol on Yosemite were apparently
we receive an url which is automatically urlencoded by the system.
/cc mpv-player/stable
|
|
|
|
|
|
|
|
|
|
| |
Especially with other components (libavcodec, OSX stuff), the thread
list can get quite populated. Setting the thread name helps when
debugging.
Since this is not portable, we check the OS variants in waf configure.
old-configure just gets a special-case for glibc, since doing a full
check here would probably be a waste of effort.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Prior to this commit we had a list of key modifiers and checked against that.
Actually, the Cocoa framework has a built in way to do it and it involves
calling performKeyEquivalent: on the menu instance.
Fixes #946
cc @mpv-player/stable: this should apply with no conflicts
|
|
|
|
| |
Fixup commit for 20fa191ad.
|
|
|
|
|
|
| |
Thanks to @wm4 for catching the bug.
Fixes #405
|
|
|
|
| |
Fixes #497
|
|
|
|
|
|
|
|
|
|
| |
Application icon was added to the Dock only when run inside of a bundle. That
was handled automatically by OS X using the Info.plist definition.
To add the Application icon when run as a CLI program, I used the samme
approach in the X11 code and loaded the icon as a static binary blob inside
of mpv's binary. This is the simplest approach as it avoid headackes when
relocating the binary and such.
|
|
|
|
|
| |
Use the newly added `mp_event_drop_files` core function instead of having
logic in the platform dependent code.
|
|
|
|
| |
Apparently this should never be run anyway.
|
| |
|
|
|
|
| |
Fixup commit for bbc146927
|
|
|
|
|
|
|
| |
It looks like on Mavericks the Finder is passing different arguments to mpv
depending on whether the opened file is quarantined or not.
Fixes #285
|
|
|
|
|
|
|
|
|
|
| |
This seems to be a problem only in OS X 10.9. I guess they improved the
general speed of the Cocoa startup and suddenly mpv core takes more time
than the Cocoa thread to initialize.
Fixes #285
(hopefully!)
|
|
|
|
|
|
| |
Or at least I hope it fixes it, since I can't test.
Broken by commit 0d90dd0.
|
|
|
|
|
| |
95a2151d1 introduced a crash on systems lower than 10.9 when opening files
with a single argument.
|
|
|
|
|
|
|
|
|
|
|
|
| |
GetCurrentProcess() is deprecated on 10.9. Make a universal solution by
checking OS version number.
get_system_version() function is the recommended Apple way of getting the
OS version, since Gestalt is also deprecated (and does pretty much the same
thing anyway)
Updating HIDRemote.m to use a similar function would allow to get rid of the
2 other warnings.
|
|
|
|
|
|
|
|
| |
I did commit 86c05655d by thinking `mpv` already removed the `mpv` from
argc/argv. It actually is still there, so the argc must be 1 to check for no
arguments.
Thanks to @Nyx0uf for pointing out the bug and for testing on 10.9!
|
|
|
|
|
|
|
|
| |
File opening through Finder, apparently drops `--psn` arguments on Mavericks
and just uses no args. Modify the code to account for that case.
This wasn't tested on 10.9 itself (I don't have a paid dev account), but it
*should* work if I understood the problem correctly.
|
|
|
|
|
|
|
| |
Pretty useful for people writing userscripts for web browsers. Links starting
with 'mpv://' are forwarded to the mpv OSX bundle. The leading 'mpv://' is
stripped from the recived url and the rest of the string is inserted as is in
the playlist.
|
|
|
|
|
| |
This allows to open URLs directly with mpv. This is useful for streaming and
libquvi supported sites.
|
|
|
|
|
| |
Report key down and key up modifiers to the core so that it can issue it's
own key repeats (instead of relying on Cocoa's ones).
|
|
|
|
|
| |
Since last commit the input queue in the core is thread safe, so there is no
need for all this platform specific stuff anymore.
|
|
|
|
| |
Followup commit. Fixes all the files references.
|
|
|
|
|
|
| |
Update Cocoa parts to remove usage of the mp_fifo internal API to send events
to the core and use the input context directly. This is to follow commits the
work in commits 70a8079c and d603e73c.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Recent work in the OS X parts of the code started using clang's support for
Obj-C's support for Literals and Subscripting. These particular language
features remove a lot of boilerplate code and allow to interact with
collections as consicely as one would do in scripting languages like Ruby or
Python.
Even if these are compiler features, Subscripting needs some runtime support.
This is provided with libarclite (coming with the compiler), but we need to
add the proper method definitions since the 10.7 SDK headers do not include
them. That is because 10.7 shipped before this language features.
This will cause some warnings when compiling with the 10.7 SDK because the
commit also redefines BOOL to make autoboxing/unboxing of BOOL literals to
work.
If you need to test this for whatever reason on 10.8, just pass in the correct
SDK to configure's extra cflags:
./configure --extra-cflags='-mmacosx-version-min=10.7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk'
Fixes #117
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit addresses some issues with the users had with the previous
implementation in commit c39efb9. Here's the changes:
* Use Quartz Event Taps to remove Media Key events mpv handles from
the global OS X queue. This prevents conflicts with iTunes. I did this on
the main thread since it is mostly idling. It's the playloop thread that
actually does all the work so there is no danger of blocking the event tap
callback.
* Introduce `--no-media-keys` switch so that users can disable all of mpv's
media key handling at runtime (some prefer iTunes for example).
* Use mpv's bindings so that users can customize what the media keys do via
input.conf. Current bindings are:
MK_PLAY cycle pause
MK_PREV playlist_prev
MK_NEXT playlist_next
An additional benefit of this implementation is that it is completly handled
by the `macosx_events` file instead of `macosx_application` making the
project organization more straightforward.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Media keys are pretty handy if you use mpv as a music player (yes I'm one of
those people that do).
These are the bindings (which lead to the same behaviour as iTunes):
* NX_KEYTYPE_PLAY -> MP_KEY_PLAY
* NX_KEYTYPE_FAST -> MP_KEY_NEXT
* NX_KEYTYPE_REWIND -> MP_KEY_PREV
I just handled these ones as the volume one would be pretty invasive. I could
maybe change it to increase the application's volume instead of system volume
only when mpv is frontmost (iTunes does this), but some users would probably
hate it.
|
|
|
|
|
| |
Now that Cocoa's input handling is done on a separate thread from the playloop
it is ridicolously simple to have longer asynchronous sleeps when paused.
|
|
|
|
|
|
| |
On OSX with Cocoa enabled keyDown events are now handled with
addLocalMonitorForEventsMatchingMask:handler:. This allows to respond to
events even when there is no VO initialized but the GUI is focused.
|
|
|
|
| |
Objective-C is shorter / more readable than snprintf.
|
|
|
|
| |
Use Objective-C's new literal syntax to make the code simpler.
|
|
|
|
| |
I don't even want to know how this worked. It scares me a lot.
|
|
|
|
| |
This allows to move back osx_common to raw C.
|
|
|
|
|
|
|
| |
This fixes a bug that caused the application to never leave it's frontmost
position.
The idea is stolen from @donmelton who used it in MPlayerShell. Thanks!
|
|
|
|
|
|
|
| |
Add a menu item to quit and save the current playback position using the code
added with commit ce9a854.
Fixes #85
|
|
|
|
|
|
| |
Also add a "raw" prefix for commands, which prevents property expansion.
The idea is that if the commands are generated by a program, it doesn't
have to know whether the command expands properties or not.
|
|
|
|
|
|
|
|
|
| |
mpv crashed on quit when it was run using the bundle functionality and started
without any files thus waiting for file open events. In that case, since there
is no key_fifo initialized yet, short circuit to `terminate_cocoa_application()`
which is generally called from `exit_player()` during normal lifecycle.
Fixes bug report from user `eng` on IRC.
|
|
|
|
| |
Fixes #35
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit is a followup on the previous one and uses a solution I like more
since it totally decouples the Cocoa code from mpv's core and tries to emulate
a generic Cocoa application's lifecycle as much as possible without fighting
the framework.
mpv's main is executed in a pthread while the main thread runs the native cocoa
event loop.
All of the thread safety is mainly accomplished with additional logic in
cocoa_common as to not increase complexity on the crossplatform parts of the
code.
|
|
Schedule mpv's playloop as a high frequency timer inside the main Cocoa event
loop. This has the benefit to allow accessing menus as well as resizing the
window without the playback being blocked and allows to remove countless hacks
from the code that involved manually pumping the event loop as well simulating
manually some of the Cocoa default behaviours.
A huge improvement consists in removing NSApplicationLoad. This is a C function
defined in the Cocoa header and implements a minimal OSX application under ther
hood so that you can use the Cocoa GUI toolkit from C/C++ without having to
respect the Cocoa standards in terms of application initialization. This was
bad because the behaviour implemented by NSApplicationLoad was hard to customize
and had several gotchas especially in the menu department.
mpv was changed to be just a nib-less application. All the Cocoa part is still
generated in code but the event handling is now not dissimilar to what is
present in a stock Mac application.
As a part of reviewing the initialization process, I also removed all of
`osdep/macosx_finder_args`. The useful parts of the code were moved to
`osdep/macosx_appication` which has the broaded responsibility of managing the
full lifecycle of the Cocoa application. By consequence the
`--enable-macosx-finder` configure switch was killed as well, as this feature
is always enabled.
Another change the users will notice is that when using a bundle the `--quiet`
option will be inserted much earlier in the initializaion process. This results
in mpv not spamming mpv.log anymore with all the initialization outputs.
|