summaryrefslogtreecommitdiffstats
path: root/libvo/cocoa_common.m
Commit message (Collapse)AuthorAgeFilesLines
* cocoa_common: improve conditional dock hiding from 3259e4a7aStefano Pigozzi2012-08-281-2/+3
| | | | | | Make the conditional hiding logic introduced in commit 3259e4a7a2a938 ("cocoa_common: make fullscreen menubar/dock hiding conditional") work when mplayer is started with the `fs` and `xineramascreen` options.
* cocoa_common: add HiDPI/retina supportStefano Pigozzi2012-08-161-17/+32
| | | | | | | | | | | | | | | | | | | | With a HiDPI screen, for performance and backwards compatibility reasons, AppKit requests an OpenGL surface with a pixel number that equals the user points number. After the image is rendered to this smaller surface, it is upscaled so that its dimensions are comparable across screens of different DPIs. The applied scaling is not that good and makes the video/subtitles blurry; this is not acceptable for a video player. Request AppKit to use a high resolution OpenGL surface to back the mplayer2 OpenGL view. Also set the window pixel size information correctly in the VO object by converting user points to actual pixels. All the system version checks are done at runtime so that the feature is available on OSX 10.7 even with a binary compiled with older SDKs. Also replace is_lion_or_better() with is_osx_version_at_least(10, 7, 0) which is defined in osx_common.
* cocoa_common.m: add missing config.h includeStefano Pigozzi2012-08-161-0/+2
| | | | This is needed for the check on CONFIG_SDL in this file.
* cocoa_common: refactor menu generationStefano Pigozzi2012-08-161-16/+41
| | | | | This commit is supposed to make the menu generation a little more readable. It also fixes menu generation for the `cmd+q` entry.
* libvo, libao: remove useless video and audio output driverswm42012-07-281-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some of these have only limited use, and some of these have no use at all. Remove them. They make maintainance harder and nobody needs them. It's possible that many of the removed drivers were very useful a dozen of years ago, but now it's 2012. Note that some of these could be added back, in case they were more useful than I thought. But right now, they are just a burden. Reason for removal for each module: vo_3dfx, vo_dfbmga, vo_dxr3, vo_ivtv, vo_mga, vo_s3fb, vo_tdfxfb, vo_xmga, vo_tdfx_vid: All of these are for very specific and outdated hardware. Some of them require non-standard kernel drivers or do direct HW access. vo_dga: the most crappy and ancient way to get fast output on X. vo_aa: there's vo_caca for the same purpose. vo_ggi: this never lived, and is entirely useless. vo_mpegpes: for DVB cards, I can't test this and it's crappy. vo_fbdev, vo_fbdev2: there's vo_directfb2 vo_bl: what is this even? But it's neither important, nor alive. vo_svga, vo_vesa: you want to use this? You can't be serious. vo_wii: I can't test this, and who the hell uses this? vo_xvr100: some Sun thing. vo_xover: only useful in connection with xvr100. ao_nas: still alive, but I doubt it has any meaning today. ao_sun: Sun. ao_win32: use ao_dsound or ao_portaudio instead. ao_ivtv: removed along vo_ivtv. Also get rid of anything SDL related. SDL 1.x is total crap for video output, and will be replaced with SDL 2.x soon (perhaps), so if you want to use SDL, write output drivers for SDL 2.x. Additionally, I accidentally damaged Sun support, which made me completely remove Sun/Solaris support. Nobody cares about this anyway. Some left overs from previous commits removing modules were cleaned up.
* cocoa: return the real CGLPixelFormatObjStefano Pigozzi2012-05-151-1/+1
| | | | | vo_cocoa_cgl_pixel_format is returning a cached CGLPixelFormatObj. Return the current one by querying the OpenGL context.
* cocoa: don't request a depth buffer sizeStefano Pigozzi2012-05-151-2/+0
|
* cocoa: gl3: make window creation fail on <10.7Stefano Pigozzi2012-05-151-0/+5
| | | | | Versions of OSX prior to 10.7 do not support OpenGL 3. Fail the window creation when that is the case.
* cocoa: gl3: support querying of colors bit depthStefano Pigozzi2012-05-151-0/+16
| | | | | Add support for querying the bit depth of the colors from the OpenGL context. This allows to perform dithering correctly.
* cocoa: handle failure on pixel format creationStefano Pigozzi2012-05-141-0/+6
| | | | | | | | This didn't make any difference on with OpenGL 2.1, but with the introduction of OpenGL3.2 it's possible for the pixel format creation to fail (if OpenGL3.2 is not supported). This code handles the failure case accordingly.
* Merge remote-tracking branch 'origin/master'wm42012-04-291-6/+41
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: bstr.c bstr.h libvo/cocoa_common.m libvo/gl_common.c libvo/video_out.c mplayer.c screenshot.c sub/subassconvert.c Merge of cocoa_common.m done by pigoz. Picking my version of screenshot.c. The fix in commit aadf1002f8a will be redone in a follow-up commit, as the original commit causes too many conflicts with the work done locally in this branch, and other work in progress.
| * cocoa_common: fix problems with alt-tab window changesStefano Pigozzi2012-04-261-4/+5
| | | | | | | | | | | | | | | | | | | | Fix alt tabbing to another window in the same workspace. The player window stayed on top because of a missing call to orderBack:. Fix alt tabbing to the player window from a different workspace. The window didn't get activated. Turns out that you must call makeKeyAndOrderFront: before setLevel: or setPresentationOptions: or the window will not properly ask for focus.
| * cocoa_common, gl_common: add OSX specific getProcAddressStefano Pigozzi2012-04-261-0/+15
| | | | | | | | | | | | | | | | Run dlopen on the OpenGL dynamic library instead of on the binary. This should prevent crashes due to function conflicts when X11/lGL is linked. Remove mutual exclusion of the X11 and Cocoa backends.
| * OSX, input: implement wakeup in response to Cocoa eventsStefano Pigozzi2012-04-261-0/+6
| | | | | | | | | | | | | | | | | | Add code to wake up the select() call in input.c when an OSX event is available and a Cocoa OpenGL backend is initialized. Fixes the slow response to input or other events in Cocoa-based VOs during long select() sleeps (e.g., when mplayer2 is paused) introduced by commit 7040968.
| * vo_corevideo: restructure this video outputStefano Pigozzi2012-04-261-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Restructure this video output to be similar to vo_gl, even if simpler and less feature complete (for example it's still missing EOSD support). Ideally, it should act as a decent fallback in the case where something breaks in the OSX support of vo_gl. Here's a summary of what changed: * Remove the shared buffer code since it wasn't using any function from the CoreVideo API. Moreover, its presence in vo_corevideo was forcing the non-GUI related code to perform more image copies than necessary. Equivalent shared-buffer functionality will be added in a separate new VO in the next commit (this means OSX GUIs will need to specify a different VO). * Clean up the code to conform a bit more to the mplayer2 conventions. Enforce 80 column wrapping, use a private struct for file variables, use the new libvo api. * Add OSD rendering using OpenGL instead of writing directly on the video image data. * Simplify the logic for the rendering function when dealing with panscan. * Add VOCTRL_REDRAW_FRAME support. * Add colormatrix support by using the built-in API provided by CoreVideo.
| * vo_corevideo: use cocoa_common to display the windowStefano Pigozzi2012-04-261-2/+13
| | | | | | | | | | | | | | Change vo_corevideo to use cocoa_common to create and manage the window. This doesn't affect external OSX GUIs, since they don't use vo_corevideo window management, but only read the image data from the shared buffer.
* | Merge remote-tracking branch 'origin/master'wm42012-04-011-18/+110
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: bstr.c bstr.h etc/input.conf input/input.c input/input.h libao2/ao_pulse.c libmpcodecs/vf_ass.c libmpcodecs/vf_vo.c libvo/gl_common.c libvo/x11_common.c mixer.c mixer.h mplayer.c
| * cocoa_common: update screen info before entering fullscreenStefano Pigozzi2012-03-251-0/+1
| | | | | | | | | | | | If the user moved the window to another screen, fullscreen mode would still use the original screen. Fix to use the screen the window is currently on (unless overridden by --xineramascreen).
| * cocoa_common: add license informationStefano Pigozzi2012-03-251-0/+19
| |
| * cocoa_common: fix double click handlingStefano Pigozzi2012-03-251-8/+8
| | | | | | | | | | | | | | The Cocoa framework generates only a NS*MouseDown event when handling the second click of a double click (no NS*MouseUp). If that's the case put mouse up key in mplayer2's fifo when dealing with the MouseDown Cocoa event.
| * cocoa_common: accept window drag event from the whole window surfaceStefano Pigozzi2012-03-251-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | Change the window to accept mouse drag events not only on the title bar, but also on the rest of the window surface; this includes the video area. It looks like the changing of the window mask resets the behaviour specified in the delegate method, probably due to some strange interaction with NSBorderlessWindow. For this reason call -setPresentationOptions in the -fullscreen method to remind cocoa the behaviour we want.
| * options, x11+cocoa: add option --cursor-autohide-delayStefano Pigozzi2012-03-251-6/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add option --cursor-autohide-delay to control the number of milliseconds with no user interaction before the mouse cursor is hidden. There are two negative values with useful special meanings: * A value of -1 prevents the cursor from hiding (useful for users with multiple displays). * A value of -2 prevents the cursor from showing upon activity. The default is 1 second to keep the behaviour consistent with the past X11 backend implementation. Remove the vo_mouse_autohide field as it was always true.
| * vo_gl: cocoa: add support for --ontopStefano Pigozzi2012-03-251-4/+31
| | | | | | | | | | Make the cocoa backend change the non-fullscreen window level according to the value of the ontop property.
* | gl_common: cocoa: add OpenGL 3.2 context creation codeStefano Pigozzi2012-03-311-8/+39
|/ | | | | Add a new option to the cocoa window creation code in order to decide which OpenGL context to create.
* vo_gl: cocoa: point swapinterval to cocoa_common functionStefano Pigozzi2011-12-061-0/+6
| | | | | | | | Currently there is no way to set the swap interval with a function that has a signature compatible with other platforms' gl extensions. Make a wrapper function around the gui toolkit method of setting the swap interval property, and point gl->SwapInterval to it.
* vo_gl: cocoa: decouple cocoa_common from gl_commonStefano Pigozzi2011-12-061-8/+7
| | | | | | Remove the useless dependency on MPGLContext from cocoa_common, since it was used just to access the vo struct. Change gl_common to pass the vo struct directly to all the cocoa_common functions.
* libvo: remove title argument from struct vo_driver.configwm42011-12-061-16/+2
| | | | | | | | | | This affects only the "new" VO API. The config() title argument was barely used, and it's hardcoded to "MPlayer" in vf_vo.c. The X11 and the Cocoa GUI backends, which are the only ones properly supporting window titles, ignored this argument. Remove the title argument. Add the vo_get_window_title function. All GUI VOs are supposed to use it for the window title.
* vo_gl: add native mac osx Cocoa backend for vo_glStefano Pigozzi2011-11-261-0/+541
Add native Cocoa code to display an OpenGL window. Some of the code is based on the OpenGL parts of vo_corevideo but I took the time to remove old code based on Carbon. There is autodetection in the configure script but you can use --enable[disable]-cocoa to enable[disable] this.