summaryrefslogtreecommitdiffstats
path: root/libvo
Commit message (Collapse)AuthorAgeFilesLines
* build: remove OS/2 supportUoti Urpala2012-04-061-1090/+0
|
* 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).
* VO: move gl+cocoa before corevideo in default VO orderStefano Pigozzi2012-03-251-1/+4
| | | | | | | | | The gl video output is faster and has more features than corevideo, so it should be preferred on mac osx. This doesn't affect GUI compatibility because they specify the corevideo video output along with the suboptions for the shared buffer name to mmap in.
* cocoa_common: add license informationStefano Pigozzi2012-03-252-0/+38
|
* vo_quartz: remove this video outputStefano Pigozzi2012-03-252-1375/+0
| | | | | | | | | This video output is not useful anymore. It is based on Carbon to draw the mplayer window and this has been deprecated by Apple in 10.5. The upcoming 10.8 OSX release should deprecate most of Carbon, so it doesn't make sense to keep vo_quartz in the codebase when there are modern and better alternatives (vo_gl and vo_corevideo).
* 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-253-16/+49
| | | | | | | | | | | | | | | 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.
* x11: remove wskeys.hwm42012-03-252-107/+20
| | | | | Use the <X11/keysym.h> xlib header instead. I'm not sure why mplayer defined these constants itself.
* x11: input: add print and menu keyswm42012-03-251-0/+1
|
* x11: add KP_Separator to key mappingwm42012-03-252-0/+2
| | | | | | | | | | | At least on some keyboards, the key between '0' and 'Enter' on the key pad is mapped to KP_Separator. Since X11 VOs accept unicode input, the mplayer keycode this key generates depended on the numlock state, and with numlock enabled this mapped to an ASCII character. This is probably not what the user wanted, since two physical keys will always map to the same key code. Map it to KP_DEC.
* x11: allow unicode inputwm42012-03-252-29/+49
| | | | | | | | | This change allows using non-ASCII keys with X11. These keys were ingored before. Technically, this creates an invisible, non-interactive input method context. If creation fails, the code falls back to the old method, which allows a subset of ASCII only.
* x11: fix setting UTF-8 window titles for some special caseswm42012-03-251-29/+18
| | | | | | | | | | | | | | | | | | | | | Setting the WM_NAME/WM_ICON_NAME window properties didn't always work: apparently there are some characters that can't be represented in the X STRING or COMPOUND_TEXT encodings, such as U+2013 EN DASH. The function Xutf8TextListToTextProperty partially converts the string, and returns a value different from 'Success'. This means vo_x11_set_property_string didn't set these window properties. On most modern window managers, this is not a problem, since these use the _NET_WM_NAME/_NET_ICON_NAME and the UTF8_STRING encoding. Some older WMs like IceWM don't read these, and the window title remains blank. It's not clear what exactly we should do in this situation, but fix it by setting set the WM_NAME/WM_ICON_NAME properties as UTF8_TEXT. This violates the ICCCM, but at least IceWM seems to handle this well. See also: http://lists.freedesktop.org/archives/xorg/2004-September/003391.html http://lists.freedesktop.org/archives/xorg/2004-September/003395.html
* vo_gl: cocoa: add support for --ontopStefano Pigozzi2012-03-253-4/+33
| | | | | Make the cocoa backend change the non-fullscreen window level according to the value of the ontop property.
* vo_xv: remove direct rendering supportUoti Urpala2012-03-251-111/+22
| | | | | | | | | | | | | | | | | Direct rendering support in vo_xv (used with --dr) had at least two problems. First, OSD drawing modified the buffers; this meant that if the buffers were used for reference frames there would be video corruption. I don't think "performance optimization" with this level of drawbacks is appropriate with today's machines any more. Direct rendering could still be used for non-reference frames, but there's a second problem: with direct rendering enabled the same buffer is used for every frame, and with the XShm extension that is used by default there's no checking that the previous frame has been completely uploaded to the graphics card before it's overwritten by the next one. This could be fixed, but as Xv is becoming obsolete I don't see it as a priority to improve it. Thus I'm simply removing the parts of functionality that were more likely to break things than improve playback.
* cosmetics: misc minor cleanupsUoti Urpala2012-03-251-1/+0
| | | | | The deleted ZRM* things were only relevant to vo_zr, which was deleted earlier.
* core: restructure main play loop, continue audio after videoUoti Urpala2012-03-191-0/+1
| | | | | | | | | | | Restructure parts of the code in the main play loop. The main functionality difference is that if a video track ends first, now audio will continue to be played until it ends too. Now the process also wakes up less often if there's no need to update video or audio. This will reduce unnecessary wakeups especially when paused, but may make handling of input events laggier when fd-based notifications are not supported (like most input on Windows).
* vo_gl: improve 10-bit YUV->RGB conversion accuracy slightlyUoti Urpala2012-03-094-17/+16
| | | | | | | | | | Modify the YUV->RGB conversion matrix to take into account the difference between the same color value being x/255 in a 8-bit texture and x*256/65535 in a 16-bit texture (actually things are stored as x*4/65535 for 10-bit color, but that can be ignored here). This 0.4 % difference in the shader float value could make shades of gray in 10-bit (or generally more than 8 bit) YUV produce RGB values with green slightly higher than red/blue.
* windows support: unicode filenameswm42012-03-092-11/+4
| | | | | | | | | | | | | | | | | | | Windows uses a legacy codepage for char* / runtime functions accepting char *. Using UTF-8 as the codepage with setlocale() is explicitly forbidden. Work this around by overriding the MSVCRT functions with wrapper macros, that assume UTF-8 and use "proper" API calls like _wopen etc. to deal with unicode filenames. All code that uses standard functions that take or return filenames must now include osdep/io.h. stat() can't be overridden, because MinGW-w64 itself defines "stat" as a macro. Change code to use use mp_stat() instead. This is not perfectly clean, but still somewhat sane, and much better than littering the rest of the mplayer code with MinGW specific hacks. It's also a bit fragile, but that's actually little different from the previous situation. Also, MinGW is unlikely to ever include a nice way of dealing with this.
* cleanup: Silence compilation warnings on MinGW-w64wm42012-03-012-9/+11
| | | | | | | | | | | | | | | | | | | Some of the code, especially the dshow and windows codec loader parts, are extremely hacky and likely full of bugs. The goal is merely getting rid of warnings that could obscure more important warnings and actual bugs, instead of fixing actual problems. This reduces the number of warnings from over 500 to almost the same as when compiling on Linux. Note that many problems stem from using the ancient wine-derived windows headers. There are some differences to the "proper" windows header. Changing the code to compile with the proper headers would be too much trouble, and it still has to work on Unix. Some of the changes might actually break compilation on legacy MinGW, but we don't support that anymore. Always use MinGW-w64, even when compiling to 32 bit. Fixes some warnings in the win32 loader code on Linux too.
* vo_png: set AVCodecContext parameters before opening itUoti Urpala2012-02-281-19/+21
| | | | | | | Instead of opening avctx in preinit() and setting paramters later, (re)open it in config() where parameters can be set first. This fixes a failure to open the codec with new libavcodec versions that check pix_fmt during avcodec_open2().
* vo: reject vo_redraw_frame() if no frames have been drawnUoti Urpala2012-02-282-1/+4
| | | | | | | | vo_xv crashed if existing frames had been lost due to a config() call in the middle of a file and vo_redraw_frame() was called. Add checks to reject vo_redraw_frame() unless at least one frame has been flipped after the the last configuration change, so individual VOs do not have to deal with this case.
* build: switch to libavutil bswap.h and intreadwrite.hUoti Urpala2012-02-011-1/+1
| | | | | | | | | | | | Remove the private bswap and intreadwrite.h implementations and use libavutil headers instead. Originally these headers weren't publicly installed by libavutil at all. That already changed in 2010, but the pure C bswap version in installed headers was very inefficient. That was recently (2011-12) improved and now using the public bswap version probably shouldn't cause noticeable performance problems, at least if using a new enough compiler.
* Update Libav API usesUoti Urpala2012-02-011-5/+12
| | | | | | | | | | | | | | | | | | | Change various code to use the latest Libav API. The libavcodec error_recognition setting has been removed and replaced with different semantics. I removed the "--lavdopts=er=<value>" option accordingly, as I don't think it's widely enough used to be worth attempting to emulate the old option semantics using the new API. A new option with the new semantics can be added later if needed. Libav dropped APIs that were necessary with all Libav versions until quite recently (like setting avctx->age), and it would thus not be possible to keep compatibility with previous Libav versions without adding workarounds. The new APIs also had some bugs/limitations in the recent Libav release 0.8, and it would not work fully (at least some avcodec options would not be set correctly). Because of those issues, this commit makes no attempt to maintain compatibility with anything but the latest Libav git head. Hopefully the required fixes and improvements will be included in a following Libav point release.
* vo_vdpau: fix preemption recovery after recent commitsUoti Urpala2011-12-201-25/+27
| | | | | | | Recent commits for screenshot support and video redraw changes didn't handle vdpau driver preemption state correctly, which could make the player crash if preemption occurred. Fix this and improve preemption handling a bit otherwise.
* configure, build: remove --disable-libav supportUoti Urpala2011-12-111-2/+0
| | | | | Remove support for building the player without libavcodec and libavformat. These libraries are now always required.
* vo_vdpau: use new want_redraw mechanism in one more caseUoti Urpala2011-12-091-3/+1
|
* Merge remote-tracking branch 'pigoz/gl'Uoti Urpala2011-12-073-13/+27
|\
| * vo_gl: cocoa: point swapinterval to cocoa_common functionStefano Pigozzi2011-12-063-0/+11
| | | | | | | | | | | | | | | | 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-063-13/+16
| | | | | | | | | | | | 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.
* | Merge remote-tracking branch 'wm4/window_title'Uoti Urpala2011-12-0713-58/+104
|\|
| * libvo: change default window title to "mplayer2"wm42011-12-062-2/+2
| | | | | | | | | | Also change the WM_CLASS "application class" string from "MPlayer" to "mplayer2". This string is visible as application name in Gnome 3.
| * x11: set window titles as UTF-8wm42011-12-062-3/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Always set the X11 window title properties as UTF-8. This is a bit tricky for X11 window properties which are not specified to use UTF-8, such as WM_NAME. We also properly set WM_ICON_NAME, which means the window caption and the text used in the task bar (of the WM has one) will be the same on most window managers. Before this commit, WM_ICON_NAME was always hardcoded to "MPlayer", even if --title or --use-filename-title was used. Also update the window title only on reconfigure, like it is done in mplayer-svn commit 34380.
| * libvo: remove title argument from struct vo_driver.configwm42011-12-0613-56/+47
| | | | | | | | | | | | | | | | | | | | 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.
* | core, vo: new window refresh logic, add slow-video OSD redrawUoti Urpala2011-12-065-68/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove code refreshing window contents after events such as resize from vo_vdpau, vo_gl and vo_xv. Instead have them simply set a flag indicating that a refresh is needed, and have the player core perform that refresh by doing an OSD redraw. Also add support for updating the OSD contents over existing frames during slow-but-not-paused playback. The VOs now also request a refresh if parameters affecting the picture change (equalizer settings, colormatrix, VDPAU deinterlacing setting). Even previously the picture was typically redrawn with the new settings while paused because new OSD messages associated with setting changes triggered a redraw, but this did not happen if OSD was turned off. A minor imperfection is that now window system events can trigger a single one-frame step forward when using vo_xv after pausing so that vo_xv does not yet have a copy of the current image. This could be fixed but I think it's not important enough to bother.
* | core, vo: modify OSD redraw architecture, support EOSDUoti Urpala2011-12-065-42/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously the core sent VFCTRL_REDRAW_OSD to change OSD contents over the current frame. Change this to VFCTRL_REDRAW_FRAME followed by normal EOSD and OSD drawing calls, then vo_flip_page(). The new version supports changing EOSD contents for libass-rendered subtitles and simplifies the redraw support code needed per VO. vo_xv doesn't support EOSD changes because it relies on vf_ass to render EOSD contents earlier in the filter chain. vo_xv logic is additionally simplified because the previous commit removed the need to track the status of current and next images separately (now each frame is guaranteed to become "visible" soon after we receive it as "next", with no VO code running in the interval between).
* | vo: do final frame draw only near page flipUoti Urpala2011-12-063-12/+50
|/ | | | | | | | | | | | | | | | | | | | | | | | | Separate passing a new frame to VOs using the new API into two steps. The first, vo_draw_image(), happens after a new frame is available from the filter chain. In constrast to old behavior, now the frame is not actually rendered yet at this point (though possible slice draw calls can already reach the VO before). The second step, vo_new_frame_imminent(), happens when we're close enough to the display time of the new frame that we'll commit to flipping it as the next action and will not change the OSD over the previous frame any more. This new behavior fixes a previous problem with vo_vdpau and vo_gl in the situation where the player is paused after decoding a new frame but before flipping it; previously changing OSD in that state would switch to the new frame as a side effect. It would also allow an easy way to fix extra output files produced with something like "--vo=png --frames=1" with precise seeking, but this is not done yet. The code now relies on a new mp_image from the filter chain staying valid even after the vf_vo put_image() call providing it returns. In other words decoders/filters must not deallocate or otherwise invalidate their output frame between passing it forward and returning from the decode/filter call.
* vo_gl: add native mac osx Cocoa backend for vo_glStefano Pigozzi2011-11-264-0/+623
| | | | | | | | | 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.
* vo_corevideo: fix key interpretation with modifiersStefano Pigozzi2011-11-261-2/+9
| | | | | | | | When interpreting a key event, use the "charactersIgnoringModifiers" method of the event in order to extract Alt+key combinations while keeping the normal meaning of "key". When the right alt modifier is pressed use the "characters" method to allow AltGr behavior to be used to generate different characters.
* vo_gl: fix cscale=4 and cscale=5 doing nothingwm42011-11-251-2/+4
| | | | | | | | | | | | | | | | The ARB shader code generated at the end of the shaders for scaling mode 4 and 5 was something like: MAD yuv.g, b.r, {0.5}, a.r; This appears to be semantically equivalent with: MAD yuv.g, b.rrrr, {0.5, 0, 0, 0}, a.rrrr; This has the consequence that the result register, yuv.g, will not contain the value computed by the scale filter, but a.r. a.r is the unchanged value sampled from the normal texture coordinates, so the filter did effectively nothing and behaved as if cscale=0 was specified. The basic mistake here is that yuv.g does not specify a single register, but it specifies the full vector register yuv, with writing enabled on the g channel. This means yuv.g will assigned the g channel of the the result vector computed by the MAD instruction.
* vo_gl: fix 10 bit with Mesa drivers (Intel/Nouveau on Linux)wm42011-11-253-8/+18
| | | | | | | | | | | | | | | | | | The GL_LUMINANCE16 texture format had only 8 bit precision on Mesa based drivers. This caused heavy degradation of the image when playing formats with more than 8 bits per pixel, such as 10 bit h264. Use GL_R16 instead, which at least Mesa and Nvidia drivers actually implement as 16 bit textures. Since sampling from this texture format doesn't return anything meaningful in the other color components (unlike luminance textures), the shader code has to be slightly changed. GL_R16 requires the GL_ARB_texture_rg extension. Check for it, and fall back to the old texture format if it's not available. The low precision of the GL_LUMINANCE16 format has just been fixed in upstream Mesa, but it'll take a while before that fix is available in distros.
* vo_gl: make shader code generation easier to deal withwm42011-11-251-152/+188
| | | | | | | | | The shader code was generated from very long strings with lots of format specifiers with snprintf calls. It was almost impossible to quickly tell what variables were inserted where in the shader. Make this more readable by implementing a kind of simple variable substitution, which allows replacing the format specifiers in the code templates with with variable names.
* vo_xv: implement screenshotswm42011-11-251-0/+51
| | | | | | | | | | | | | Caveat: the OSD will be included in the screenshots when the screenshot is taken during normal playback. This doesn't happen when a screenshot is taken while playback is paused. Fixing this would introduce a small performance reduction during normal playback, which is unacceptable for a possibly rarely used optional feature. Due to the nature of the Xv API, taking a screenshot of the scaled video isn't possible either.
* vo_gl: implement screenshotswm42011-11-253-0/+80
|
* vo_vdpau: implement screenshotswm42011-11-252-11/+90
|
* core: add screenshot mode for actual VO window contentswm42011-11-251-0/+7
| | | | | | | | | | | | | | The screenshot command normally converts the currently displayed video frame to an image. Add support for an alternative screenshot mode that is supposed to capture the real window contents. Such a screenshot contains a possibly scaled version of the frame, the OSD, and subtitles. Add a default key binding Alt+s for taking screenshots in this mode. This needs special VO support, and might not work with all VOs (this commit does not yet contain an implementation for any VO, only the infrastructure).
* core: add infrastructure to get screenshots from VOswm42011-11-251-0/+12
| | | | | | | | | | | | | | | | | | | Add a VO command (VOCTRL_SCREENSHOT) which requests a screenshot directly from the VO. If VO support is available, screenshots will be taken instantly (no more 1 or 2 frames delay). Taking screenshots when hardware decoding is in use will also work (vdpau). Additionally, the screenshots will now use the same colorspace as the video display. Change the central MPContext to be allocated with talloc so that it can be used as a talloc parent context. This commit does not yet implement the functionality for any VO (added in subsequent commits). The old screenshot video filter is not needed anymore if VO support is present, and in that case will not be used even if it is present in the filter chain. If VO support is not available then the filter is used like before. Note that the filter still has some of the old problems, such as delaying the screenshot by at least 1 frame.
* vo_gl: fix crash with backends lacking control() featureswm42011-10-241-0/+6
| | | | | | | | Some functionality provided by the windowing backend (such as x11, win32) is optional. The function pointers in MPGLContext are NULL if the functionality is not implemented. Check them before calling them, instead of crashing. This happened at least on Windows with the "vo_ontop" command.
* vo_gl: remove support for nvidia register combiners (yuv=1)wm42011-10-243-169/+7
| | | |