aboutsummaryrefslogtreecommitdiffhomepage
path: root/video/out/cocoa_common.m
Commit message (Collapse)AuthorAge
...
* cocoa: allow to embed into an arbitrary NSViewGravatar Stefano Pigozzi2014-10-08
| | | | | Basically add if guards on all the problematic features. I'm still thinking about a better way to handle this, but for the time being, this will do.
* cocoa: try to fix sizing bugs on retina displaysGravatar Stefano Pigozzi2014-10-06
| | | | untested, no hardware.
* cocoa: separate video view and events viewGravatar Stefano Pigozzi2014-10-05
|
* cocoa: fix fullscreen with bundleGravatar Stefano Pigozzi2014-10-05
|
* cocoa: readd some function callsGravatar Stefano Pigozzi2014-10-05
|
* cocoa: actually reset the event flagsGravatar Stefano Pigozzi2014-10-05
|
* cocoa: remove some useless flagsGravatar Stefano Pigozzi2014-10-05
|
* cocoa: disable some features when embedding in another windowGravatar Stefano Pigozzi2014-10-05
| | | | ontop, fullscreen and window title change to be precise
* cocoa: remove --fs-missioncontrolGravatar Stefano Pigozzi2014-10-05
| | | | | | | This is the first of a series of commits that will change the Cocoa way in a way that is easily embeddable inside parent views. To reach that point common code must avoid referencing the parent NSWindow since that could be the host application's window.
* cocoa: fix some pointer casts to be 32bit safeGravatar Stefano Pigozzi2014-10-05
| | | | credits: wm4
* cocoa/libmpv: allow to embed mpv GL view in another windowGravatar Stefano Pigozzi2014-10-05
| | | | | | | | | | | | | | | | | | | This is just temporary code but is a good base for future work (and baby steps are required for these changes). The 'final destination' is embedding the video view into any NSView but that requires some more work (the mechanism will be the same: pass the view's pointer casted to int64_t through -wid). For instance we will need to remove as much usage of the window instance as possible, and use nil guards where not possible. For this reason I will remove stuff like the mission control fullscreen feature (it's a cute feature but annoying to support and quite limited, go make your GUIs), and a way to lookup the current screen directly from the NSView absolute coordinates (this is needed for ICC detection mostly, and reporting back the screen to mpv's core). Moreover the current view.m will need to be separated into 2 views: the actual video view that will be embedded, and a parent view that will not be embedded and will be responsibile for tracking events.
* cocoa: simplify the config code and run it on the main threadGravatar Stefano Pigozzi2014-10-05
| | | | | | This could be dangerous because we initialize the window asynchronously and return immediately from config, but since the OpenGL context is already created, this seems to work correctly and doesn't cause weird deadlock cases.
* cocoa: don't reset presentation options on uninitGravatar Stefano Pigozzi2014-10-04
| | | | | | This doesn't look to be needed anymore. Fullscreening with both the NSView and the NSWindow API works correctly. I guess this was forgotten in from older code which changed presentation options directly for going fullscreen.
* cocoa: make fullscreening look like an atomic operationGravatar Stefano Pigozzi2014-10-04
| | | | | | | | | | | At the moment when you fullscreen mpv there is a very small time interval where the fullscreen windows is semi-transparent. Apparently whem moving the view to another parent it's better to make Cocoa not draw anything globally. An Apple engineer said it, so it must be correct: http://www.cocoabuilder.com/archive/cocoa/142020-preventing-flicker-on-moving-nsview-to-different-superview.html I know I will regret this in the future.
* cocoa: make resizing wake the vo threadGravatar Stefano Pigozzi2014-10-04
|
* cocoa: remove dead codeGravatar Stefano Pigozzi2014-10-04
|
* cocoa: move to a simpler threading modelGravatar Stefano Pigozzi2014-10-04
| | | | | | | | | | | | | | Unfortunately using dispatch_sync for synchronization turned out to be really bad for us. It caused a wide array of race conditions, deadlocks, etc. Moving to a very simple mutex. It's not clear to me how to do liveresizing with this, for now it just flickers with is unacceptable (maybe I'll draw black instead). This should fix all the threading cocoa bugs. Reopen if it's not the case! Fixes #751 Fixes #1129
* video: rename VOCTRL_GET_WINDOW_SIZEGravatar wm42014-09-05
| | | | Make it clear that this accesses the un-fullscreened window size.
* cocoa: macosx_application needs cocoa-applicationGravatar FRAU KOUJIRO2014-08-06
|
* cocoa: move handleFilesArray: to macosx_eventsGravatar FRAU KOUJIRO2014-08-06
|
* vo: remove vo_mouse_movement() wrapperGravatar wm42014-07-27
| | | | So that VO backends don't have to access the VO just for that.
* cocoa: don't send messages to uninitialized gl contextsGravatar Stefano Pigozzi2014-07-19
| | | | | | | This should fix some crashes where we sent makeCurrentContext to a context that was being freed from another thread. /cc @mpv-player/stable
* cocoa: fix regression preventing window resizeGravatar Stefano Pigozzi2014-07-15
| | | | | I introduced this bug in b5bbb49. Sorry! This could fix #943 and #930 even though I can't reproduce those specific bugs.
* cocoa: move CGL context creation to gl_cocoaGravatar Stefano Pigozzi2014-07-08
| | | | | | This approach is similar to what other vo_opengl backends do. It can also be used in the future to create another cocoa backend that renders offscreen with IOSurfaces or FBOs.
* cocoa: add fallback for automatic GPU switchingGravatar Stefano Pigozzi2014-06-15
| | | | | | Not all the hardware supports kCGLPFASupportsAutomaticGraphicsSwitching (apparently all Mid-2010 and before MacBooks do not work with it), so fallback to not asking for this attribute in the GL pixel format.
* cocoa: allow automatic gpu switchingGravatar Stefano Pigozzi2014-06-15
| | | | Fixes #820
* cocoa: switch to CGL APIs for GL context creationGravatar Stefano Pigozzi2014-06-15
| | | | | CGL APIs are lower level thus giving us better control and more options for the context creation.
* cocoa: don't use VOCTRL_UPDATE_SCREENINFOGravatar wm42014-05-06
|
* options: rename video-related options/propertiesGravatar Martin Herkt2014-05-04
| | | | | | | | | | | Renamed options: --aspect → --video-aspect --fstype → --x11-fstype --native-fs → --fs-missioncontrol --name → --x11-name Renamed properties: aspect → video-aspect
* cocoa: refactor sync scheduling to a functionGravatar Stefano Pigozzi2014-04-28
| | | | | | | | | This extracts the scheduling logic to a single function which is nicer to keep it consistent. Additionally make sure we don't schedule sync operations from a sync operation itself since that could cause deadlocks (even if it should not be happening with the current code).
* cocoa: move sync section assignments in vo_controlGravatar Ryan Goulden2014-04-28
|
* cocoa: cosmetics: use NSMakeSizeGravatar Ryan Goulden2014-04-28
|
* cocoa: fix native fullscreenGravatar Ryan Goulden2014-04-28
| | | | | | | | | | | | | | | | | | | | | | | This fixes a couple of issues with the Cocoa `--native-fs` mode, primarily: - A ghost titlebar at the top of the screen in full screen: This was caused by the window constraining code kicking in during fullscreen. Simply returning the unconstrained rect from the constraining method fixes the problem. - Incorrect behavior when using the titlebar buttons to enter/exit fullscreen, as opposed to the OSD button. This was caused by mpv's internal fullscreen state going out of sync with the NSWindow's one. This was the case because `toggleFullScreen:` completely bypassed the normal event flow that mpv expects. Signed-off-by: Ryan Goulden <percontation@gmail.com> Change style for mpv, simplify and refactor some of the constraining code. Signed-off-by: Stefano Pigozzi <stefano.pigozzi@gmail.com>
* vo_opengl, cocoa: allow to autoselect a color profileGravatar Stefano Pigozzi2014-03-31
| | | | | | | | | | | | | This commit adds support for automatic selection of color profiles based on the display where mpv is initialized, and automatically changes the color profile when display is changed or the profile itself is changed from System Preferences. @UliZappe was responsible with the testing and implementation of a lot of this commit, including the original implementation of `cocoa_get_icc_profile_path` (See #594). Fixes #594
* vo: merge get rid of vo.aspdat fieldGravatar wm42014-01-22
| | | | | | | | | | | | Rename vo_get_src_dst_rects() to mp_get_src_dst_rects() and make it independent from the VO (it takes a comical amount of parameters now to pass all required state). Add a convenience wrapper with the name vo_get_src_dst_rects() to vo.c. Replace all aspdat and vo usages with immediate parameters. Functionally, nothing should change, except that the window size is clamped to a minimum of size 1 much earlier, and some log messages change the prefix (don't bother with vo.vo_log stuff).
* cocoa: remove dead codeGravatar Stefano Pigozzi2014-01-21
| | | | This became dead code in commit 3f594c2e.
* video/out: simplify monitor aspect handlingGravatar wm42014-01-11
| | | | | | | | For some reason, this made all VO backends both set the screen resolution in opts->screenwidth/height, and call aspect_save_screenres(). Remove the latter. Move the code to calculate the PAR-corrected window size from aspect.c to vo.c, and make it so that the monitor PAR is recalculated when it makes sense.
* cocoa: fix window placement on secondary screensGravatar Stefano Pigozzi2014-01-11
| | | | | | | | | | | | | | For a long time the cocoa backend set the xinerama_x/y and used dx/dy from the VO instance. This somewhat worked with some workarounds but wasn't really what was supposed to be happening. Moreover 27e4360, which touched this workaround introduced a regression. New code doesn't set the xinerama_x/y values so that dx/dy are offsets in the current screen (not a virtual screen composed of all the screens). The screen reference detected during VOCTRL_UPDATE_SCREENINFO is also passed down to the window initialization code. Fixes #472
* cocoa: refactor init window positioning codeGravatar Stefano Pigozzi2014-01-10
|
* cocoa: don't reset window size when the video size doesn't changeGravatar Stefano Pigozzi2014-01-06
| | | | Fixes #459
* cocoa: handle files drag and drop on the player video viewGravatar Stefano Pigozzi2014-01-04
|
* Revert "cocoa: unlock on uninit"Gravatar Stefano Pigozzi2013-12-26
| | | | | | Not sure why but this doesn't seem to be needed anymore. This reverts commit 6ead6aa005f1c78a117bde58e48f106cfd1e9806.
* cocoa: sanitize window title string and guard against NULLGravatar Stefano Pigozzi2013-12-25
| | | | | | | | | | | If the utf8 string used to create the NSString for title was invalid utf8, -stringWithUTF8String returned nil and triggered an assertion in Cocoa's framework code. Sanitize the utf8 string and if the sanitation wasn't enough just avoid crashing by not setting a title. Fixes #406
* Fix OSX build; remove all remaining mpvcore referencesGravatar 11rcombs2013-12-17
|
* cocoa: make borderless window resizableGravatar agiz2013-12-07
| | | | Fixes #399
* cocoa: unlock on uninitGravatar Stefano Pigozzi2013-11-26
| | | | NSLock should be unlocked before dealloc is called on it.
* cocoa: use window-scale to support video scaling functionalityGravatar Stefano Pigozzi2013-11-22
| | | | | In the cocoa backend you can use cmd+0/1/2 to scale the window. This commit makes it use the new window-scale functionality.
* cocoa: implement window-scaleGravatar Stefano Pigozzi2013-11-22
|
* cocoa: set and clear gl context inside of sync sectionsGravatar Stefano Pigozzi2013-10-20
| | | | | | | The code did not set and unset the current context inside sync sections. I am not sure if this was an actual problem but this is better since the context is linked to a single thread. In my brief tests this seems to avoid garbage to show up in fullscreen.
* cocoa: make --ontop also cover dock+menubarGravatar Stefano Pigozzi2013-10-12
| | | | | This only shows any differences when mpv isn't frontmost and is in fullscreen. Cmd+Tab overlay is still at a higher level as to avoid complete usability fail.