summaryrefslogtreecommitdiffstats
path: root/video/out
Commit message (Collapse)AuthorAgeFilesLines
* wayland: create xkbcommon keymap from stringAlexander Preisinger2013-11-131-2/+1
| | | | Fixes a problem where the passed size doesn't match the actuall string.
* waylad: implement functionality for window-scalingAlexander Preisinger2013-11-121-0/+12
|
* vo_lavc: fix -ovoffset.Rudolf Polzer2013-11-111-1/+3
| | | | Previously, using it led to no single frame being output, ever.
* vo_opengl: fix alpha values written to the framebufferwm42013-11-103-5/+16
| | | | | | | | | | | | | | | | | | | | | | | When blending OSD and subtitles onto the video, we write bogus alpha values. This doesn't normally matter, because these values are normally unused and discarded. But at least on Wayland, the alpha values are used by the compositor and leads to transparent windows even with opaque video on places where the OSD happens to use transparency. (Also see github issue #338.) Until now, the alpha basically contained garbage. The source factor GL_SRC_ALPHA meant that alpha was multiplied with itself. Use GL_ONE instead (which is why we have to use glBlendFuncSeparate()). This should give correct results, even with video that has alpha. (Or at least it's something close to correct, I haven't thought too hard how the compositor will blend it, and in fact I couldn't manage to test it.) If glBlendFuncSeparate() is not available, fall back to glBlendFunc(), which does the same as the code did before this commit. Technically, we support GL 1.1, but glBlendFuncSeparate is 1.4, and I guess we should try not to crash if vo_opengl_old runs on a system with GL 1.1 drivers only.
* gl_hwdec_vdpau: silence warning caused by buggy GL_NV_vdpau_interop specwm42013-11-091-2/+6
| | | | | VDPAU handles are integers, but for some reasons the VDPAU GL extension expects them as void*.
* gl_header_fixes: fix inverted conditionwm42013-11-051-1/+1
| | | | | Could possibly leading to failing compilation on systems with headers that miss the vdpau extension.
* vo_opengl: support for vdpau hardware decodingwm42013-11-054-0/+293
| | | | | | | | | | | | This uses vdpau OpenGL interop to convert a vdpau surface to a texture. Note that this is a bit weak and primitive. Deinterlacing (or any other form of vdpau postprocessing) is not supported. vo_opengl chroma scaling and chroma sample position are not supported. Internally, the vdpau video surfaces are converted to a RGBA surface first, because using the video surfaces directly is too complicated. (These surfaces are always split into separate fields, and the vo_opengl core expects progressive frames or frames with weaved fields.)
* vdpau: move device and video surface management from vo_vdpau.c to vdpau.cwm42013-11-051-214/+34
| | | | | The goal is being able to use vdpau decoding independently from vo_vdpau.c.
* vo_opengl: redo aspects of initialization, change hwdec APIwm42013-11-053-38/+38
| | | | | | | | | | | Instead of checking for resolution and image format changes, always fully reinit on any parameter change. Let init_video do all required initializations, which simplifies things a little bit. Change the gl_video/hardware decoding interop API slightly, so that hwdec initialization gets the full image parameters. Also make some cosmetic changes.
* vo_opengl/vaapi: use IMGFMT_RGB0wm42013-11-051-1/+1
| | | | | More correct, might make things slightly faster (probably insignificant).
* vo_xv: fix compilation of SHM not availablewm42013-11-051-1/+1
|
* Adjust wayland definesPaweł Forysiuk2013-11-041-1/+1
|
* vo_opengl: cosmetics/fix typoswm42013-11-042-2/+2
|
* vo_opengl: reserve 4 texture units for video instead of 3wm42013-11-041-5/+5
| | | | | | | | | | Video has up to 4 textures, if you include obscure formats with alpha. This means alpha formats could always overwrite the first scaler texture, leading to corrupted video display. This problem was recently brought to light, when commit 571e697 started to explicitly unbind all 4 video textures, which broke rendering for non-alpha formats as well. Fix this by reserving the correct number of texture units.
* Merge remote-tracking branch 'origin/have_configure'Stefano Pigozzi2013-11-0413-59/+59
|\
| * fix weird DPMS->EXT replacementwm42013-11-041-3/+3
| |
| * Merge branch 'master' into have_configurewm42013-11-046-32/+356
| |\ | | | | | | | | | | | | Conflicts: configure
| * | configure: uniform the defines to #define HAVE_xxx (0|1)Stefano Pigozzi2013-11-0313-58/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The configure followed 5 different convetions of defines because the next guy always wanted to introduce a new better way to uniform it[1]. For an hypothetic feature 'hurr' you could have had: * #define HAVE_HURR 1 / #undef HAVE_DURR * #define HAVE_HURR / #undef HAVE_DURR * #define CONFIG_HURR 1 / #undef CONFIG_DURR * #define HAVE_HURR 1 / #define HAVE_DURR 0 * #define CONFIG_HURR 1 / #define CONFIG_DURR 0 All is now uniform and uses: * #define HAVE_HURR 1 * #define HAVE_DURR 0 We like definining to 0 as opposed to `undef` bcause it can help spot typos and is very helpful when doing big reorganizations in the code. [1]: http://xkcd.com/927/ related
* | | vo_opengl: fix use of uninitialized memorywm42013-11-041-1/+1
| |/ |/| | | | | | | Pretty bad, although it should actually not cause any misbehavior. Comes from the hardware decoding interop commit.
* | vo_opengl: add support for VA-API OpenGL interopwm42013-11-043-0/+146
| | | | | | | | | | | | | | | | VA-API's OpenGL/GLX interop is pretty bad and perhaps slow (renders a X11 pixmap into a FBO, and has to go over X11, probably involves one or more copies), and this code serves more as an example, rather than for serious use. On the other hand, this might be work much better than vo_vaapi, even if slightly slower.
* | vo_opengl: add infrastructure for hardware decoding OpenGL interopwm42013-11-045-32/+210
|/ | | | | | | | | | | | Most hardware decoding APIs provide some OpenGL interop. This allows using vo_opengl, without having to read the video data back from GPU. This requires adding a backend for each hardware decoding API. (Each backend is an entry in gl_hwdec_vaglx[].) The backends expose video data as a set of OpenGL textures. Add infrastructure to support this. The next commit will add support for VA-API.
* w32: implement functionality required for window-scalewm42013-11-021-0/+23
| | | | Same semantics with respect to fullscreen as x11.
* x11: make window-scale use windowed size in fullscreen modewm42013-11-021-2/+2
| | | | | | This is a bit more intuitive, since before, the window size was just set to something random when setting the window-scale property during fullscreen.
* Fix some more -Wshadow warningswm42013-11-011-4/+4
| | | | | | These aren't printed with newer gcc or clang versions for some reason. All of them seem to be about local variables shadowing global functions.
* Enable -Wshadowwm42013-11-011-1/+0
| | | | | | | | | This one really did bite me hard (see previous commit), so enable it by default. Fix some cases of shadowing throughout the codebase. None of these change behavior, and all of these were correct code, and just tripped up the warning.
* command: add property to scale window sizewm42013-10-312-0/+15
|
* x11: factor out normal window resize codewm42013-10-311-23/+31
| | | | | | | | As preparation for resizing the window with input commands in the following commit. Since there are already so many functions which somehow resize the window, add the word "highlevel" to the name of this new function.
* gl_common: osx: fix compilation with latest XQuartz RCStefano Pigozzi2013-10-301-1/+1
| | | | Looks the gl.h header in XQuartz is incompatible with the one in OS X 10.9.
* x11: restore support for --wid=0wm42013-10-301-2/+4
| | | | | | | | | | This stopped working when the code was changed to create a window even if --wid is used. It appears we can't create our own window in this case, because in X11 there is no difference between a window with the root window as parent, and a window that is managed by the WM. So make this (kind of worthless) special case use the root window itself.
* x11: remove ancient metacity hackwm42013-10-301-14/+1
| | | | | Tested with recent metacity; this code is not triggered anymore. The code was added in 2003 and probably has been unused for years.
* x11: minor cosmeticswm42013-10-301-16/+11
|
* gl_x11: change error message when GL3 context creation failswm42013-10-281-1/+1
| | | | | | | | | | | | | | On systems that provide legacy OpenGL (up to 2.1), but not GL3 and later, creating a GL3 context will fail. We then revert to legacy GL. Apparently the error message printed when the GL3 context creation fails is confusing. We could just silence it, but there's still a X error ("X11 error: GLXBadFBConfig"), which would be quite hard to filter out. For one, it would require messing with the X11 error handler, which doesn't even carry a context pointer (for application private data), so we don't even want to touch it. Instead, change the error message to inform the user what's actually happening: a fallback to an older version of OpenGL.
* x11_common: refactor of fstype codewm42013-10-281-102/+73
| | | | This is completely pointless, but it still somehow bugged me.
* cocoa: apply the more invasive constraining only with cmd+1/2/3Stefano Pigozzi2013-10-281-2/+10
| | | | | Regression from bc49957 Fixes #321
* x11: fix border togglingwm42013-10-272-2/+5
| | | | | | | | | | | | | Trying to toggle the border during fullscreen (with "cycle border") would leave the window stuck without border, and it couldn't be restored. This was because vo_x11_decoration() always excepted to be called when toggling the state, and thus confusing the contents of the olddecor variable. Add got_motif_hints to hopefully prevent this. Also, when changing the border, don't take fs in account. May break on older/broken WMs, but all in all is in fact more robust and simpler, because you do not need to update the border state manually when returning from fullscreen.
* vo_xv: check whether image allocation succeedswm42013-10-271-6/+24
|
* gl_common: suggest --vo=opengl-old if OpenGL 2.1 missingwm42013-10-261-1/+6
| | | | | | | If the caller requests at least OpenGL 2.1 (which --vo=opengl does), but we get OpenGL 1.x, suggest using opengl-old. Based on a patch by pfor on IRC.
* x11_common: reduce screensaver heartbeat from 30 to 10 secondswm42013-10-251-1/+1
| | | | | Apparently this fixes issues with Gnome, which has a smaller timeout. See github issue #315.
* cocoa: constraint the window position a little moreStefano Pigozzi2013-10-251-1/+6
| | | | | The intention of this is to not make the window go outside the screen when changing dimensions from 2x to .5x.
* wayland: better name for mouse coordinatesAlexander Preisinger2013-10-252-7/+7
| | | | | I had to look up what the surf_x and surf_y members do. That means the name is not very good. Also a comment.
* wayland: fix fullscreen transparent border regionsAlexander Preisinger2013-10-252-22/+30
| | | | | | | The default behavior of weston changed some time ago to not fill the surface black for fullscreen windows. Now let mpv draw the whole screen in fullscreen mode.
* m_config: refactor option defaults handlingwm42013-10-246-10/+26
| | | | | | | | | | | | | Keep track of the default values directly, instead of creating a new instance of the option struct just to get the defaults. Also get rid of the special handling of m_obj_desc.init_options. Instead, handle it purely by the option parser. Originally, I wanted to handle --vo=opengl-hq and --vo=direct3d_shaders with this (by making them aliases to the real VOs with a different preset), but since --vo =opengl-hq=help prints the wrong values (as consequence of the simplification), I'm not doing that, and instead use something different.
* video/out: remove useless info struct and redundant fieldswm42013-10-2316-117/+48
| | | | The author and comment fields were printed only in -v mode.
* vo_opengl: don't enable PBOs with opengl-hqwm42013-10-231-1/+1
| | | | | The speed advantages are marginal (at least with the way it's currently used), and it might actually be slower on some drivers, like Mesa.
* gl_video: add RGB10_A2 FBO formatwm42013-10-231-0/+1
| | | | Maybe this can be the default in the future, but I'm not sure yet.
* cocoa: set and clear gl context inside of sync sectionsStefano Pigozzi2013-10-201-6/+6
| | | | | | | The code did not set and unset the current context inside sync sections. I am not sure if this was an actual problem but this is better since the context is linked to a single thread. In my brief tests this seems to avoid garbage to show up in fullscreen.
* wayland: use mp_input_test_draggingAlexander Preisinger2013-10-202-3/+8
| | | | | | Instead of removing dragging we now test if it we should drag the window or not. Because if the OSC shows up we can not drag the window because that would cause mouse events that makes the OSC disappear.
* Revert "wayland: remove moving window by grabbing"Alexander Preisinger2013-10-201-0/+4
| | | | This reverts commit 3308bc2bc919cb8fadddad04e48b94d4e9324a34.
* Revert "wayland: remove outdated comment"Alexander Preisinger2013-10-201-0/+2
| | | | This reverts commit d75cfef49c271e43317666451f17c55e6747e564.
* mp_msg: remove gettext() supportwm42013-10-181-1/+1
| | | | | | | | | Was disabled by default, was never used, internal support was inconsistent and poor, and there has been virtually no interest in creating translations. And I don't even think that a terminal program should be translated. This is something for (hypothetical) GUIs.
* x11_common: don't handle mouse enter eventswm42013-10-151-5/+1
| | | | | | | | | | | | | | | | | | | | This could cause the OSC to be displayed without mouse interaction: for example, starting mpv with --fs, and putting the mouse to where the OSC area is beforehand, would cause the OSC to appear and stay visible. We don't want that. The simplest solution is not generating artificial mouse move events from mouse enter events, because they make the OSC think the mouse was actually moved. Also see commit 0c7978c, where handling of mouse enter events was added. This was supposed to fix certain corner cases, but they're not relevant anymore due to changes in OSC behavior. Commit 9777047 fixed this as well (by resetting the mouse state on MOUSE_LEAVE), but all the behavior reverted with this commit as perhaps a bad idea. It wasn't very robust, made it hard to distinguish real events from artificial ones, and finally made the mouse cursor more often visible than needed. (Now switching between workspaces doesn't make the cursor visible again when switching to a fullscreened mpv.)
* mplayer, vo_image: simplify OSD redrawing, fix vo_image crashwm42013-10-131-5/+0
| | | | | | | | | | | | | | | | | | vo_image didn't handle OSD redrawing correctly anymore after OSD redrawing behavior was changed in commit ed9295c (or maybe it has been a problem for a longer time, and only showed up now). Basically, flip_page was called unexpectedly and when no image was stored, which made it crash trying to access the image. This could happen when for example provoking OSD redrawing by pausing while using --vo=image, or by using this command line: mpv --vo=image '-vf=lavfi="select=not(mod(n\,3))"' Fix by removing the code that pretends vo_image can redraw OSD, and by removing the framestepping fallback, which could make bad things happen if the VO didn't support OSD redrawing. By now, there aren't any real VOs that can't redraw the OSD properly, so this code is not needed and just complicates things like vo_image. This change likely will also be useful for vo_lavc (encoding).
* cocoa: make --ontop also cover dock+menubarStefano Pigozzi2013-10-121-1/+3
| | | | | This only shows any differences when mpv isn't frontmost and is in fullscreen. Cmd+Tab overlay is still at a higher level as to avoid complete usability fail.
* cocoa: refactor precise scrolling to a separate methodStefano Pigozzi2013-10-121-4/+7
|
* cocoa: fix mouse wheel scrollingMad Fish2013-10-121-1/+1
|
* cocoa_common: check if the screen has a menubar in a more generic wayStefano Pigozzi2013-10-091-1/+3
| | | | Fixes #274
* vo_x11, vo_xv: fix OSD redrawing with --force-windowwm42013-10-062-16/+19
| | | | The window wasn't cleared in this mode before doing the redrawing.
* cocoa_common: add OS X 10.7 compatibility hacks includesStefano Pigozzi2013-10-052-0/+2
| | | | | I forgot these when I split the code. They will hopefully fix compilation on 10.7.
* gl_x11: fail gracefully if selected FBconfig has no X visualwm42013-10-031-0/+6
| | | | | | | | | | | glXGetVisualFromFBConfig() specifies specifies that it can return NULL if there is no associated X visual. Instead of crashing, let initialization fail. I'm not sure if this is actually supposed to work with a fallback visual (passing a NULL visual to vo_x11_config_vo_window would just do this), but let's play safe for now. Apparently this can happen when trying to use vo_opengl over a remote X display.
* vo_opengl_old: mp_msg conversionwm42013-10-021-74/+65
| | | | This was the only thing in video/out/ left with major mp_msg() use.
* vo: mark frame lost after seek resetwm42013-10-021-0/+1
| | | | | | | Reverts a small change made in commit ed9295c. This is needed, because otherwise mplayer.c/update_video_attached_pic() thinks it never has to update the picture after initialization. (Maybe there would be more elegant ways to handle this, but not without adding extra state.)
* core: add --force-windowwm42013-10-022-0/+6
| | | | | | | | | | | | | | | | | This commit adds the --force-window option, which will cause mpv always to create a window when started. This can be useful when pretending that mpv is a GUI application (which it isn't, but users pretend anyway), and playing audio files would run mpv in the background without giving a window to control it. This doesn't actually create the window immediately: it only does so only after initializing playback and when it is clear that there won't be any actual video. This could be a problem when starting slow or completely stuck network streams (mpv would remain frozen in the background), or if video initialization somehow is stuck forever in an in-between state (like when the decoder doesn't output a video frame, but doesn't return an error either). Well, we can pretend only so much that mpv is a GUI application.
* vo_vdpau: don't blank screen on VOCTRL_RESETwm42013-10-021-16/+35
| | | | | | | | | | | vo_vdpau is the only VO which implements VOCTRL_RESET. Redrawing the last output frame is hard, because the output could consist of several source video frames with certain types of post-processing (deinterlacing). Implement redrawing as special case by keeping the previous video frames aside until at least one new frame is decoded. This improves the previous commit, but is separate, because it's rather complicated.
* video/out: always support redrawing VO window at any pointwm4