summaryrefslogtreecommitdiffstats
path: root/video
Commit message (Collapse)AuthorAgeFilesLines
* gl_x11: change error message when GL3 context creation failswm42013-11-021-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.
* cocoa: apply the more invasive constraining only with cmd+1/2/3Stefano Pigozzi2013-11-021-2/+10
| | | | | Regression from bc49957 Fixes #321
* x11: fix border togglingwm42013-11-022-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-11-021-6/+24
|
* gl_common: suggest --vo=opengl-old if OpenGL 2.1 missingwm42013-11-021-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-11-021-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-11-021-1/+6
| | | | | The intention of this is to not make the window go outside the screen when changing dimensions from 2x to .5x.
* wayland: fix fullscreen transparent border regionsAlexander Preisinger2013-11-022-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.
* gl_video: add RGB10_A2 FBO formatwm42013-11-021-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-11-021-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.
* vdpau_old: restore hardware decoding with old APIwm42013-10-201-0/+1
| | | | --hwdec=vdpau did nothing with older ffmpeg/libav versions. Oops.
* sws_utils: work around libswscale crash with --contrast=-100wm42013-10-201-1/+2
|
* vf_scale: fix get/set confusionwm42013-10-201-1/+1
| | | | This caused the equalizer controls to appear stuck.
* 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).
* talloc: change talloc destructor signaturewm42013-10-133-8/+4
| | | | | | | | | | | | | Change talloc destructor so that they can never signal failure, and don't return a status code. This makes our talloc copy even more incompatible to upstream talloc, but on the other hand this is preparation for getting rid of talloc entirely. (The talloc replacement in the next commit won't allow the talloc_free equivalent to fail, and the destructor return value would be useless. But I don't want to change any mpv code either; the idea is that the talloc replacement commit can be reverted for some time in order to test whether the talloc replacement introduced a regression.)
* 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.
* cosmetics: replace "CTRL" defines by enumswm42013-10-022-17/+21
| | | | Because why not.
* 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-023-1/+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 pointwm42013-10-028-15/+73
| | | | | | | | | | | | | | | | | | | | | | | | | | | Before, a VO could easily refuse to respond to VOCTRL_REDRAW_FRAME, which means the VO wouldn't redraw OSD and window contents, and the player would appear frozen to the user. This was a bit stupid, and makes dealing with some corner cases much harder (think of --keep-open, which was hard to implement, because the VO gets into this state if there are no new video frames after a seek reset). Change this, and require VOs to always react to VOCTRL_REDRAW_FRAME. There are two aspects of this: First, behavior after a (successful) vo_reconfig() call, but before any video frame has been displayed. Second, behavior after a vo_seek_reset(). For the first issue, we define that sending VOCTRL_REDRAW_FRAME after vo_reconfig() should clear the window with black. This requires minor changes to some VOs. In particular vaapi makes this horribly complicated, because OSD rendering is bound to a video surface. We create a black dummy surface for this purpose. The second issue is much simpler and works already with most VOs: they simply redraw whatever has been uploaded previously. The exception is vdpau, which has a complicated mechanism to track and filter video frames. The state associated with this mechanism is completely cleared with vo_seek_reset(), so implementing this to work as expected is not trivial. For now, we just clear the window with black.
* x11: remove colormap code, always request TrueColor visualswm42013-09-303-164/+17
| | | | | | | | | | | | | | | | | | | | vo_x11 had a clever trick to implement a video equalizer: it requested a DirectColor visual. This is a X11 mechanism which allows you to specify a lookup table for each color channel. Effectively, this is a safe override for the graphic card's gamma ramp. If X thinks the window deserves priority over other windows in the system, X would temporarily switch the gamma ramp so that DirectColor visuals can be displayed as the application intends. (I'm not sure what the exact policy is, but in practice, this meant the equalizer worked when the mouse button was inside the window.) But all in all, this is just lots of useless code for a feature that is rarely ever useful. Remove it and use the libswscale equalizer instead. (This comes without a cost, since vo_x11 already uses libswscale.) One worry was that using DirectColor could have made it work better in 8-bit paletted mode. But this is not the case: there's no difference, and in both cases, the video looks equally bad.
* vf_scale: factor out libswscale equalizer controlwm42013-09-303-23/+34
| | | | Will be used by vo_x11.
* vaapi: remove non-VLD entrypointswm42013-09-291-6/+2
| | | | | These probably don't work. libavcodec doesn't seem to support them, and neither did the original mplayer-vaapi patch.
* vaapi: fix non-sense conditionwm42013-09-291-1/+1
| | | | Attempting signed comparison on unsigned value.
* vaapi: fix inverted conditionwm42013-09-291-2/+2
| | | | | | How embarrassing. This could make --hwdec=vaapi-copy as well as screenshots with vo_vaapi randomly fail. Regression since commit b8382aa.
* cocoa_common: call gl_clear indirectlyStefano Pigozzi2013-09-283-2/+23
| | | | | | | glClear needs GL headers and we don't want those in `cocoa_common`. Create a callback in `gl_cocoa` and register it `cocoa_common`. Fixes #264
* cocoa_common: fix deadlockStefano Pigozzi2013-09-281-5/+7
| | | | | | | After rebasing my dev branch it turned out that the code deadlocked on recursive calls of `vo_control`. Make the locking code a little bit smarter by making always skip locking/unlocking if we are executing a chunck of code that is already synchronized with `dispatch_sync`.
* cocoa_common: report pixels instead of points during mouse movementStefano Pigozzi2013-09-281-5/+15
| | | | | | | This fixes the position reporting on retina displays. Doesn't make any difference on normal displays where 1px = 1pt. Fixes: #260
* cocoa_common: split the code, refactoring and cleanupsStefano Pigozzi2013-09-289-512/+715
| | | | | | | | | Split the code to several files. The GUI elements now each have they own files and private state. The original code was a mess to respect the retarded mplayer convention of having everything in a single file. This commit also seems to fix the long running bug of artifacts showing randomly when going fullscreen using nVidia GPUs.
* vaapi: make vaDeriveImage() less verbosewm42013-09-271-1/+1
| | | | | This can just be not supported, so making it look like a real error doesn't make much sense.
* vaapi: check image format in va_surface_upload()wm42013-09-273-6/+9
| | | | Just for robustness. Also print a warning in vo_vaapi if this happens.
* vaapi: potentially make reading surfaces back to system RAM fasterwm42013-09-274-33/+64
| | | | | | | | Don't allocate a VAImage and a mp_image every time. VAImage are cached in the surfaces themselves, and for mp_image an explicit pool is created. The retry loop runs only once for each surface now. This also makes use of vaDeriveImage() if possible.
* input: translate mouse position to OSD space earlywm42013-09-271-1/+3
| | | | | | | | | | | | | | Until now, mouse positions were just passed to the core as-is, even if the mouse coordinates didn't map to any useful coordinate space, like OSD coordinates. Lua scripting (used by the OSC, the only current user of mouse input) had to translate mouse coordinates manually to OSD space using mp_get_osd_mouse_pos(). This actually didn't work correctly in cases mouse coordinates didn't map to OSD (like vo_xv): the mouse coordinates the OSC got were correct, but input.c was still expecting "real" mosue coordinates for mouse areas. Fix this by converting to OSD coordinates before passing the mouse position to the core.
* video: let sh_video->disp_w/h always be container sizewm42013-09-261-4/+1
| | | | | | | Nothing really accesses it. Subtitle initialization actually does in a somewhat meaningful way, but there container size is probably fine, as subtitles were always initialized before the first video frame was decoded.
* video: let sh_video->aspect always be container aspect ratiowm42013-09-262-11/+14
| | | | | | | Now writing -1 to the 'aspect' property resets the video to the auto aspect ratio. Returning the aspect from the property becomes a bit more complicated, because we still try to return the container aspect ratio if no frame has been decoded yet.
* vd: move aspect calculation to a functionwm42013-09-263-24/+25
| | | | | | | | This function would probably be useful in other places too. I'm not sure why vd.c doesn't apply the aspect if it changes size by less than 4 pixels. Maybe it's supposed to avoid ugly results with bad scalers if the difference is too small to be noticed normally.
* vd: remove some dead codewm42013-09-261-14/+4
| | | | | As of now, this function is called only after decoding a full, valid video frame, so the image parameters should be reliable.
* Fix previous commitwm42013-09-251-4/+0
| | | | | | | This time it broke because I didn't actually test compiling vo_vaapi.c, and it was using a macro from mp_image.h, which implicitly assumed FFALIGN was available. Screw that too, and copy the definition of ffmpeg's FFALIGN to MP_ALIGN_UP, and move these macros to mp_comnon.h.
* vaapi: fix compilation with Libavwm42013-09-252-6/+3
| | | | | | | | | | | The code using FFSWAP was moved from vo_vaapi.c to vaapi.c, which didn't include libavutil/common.h anymore, just libavutil/avutil.h. The header avutil.h doesn't include common.h recursively in Libav, so it broke there. Add FFSWAP as MPSWAP in mp_common.h (copy pasted from ffmpeg) to make sure this doesn't happen again. (This kind of stuff happens all too often, so screw libavutil.)
* vaapi: allow GPU read-back with --hwdec=vaapi-copywm42013-09-253-3/+108
| | | | | | | | | | | | | | This code is actually quite inefficient: it reuses the (slow, simple) screenshot code. It uses an inefficient method to read the image (vaGetImage() instead of vaDeriveImage()), allocates new memory for each frame that is read, and it tries all image formats again each time. Also, in my tests it always picked NV12 as image format, which is not ideal if you actually want to filter the video, and vo_xv can't handle this format without conversion either. However, a user confirmed that it worked for him, so everything is fine.
* vd_lavc: allow process_image to change image formatwm42013-09-252-18/+21
| | | | | | | | | | | | | | This will allow GPU read-back with process_image. We have to restructure how init_vo() works. Instead of initializing the VO before process_image is called, rename init_vo() to update_image_params(), and let it update the params only. Then we really initialize the VO after process_image. As a consequence of these changes, already decoded hw frames are correctly unreferenced if creation of the filter chain fails. This could trigger assertions on VO uninitialization, because it's not allowed to reference hw frames past VO lifetime.
* vaapi: add vf_vavpp and use it for deinterlacingxylosper2013-09-258-521/+1100
| | | | | | | | Merged from pull request #246 by xylosper. Minor cosmetic changes, some adjustments (compatibility with older libva versions), and manpage additions by wm4. Signed-off-by: wm4 <wm4@nowhere>
* wayland: remove outdated commentAlexander Preisinger2013-09-241-2/+0
|
* wayland: remove moving window by grabbingAlexander Preisinger2013-09-241-4/+0
| | | | | | Moving the window was convenient but generates a MOUSE_LEAVE event which it shouldn't. Now we remove it, because it is still possible to move the window in weston with MOD+BTN0.
* vo_lavc: mp_msg conversionwm42013-09-201-34/+27
| | | | Also restores consistent log message prefixes with ao_lavc.
* vo/x11_common: don't require a working input methodwm42013-09-201-14/+9
| | | | | | | Normally, we need this for Xutf8LookupString(). But we can just fall back to XLookupString(). In fact, the code for this was already there, the code was just never tested and was actually crashing when active (see commit 2115c4a).
* vf: fix filter initialization error checkwm42013-09-201-1/+1
| | | | | vf_open returns 0 on error, 1 on success. Oops. Accidentally broken with 6629a95.
* vo/x11_common: remove superfluous msg prefixesMartin Herkt2013-09-201-2/+2
|
* vo/x11_common: Fail init with no valid XIMMartin Herkt2013-09-191-0/+9
| | | | | | XOpenIM can fail to find a valid input method, in which case it returns NULL. Passing a NULL pointer to XCreateIC would cause a crash, so fail VO init before that happens.
* wayland/common: exit properly on fd errorsAlexander Preisinger2013-09-191-2/+6
| | | | | | | Before this commit there was just an error message, but the file descriptor was still open. Now we close the file descriptor and prevent it from calling endlessly. Also a CLOSE_WIN event is sent which closes the window eventually if the action of CLOSE_WIN is set to quit or quit_watch_later.
* vo_opengl: blend alpha components by defaultw