summaryrefslogtreecommitdiffstats
path: root/video
Commit message (Collapse)AuthorAgeFilesLines
* video: make use of libavcodec refcountingwm42013-03-134-10/+106
| | | | Now lavc_dr1.c is not used anymore if libavcodec is recent enough.
* video: prepare for libavcodec refcountingwm42013-03-133-62/+84
| | | | | Some minor refactoring and moving code around. There should be no functional changes.
* Prefix CODEC_ID_ with AV_wm42013-03-131-6/+6
| | | | | | | | | The old names have been deprecated a while ago, but were needed for supporting older ffmpeg/libav versions. The deprecated identifiers have been removed from recent Libav and FFmpeg git. This change breaks compatibility with Libav 0.8.x and equivalent FFmpeg releases.
* image_writer: switch to avcodec_encode_video2()wm42013-03-131-14/+11
| | | | | | | | avcodec_encode_video() was deprecated, and was finally removed from Libav and FFmpeg git. This change breaks compatibility with Libav 0.8.x. Thank the Libav developers, not me.
* wayland: remove asserts from egl_create_contextAlexander Preisinger2013-03-131-17/+7
| | | | | Instead of assert return false on most check. Removes the redundant second inclusion of the assert header.
* wayland: simplify egl_create_windowAlexander Preisinger2013-03-131-13/+4
| | | | | | Removes the local ret because it was only in an assert statement and also removes the window size assignments, because they are already done in config_wnidow_wayland.
* wayland: use the cursor_autohide_delay optionAlexander Preisinger2013-03-111-6/+9
| | | | | In the previous implemention the backend always assumed 1 second instead of honoring the cursor_autohide_delay option
* wayland: move window by grabing itAlexander Preisinger2013-03-111-0/+8
| | | | | Because the are no server-side-decorations in the available wayland compositors use grabbing the surface to move it.
* vo_opengl: insert a magical glFlush callwm42013-03-111-0/+6
| | | | | Helps a little bit with stuttering with pans and "heavy" subtitles covering the screen.
* cocoa_common: fix window position when bigger than displayStefano Pigozzi2013-03-101-4/+4
| | | | | | | | | | Fix a regression introduced in commit 979ce46c64 causing a window to take up more space than what the display allows. Add keepCentered:YES, so that the video area is always clipped to the current visible frame (even when using scale). Fixes #38.
* vo_sdl: we don't want to minize the window when losing focusRudolf Polzer2013-03-061-0/+2
| | | | | Because: this makes multi-monitor use entirely useless (as soon as pointer leaves left screen, mpv gets auto minimized).
* options: remove --no-vsyncwm42013-03-063-9/+8
| | | | | | Latest nvidia drivers ignore the application setting, so this switch makes even less sense than before. It's still possible to control this with VO specific suboptions.
* w32_common: fix compilationwm42013-03-051-10/+10
| | | | Broken by commit 1198c03.
* vo: Separate vo options from MPOptsAlexander Preisinger2013-03-0414-204/+204
| | | | | | | Separate the video output options from the big MPOpts structure and also only pass the new mp_vo_opts structure to the vo backend. Move video_driver_list into mp_vo_opts
* cocoa_common: fix crashStefano Pigozzi2013-03-041-1/+5
|
* cocoa_common: fix compilationStefano Pigozzi2013-03-041-7/+7
| | | | 7686cd7f broke some stuff
* Remove vo_fps global variablewm42013-03-042-4/+0
| | | | | This is needed by the encode stuff for some reason, so we have to explicitly pass it. Functionality shouldn't change.
* wayland: remove unnecessary function pointersAlexander Preisinger2013-03-041-10/+1
| | | | Remove the usage of getdladdr as it only adds to code complexity
* vo: remove and cleanup globalsAlexander Preisinger2013-03-0416-267/+243
| | | | | | | | 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.
* 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-033-27/+44
| | | | | | | | 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-031-1/+1
|
* vf_flip: move flipping code to mp_image.cwm42013-03-013-4/+10
|
* m_option: don't define OPT_BASE_STRUCT by defaultwm42013-03-015-4/+2
| | | | | | | | | | | 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.)
* core: move X11 specific code to x11_common.cwm42013-03-012-3/+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-0119-64/+33
| | | | | | | | | | | | | | | | | | | 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-287-1/+1466
| | | | | | | | | | | | | | | | | | | | | 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)
* video/out: remove video mode switching (--vm)wm42013-02-269-190/+8
| | | | | | | | | | | | | | | | | | | | 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-261-37/+31
| | | | | | | | | | | | | | | | | 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.
* 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.
* Remove --rootwin option and rootwin propertywm42013-02-243-6/+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-243-0/+3
| | | | | | | 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.)
* vo_caca: remove OSD supportwm42013-02-241-86/+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.
* 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-231-7/+21
| | | | | | | | | 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
* vf_scale: remove video dimension presets ("presize" suboption)wm42013-02-231-41/+0
| | | | | 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.
* options: drop --opt:subopt option nameswm42013-02-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For all suboptions, "flat" options were available by separating the parent option and the sub option with ":", e.g. "--rawvideo:w=123". Drop this syntax and use "-" as separator. This means even suboptions are available as normal options now, e.g. "--rawvideo-w=123". The old syntax doesn't work anymore. Note that this is completely separate from actual suboptions. For example, "-rawvideo w=123:h=123" still works. (Not that this syntax is worth supporting, but it's needed anyway, for for other things like vf and vo suboptions.) As a consequence of this change, we also have to add new "no-" prefixed options for flag suboptions, so that "--no-input-default-bindings" works. ("--input-no-default-bindings" also works as a consequence of allowing "-input no-default-bindings" - they are handled by the same underlying option.) For --input, always use the full syntax in the manpage. There exist suboptions other than --input (like --tv, --rawvideo, etc.), but since they might be handled differently in the future, don't touch these yet. M_OPT_PREFIXED becomes the default, so remove it. As a minor unrelated cleanup, get rid of M_OPT_MERGE too and use the OPT_SUBSTRUCT() macro in some places. Unrelated: remove the duplicated --tv:buffersize option, fix a typo in changes.rst.
* core: add fs-screen option for fullscreen display selectionStefano Pigozzi2013-02-215-47/+77
| | | | | | | | | | | | `--fs-screen` allows to decide what display to go fullscreen into. The semantics of `--screen` changed and now it is only used to select the windowed display when starting the application. This is useful for people using mpv with an external TV. They will start windowed on their laptop's screen and switch to fullscreen on the TV. @wm4 worked on the x11 and w32 parts of the code. All is squashed in one commit for history clarity.
* core: move `xineramascreen` to `MPOpts` as `vo_screen_id`Stefano Pigozzi2013-02-215-14/+16
| | | | This is a small cleanup in preparation for the next commit.
* x11_common: uncrustifywm42013-02-212-390/+328
| | | | | | | | Also some other cosmetic changes. And reformat the two remaining doxygen comments. Removing MSGLEN in x11_errorhandler() is technically not just a cosmetic change, but the result is the same anyway.
* vd_lavc: fix software decoding fallbackwm42013-02-211-1/+1
| | | | | | The string is deallocated by the callee after initialization, so fallback at runtime passes a deallocated string to libavcodec, which results in random crashes. Regression introduced by commit 4d016a9.
* cocoa_common: fix crash with dead key input and simplify related code