summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* vo: remove and cleanup globalsAlexander Preisinger2013-03-0423-361/+375
| | | | | | | | Removes almost every global variabel in vo.h and puts them in a special struct in MPOpts for video output related options. Also we completly remove the options/globals pts and refresh rate because they were unused.
* encoding-example-profiles: add a Nokia N900 profileRudolf Polzer2013-03-041-0/+6
| | | | | Nokia N900 is simply H.264 Baseline, level must be forced to 3.0, at max. display resolution. There is no pan-scan like on iOS.
* cocoa_common: make windows appear againStefano Pigozzi2013-03-031-17/+23
| | | | | | | | | Commit 9efe32120 stops recreating the hidden window used for OpenGL's extensions autodetection. The `cocoa_common` code assumed the hidden flag could only come when creating a window which is now not true anymore. Move some code around so that hidden, fullscreen and window position are respected on subsequent calls of config.
* gl_common: get rid of symbol redefinition warnings with recent Mesawm42013-03-033-0/+17
| | | | | | | | | | | | | Apparently newer Mesa versions changed their <GL/glx.h> header, and unconditionally define GLX_CONTEXT_MAJOR_VERSION_ARB and others. This clashed with gl_header_fixes.h, a header which quarantines bad hacks to make compilation possible on systems with outdated GL headers. Specifically, our header was included before glx.h, so the hacks were always active, and somehow Mesa's glx.h used to deal with this by not redefining existing identifiers. Fix the gl_header_fixes.h logic so the hacks are checked after including glx.h.
* x11_common: fix --cursor-autohide when pausedwm42013-03-034-29/+52
| | | | | | | | When paused, --cursor-autohide worked with a precision of 500ms, which is the main loop's default sleep time when paused. Cursor hiding is polled in x11_common, and the main loop never called the X11 code at the right time. Fix this by allowing the VO to set a time when it should be called next.
* vo_opengl: don't destroy VOFLAG_HIDDEN windowwm42013-03-034-35/+1
| | | | | | | This was done so because the X11 code had a hard to track down issue with some window managers, and caused the VO window to be placed incorrectly. This was fixed in the previous commit. Consequently, we can remove this bad hack.
* x11_common: fix window mapping, refactor window creation/resize handlingwm42013-03-032-136/+148
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | vo_opengl creates an invisible window with VOFLAG_HIDDEN in order to test whether the OpenGL context is useable. The visible window is created at a later point. This has been broken forever (in vo_gl, now called vo_opengl_old, it could be avoided by disabling auto- detection explicitly using the "yuv" sub-option). Avoiding VOFLAG_HIDDEN only mitigates the issue, and a related bug can still happen with some window managers (see below). As a hack, code was added to vo_gl to destroy the (hidden) window so that all state was destroyed. Later, more hacks were added to deal with some caveats that came with recreating the window, such as probing for the context up to 4 times. Attempt to fix the problem properly. There were two problems: first, the window was not resized to video size before mapping. This was the main cause for the placement issue, e.g. mapping the window as 320x200, and then resizing it. Second, mpv tried to force the window position with XSetWMNormalHints and PPosition with values it just read with XGetGeometry. This messes up the window manager's default placement. It seems to be a race condition, and behavior is different across various WMs too: with IceWM, the window manager's placement is usually preferred, and with Fluxbox, mpv's position is preferred. mpv's default position is centering the window on the screen, which is much nicer for video in general than typical WM default placement, so it's possible that this bug was perceived as a feature. (Users who want this have to use --geometry="50%:50%", doing this by default is probably not safe with all WMs.) Since the old code was hard to follow and full of issues, it's easier to redo it. Move general window creation stuff out of the vo_x11_config_vo_window function, and move the resize logic into it. This has been tested on IcwWM, Fluxbox, awesome, Unity/Compiz.
* x11_common: use private variables for window statewm42013-03-036-56/+57
| | | | | | | | | | | | | | | | Store the window state (position and size) in vo_x11_state, instead of in vo->dx/dy/dwidth/dheight. The VO variables are overwritten by vo.c on every vo_config() call, which is extremely not helpful. Now vo->dx/dy are mostly unused (except for passing the position forced by the --geometry option), and vo->dwidth/dheight are set for the VO, and otherwise read for resize detection only. In the long term, the way vo_config() handles the --geometry option should be changed, and vo->dx/dy should be removed. Remove some useless stuff: VO_EVENT_MOVE and VO_EVENT_KEYPRESS were generated, but unused. Wayland changes by Alexander Preisinger.
* video/out: remove VO_EVENT_REINITwm42013-03-033-11/+0
| | | | | | | It was once used for vo_sdl (the old one based on SDL 1.2), since SDL apparently lost the GL state when switching to fullscreen. The new vo_sdl (using SDL 1.3) doesn't use or need this. It's dead code, so get rid of it.
* w32_common: remove unused variablewm42013-03-032-6/+2
| | | | The depth was printed in verbose mode. Completely useless.
* fix clang compiler warningsStefano Pigozzi2013-03-033-3/+3
|
* wayland: fix typo in manpageAlexander Preisinger2013-03-021-1/+1
|
* wayland: change wayland-egl pkg-config versionAlexander Preisinger2013-03-021-1/+1
| | | | wayland-egl is part of mesa and uses the mesa version.
* input.conf: change default bindings of 5/6 from hue to gammawm42013-03-012-3/+3
| | | | | | | | I doubt anyone needs to adjust hue on a frequent basis, and gamma is much more useful. Suggestions for more radical changes of key bindings are welcome (there's a lot of useless crap mapped).
* manpage: remove reference to subtitle alignmentwm42013-03-011-3/+0
|
* core: fix SEEK_FACTORwm42013-03-016-10/+39
| | | | | | | | | | | | | | | | | | | | | | | | | Emulate percentage-seeks (SEEK_FACTOR) as normal time-seeks if possible. This fixes some issues with (let's call it) low quality implementations of SEEK_FACTOR (e.g. demux_mkv basically interprets this as byte-seek, and also seeking to 99.9% makes it seek back to the start). For weird MPEG formats the demuxer level SEEK_FACTOR is still used. These formats, which can have timestamp resets, are identified by setting demuxer->ts_resets_possible to true. Also, have get_current_pos_ratio() follow the same rules, and calculate the percentage position with the file position if timestamp resets are possible. This actually fixes percentage-seeks in .ts files with demux_lavf.c. This kind of seek is not really used now, but it will be more important when we add a progress bar. Note: seeking in chained ogg files is still completely broken. The main issue is that ffmpeg doesn't provide a sane API for dealing with timestamp resets, and trying to do byte seeks with ogg confuses demuxer and decoder (or something like this) and just does random things. (Tested with two concatenated flac-in-ogg files).
* demux_lavf: fix percentage display with some file formatswm42013-03-011-1/+2
| | | | | | AVFormatContext.start_time is sometimes AV_NOPTS_VALUE, such as when playing FLAC files. (For most other file formats it's set to 0, even if the format doesn't support arbitrary start times.)
* vf_flip: move flipping code to mp_image.cwm42013-03-013-4/+10
|
* m_option: don't define OPT_BASE_STRUCT by defaultwm42013-03-0110-7/+8
| | | | | | | | | | | OPT_BASE_STRUCT defines which struct the OPT_ macros (like OPT_INT etc.) reference implicitly, since these macros take struct member names but no struct type. Normally, only cfg-mplayer.h should need this, and other places shouldn't be bothered with having to #undef it. (Some files, like demux_lavf.c, still store their options in MPOpts. In the long term, this should be removed, and handled like e.g. with VO suboptions instead.)
* m_option: reformat option macro definitionswm42013-03-011-31/+102
| | | | Slightly more bearable, but it's still incredibly ugly.
* m_options: more typesafetywm42013-03-014-30/+73
| | | | | | | | | | | | | Change the option definition macros so that they cause compiler warnings if the type of the referenced option struct member doesn't match the type implied by the macro. The compiler warning printed isn't very telling, but it's better than silently invoking undefined behavior by violating the C strict aliasing rules. Also fix some minor cases that violate the type rules. For the option "no-aspect" we have to add a new option type to handle it properly. Some option types are hard to check, so we don't in these cases.
* core: move X11 specific code to x11_common.cwm42013-03-013-8/+4
| | | | | Nothing changes, because vo_check_events() is called at the same place anyway.
* vf_vo: remove pointless NULL checkswm42013-03-011-4/+0
| | | | The filter refuses to initialize if the video_out is NULL.
* core: simplify OSD capability handling, remove VFCAP_OSDwm42013-03-0121-77/+35
| | | | | | | | | | | | | | | | | | | VFCAP_OSD was used to determine at runtime whether the VO supports OSD rendering. This was mostly unused. vo_direct3d had an option to disable OSD (was supposed to allow to force auto-insertion of vf_ass, but we removed that anyway). vo_opengl_old could disable OSD rendering when a very old OpenGL version was detected, and had an option to explicitly disable it as well. Remove VFCAP_OSD from everything (and some associated logic). Now the vo_driver.draw_osd callback can be set to NULL to indicate missing OSD support (important so that vo_null etc. don't single-step on OSD redraw), and if OSD support depends on runtime support, the VO's draw_osd should just do nothing if OSD is not available. Also, do not access vo->want_redraw directly. Change the want_redraw reset logic for this purpose, too. (Probably unneeded, vo_flip_page resets it already.)
* vo_sdl, vo_xv: remove redundant/useless VOCTRL_PAUSE usagewm42013-03-012-11/+0
|
* wayland: add wayland supportAlexander Preisinger2013-02-2810-4/+1506
| | | | | | | | | | | | | | | | | | | | | All wayland only specific routines are placed in wayland_common. This makes it easier to write other video outputs. The EGL specific parts, as well as opengl context creation, are in gl_common. This backend works for: * opengl-old * opengl * opengl-hq To use it just specify the opengl backend --vo=opengl:backend=wayland or disable the x11 build. Don't forget to set EGL_PLATFORM to wayland. Co-Author: Scott Moreau (Sorry I lost the old commit history due to the file structure changes)
* core: use floats for OSD bar percentage displaywm42013-02-262-15/+17
| | | | | | | Use floats instead of integers in the range 0-100. Currently, the OSD is currently made up of 46 elements so no change should be visible, but rendering of the bar will be changed later to use vector drawings (using pixel coordinates) instead of glyphs. This commit is for preparation.
* core: use playback time to determine playback percent positionwm42013-02-269-54/+22
| | | | | | | | | | | | | The percent position is used for the OSD, the status line, and for the OSD bar (shown on seeks). By default, the PTS of the last demuxed packet was used to calculate it. This led to a "jumpy" display when the percentage value (casted to int) was changing. The reasons for this were the presence of video frame reordering (packet PTS is not monotonic), or getting PTS values from different streams (like audio/subs). Since these rely on PTS values and correct file durations anyway, simplify it by calculating it with the current playback position in mplayer.c instead.
* video/out: remove video mode switching (--vm)wm42013-02-2613-201/+11
| | | | | | | | | | | | | | | | | | | | This allowed making the player switch the monitor video mode when creating the video window. This was a questionable feature, and with today's LCD screens certainly not useful anymore. Switching to a random video mode (going by video width/height) doesn't sound too useful either. I'm not sure about the win32 implementation, but the X part had several bugs. Even in mplayer-svn (where x11_common.c hasn't been receiving any larger changes for a long time), this code is buggy and doesn't do the right thing anyway. (And what the hell _did_ it do when using multiple physical monitors?) If you really want this, write a shell script that calls xrandr before and after calling mpv. vo_sdl still can do mode switching, because SDL has native support for it, and using it is trivial. Add a new sub-option for this.
* x11_common: always create a window, even with --widwm42013-02-262-44/+44
| | | | | | | | | | | | | | | | | The --wid switch (for embedding the player into other applications) didn't create a new window, and instead tried to use the window that was passed via --wid directly. This made the code more complex, caused strange X errors (mpv and host application fighting for exclusive X resources), and actually could cause issues if the --wid window wasn't created with the X Visual needed for OpenGL. Always create a window instead. This makes it always possible to embed the player into foreign windows. --geometry doesn't work anymore - the controlling application should always create a new window to place the player inside it, and can control the video window by moving and resizing this window. w32_common.c actually did this right, and always creates a new window.
* video/out: rename create_window to config_windowwm42013-02-2612-31/+31
| | | | | | create_window is really bad naming, because this function can be called multiple times, while the name implies that it always creates a new window. At least the name config_window is not actively misleading.
* gl_common: simplify window/context creationwm42013-02-263-217/+191
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Allow the backend code to create a GL context on best effort basis, instead of having to implement separate functions for each variation. This means there's only a single create_window callback now. Also, getFunctions() doesn't have the gl3 parameter anymore, which was confusing and hard to explain. create_window() tries to create a GL context of any version. The field MPGLContext.requested_gl_version is taken as a hint whether a GL3 or a legacy context is preferred. (This should be easy on all platforms.) The cocoa part always assumes that GL 3 is always available on OSX 10.7.0 and higher, and miserably fails if it's not. One could try to put more effort into probing the context, but apparently this situation never happens, so don't bother. (And even if, mpv should be able to fall back to vo_corevideo.) The X11 part doesn't change much, but moving these functions around makes the diff bigger. Note about some corner cases: This doesn't handle CONTEXT_FORWARD_COMPATIBLE_BIT_ARB on OpenGL 3.0 correctly. This was the one thing getFunctions() actually needed the gl3 parameter, and we just make sure we never use forward compatible contexts on 3.0. It should work with any version above (e.g. 3.1, 3.2 and 3.3 should be fine). This is because the GL_ARB_compatibility extension is specified for 3.1 and up only. There doesn't seem to be any way to detect presence of legacy GL on 3.0 with a forward compatible context. As a counter measure, remove the FORWARD_COMPATIBLE flags from the win32 code. Maybe this will go wrong. (Should this happen, the flag has the be added back, and the win32 will have to explicitly check for GL 3.0 and add "GL_ARB_compatibility" to the extra extension string.) Note about GLX: Probing GL versions by trying to create a context on an existing window was (probably) not always possible. Old code used GLX 1.2 to create legacy contexts, and it required code different from GLX 1.3 even before creation of the X window (the problem was selections of the X Visual). That's why there were two functions for window creation (create_window_old and create_window_gl3). However, the legacy context creation code was updated to GLX 1.3 in commit b3b20cc, so having different functions for window creation is not needed anymore.
* dec_video: remove weird offset for VDCTRL_QUERY_UNSEEN_FRAMESwm42013-02-262-5/+6
| | | | | The return value of get_current_video_decoder_lag() should be the same before and after this change in all cases.
* vd_lavc: better warning message for software decoding fallbackwm42013-02-261-1/+2
| | | | At least I hope it's better.
* screenshot: make showing OSD message when taking a screenshot defaultwm42013-02-261-2/+1
| | | | | | | This can be disabled by prefixing the "screenshot" command with "no-osd" in input.conf: s no-osd screenshot
* screenshot: show a message on each screenshot takenwm42013-02-263-15/+45
| | | | | | The message reads: "Screenshot: filename", where the filename is what mpv passes to fopen(). It will also show error messages when saving the screenshot fails.
* network: set default user-agent to MPlayer'swm42013-02-261-1/+1
| | | | | | | SHOUTcast bans "Mozilla" in the user-agent, Vimeo bans "Lavf" (part of the libavformat normal user-agent). "MPlayer 1.1-..." seems to work everywhere, and is close to the intented use (mpv is based on MPlayer, after all).
* commands: parse seek time arguments like time optionswm42013-02-263-2/+4
| | | | | | | | | | This means a commands like "seek 13:00 absolute" actually behaves like "--start=13:00", instead of interpreting the argument as fraction as with normal float options. This is probably slightly closer to what you'd expect. As a consequence, the seek argument's type changes from float to double internally.
* options: reject nan, inf, 0:0, etc. for float optionswm42013-02-261-0/+13
| | | | Same for time values.
* options: remove parsing of "," as decimal pointwm42013-02-261-17/+2
| | | | | | Apparently the intention was parsing numbers reliably in presence of non-C locales. mpv is always in C locale, and not being in C locale would probably break even more things, so remove this code.
* gl_common: remove compatibility aliases for backend sub-optionwm42013-02-261-6/+0
| | | | | | The backend sub-option for vo_opengl and vo_opengl-old accepted numeric values (like -1, 0, ...) for compatibility with MPlayer. This was added in mplayer2 times, and is not important anymore.
* img_format: add pixel format name for IMGFMT_MONO_Wwm42013-02-261-0/+1
| | | | This should have been in commit 90efe7c.
* vf_yadif: remove dead codewm42013-02-261-2/+0
| | | | Commit 2e1063d changed the option parsing, and args is always NULL now.
* demux_mf: add some more image formatswm42013-02-241-1/+15
| | | | And fix the comment about fourccs.
* Remove --rootwin option and rootwin propertywm42013-02-248-24/+0
| | | | | | | | You can just use --wid=0 if you really want this. This only worked/works for X11, and even then it might interact badly with most desktop environments. All the option did was setting --wid to 0, and the property did nothing.
* demux_mf: support .xbmwm42013-02-244-0/+4
| | | | | | | And support the PIX_FMT_MONOWHITE pixel format. (This is really weird: unlike PIX_FMT_MONOBLACK, it uses white pixels. I have no idea why libavcodec doesn't just convert the pixel format on the fly, instead of bothering everyone with really special pixel formats.)
* demux_rawvideo: allow setting video codecwm42013-02-242-0/+6
| | | | Can be used to decode some obscure image formats and similar stuff.
* demux_mf: map to codecs directlywm42013-02-242-39/+35
| | | | Instead of going through FourCCs and codec_tags.c.
* vo_caca: remove OSD supportwm42013-02-243-108/+1
| | | | | | Recent changes to the OSD code made vo_caca crash when showing OSD. Since this is a joke VO (== I'd rather not waste my time with it), remove the OSD support. It wasn't that great anyway.
* core: print correct quit message when quitting, simplify codewm42013-02-242-27/+14
| | | | | | | | | "End of file" was printed to the terminal instead of "Quit" when exiting with the "quit" slave command (closing the window and such). Note that it will still print EOF when it exists because the end of the playlist is reached. Do some other (not strictly related) simplifications.
* vo_direct3d: always clear window before drawing videowm42013-02-241-15/+2
| | | | | | | | | | | | | This fixes the issue that black borders (e.g. on fullscreen) are not redrawn, even if OSD rendering changes these areas. In theory, the code could try some clever things to determine whether clearing the window is really necessary, but that's probably not worth the trouble and won't bring any significant performance gain, or might even make things slower (because the GPU can't discard the old contents). Also fix redrawing when changing panscan with OSD disabled.
* vf_yadif: switch to option parser, allow disabling by defaultwm42013-02-232-13/+26
| | | | | | | | | Use the option parser instead of sscanf. Remove the parameter changing the field dominance (it has been marked deprecated for ages). Add a new suboption "enabled", which can be used to disable the filter by default, until it's enabled at runtime: mpv -vf yadif=enabled=no
* m_option: remove preset mechanismwm42013-02-232-98/+0
| | | | | | | | | | Was very complicated to use, and its uses have been removed in the previous commits. (While this feature sounded kind of useful, it could be rewritten in a much simpler way, like storing presets as strings, and then using the option parser to apply a preset. The removed code did some major pointer juggling to handle raw values, which made it hard to use.)
* vf_scale: remove video dimension presets ("presize" suboption)wm42013-02-232-52/+1
| | | | | This wasn't really useful, and the option preset mechanism is awfully complex.
* vf_stereo3d: get rid of m_obj_presets_t usagewm42013-02-231-49/+3
| | | | The code becomes amazingly simpler.
* demux_rawvideo: remove ancient video dimension presetswm42013-02-232-20/+0
| | | | I can't see much value in them. Just specify the size manually.
* options: fix --no-shuffle and --no-{wm42013-02-232-2/+6
| | | | | --no-shuffle accidentally did nothing after commit 57879a2. The options --no-{ and --no-} make no sense and shouldn't exist (wrong option type).
*