summaryrefslogtreecommitdiffstats
path: root/libvo
Commit message (Collapse)AuthorAgeFilesLines
* vo_vdpau: fix possible crash after preemptionUoti Urpala2012-07-161-3/+5
| | | | | | | | | | Preemption recovery code could change the vc->vdp pointer when recreating the VDPAU device. However, some other code cached the value of vc->vdp in local variables over calls to handle_preemption(), and could then crash when using the stale value later. Make the device creation code keep the same vc->vdp instead of freeing and reallocating it, so that the old pointer value is never invalidated now.
* build: use python3 to generate some files previously in gitUoti Urpala2012-07-161-43/+0
| | | | | | | | | | | | Some files used during build are generated with Python scripts in TOOLS/. Before, the generated files were included in the git tree. Start creating them at build time. This introduces a build-dependency on python3. The files in question are: libvo/vdpau_template.c libmpdemux/ebml_types.h libmpdemux/ebml_defs.c
* VO: implement shared option handling, use for vdpauUoti Urpala2012-07-163-58/+50
| | | | | | | | Add infrastructure that allows VOs to specify the suboptions they take, and get the values directly parsed into their private struct. The option functionality available with the new system is the same as for top-level player options. Convert vo_vdpau to use the new system instead of the old subopt_helper.
* 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-263-1/+17
| | | | | | | | 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-262-0/+8
| | | | | | | | | 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_sharedbuffer: add this video outputStefano Pigozzi2012-04-263-0/+318
| | | | | | | | | | This OSX video output is replaces the previous shared_buffer mode of vo_corevideo. It manages a shared buffer and a Cocoa distributed object to communicate with GUIs. Splitting this code into a separate VO allows to get rid of harmful code coupling, performance inefficiencies (useless image memory copies) and ugly code (big if-else conditionals).
* vo_corevideo: restructure this video outputStefano Pigozzi2012-04-265-352/+349
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-264-838/+166
| | | | | | | 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.
* vo_corevideo: use soft tabs (4 spaces)Stefano Pigozzi2012-04-261-684/+684
|
* 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