summaryrefslogtreecommitdiffstats
path: root/video
Commit message (Collapse)AuthorAgeFilesLines
* player: better handling of video with no timestampswm42015-03-201-1/+7
| | | | | | | | | | | Trying to handle such video is almost worthless, but it was requested by at least 2 users. If there are no timestamps, enable byte seeking by setting ts_resets_possible. Use the video FPS (wherever it comes from) and the audio samplerate for timing. The latter was already done by making the first packet emit DTS=0; remove this again and do it "properly" in a higher level.
* vo_xv: remove pointless castwm42015-03-201-2/+1
|
* vf_expand: fix memory leak on memory allocation failurewm42015-03-201-1/+3
| | | | Isn't it ironic.
* mp_image: do not assume trailing stride padding existswm42015-03-201-4/+4
| | | | | | | | | | | | Normally, the size of an mage plane is assumed to be stride*height. But in theory, if stride is larger than width*bpp, the last line might not be padded, simply because it's not necessary. FFmpeg's or mpv's image allocators always guarantee that this padding exists (it wastes some insignificant memory for avoiding such subtle issues), but some other libraries might not. I suspect one such case might be Xv via vo_xv (see #1698), although my X server appears to provide full padding. In any case, it can't harm.
* video: uninline memcpy_pic functionswm42015-03-2015-92/+53
| | | | | | | | | There's literally no reason why these functions have to be inline (they might be performance critical, but then the function call overhead isn't going to matter at all). Uninline them and move them to mp_image.c. Drop the header file and fix all uses of it.
* video: replace pointless macrowm42015-03-202-9/+4
| | | | Some old absurdity.
* mp_image: remove unneeded thingswm42015-03-202-39/+16
| | | | (But I'd really prefer removing our own refcounting mechanism fully.)
* player: warn against non-monotonic video PTS only oncewm42015-03-181-5/+0
| | | | | | | | For some reason there were two points in the code where it warned against non-monotonic video PTS. The one in video.c triggered on PTS going backwards or making large jumps forwards, while dec_video.c triggered on PTS going backwards or PTS not changing. Merge them into a single check, which warns against all cases.
* osd: simplify an aspect of change detection handlingwm42015-03-186-75/+59
| | | | | | | | | | | | | | | | | | There was a somewhat obscure optimization in the OSD and subtitle rendering path: if only the position of the sub-images changed, and not the actual image data, uploading of the image data could be skipped. In theory, this could speed up things like scrolling subtitles. But it turns out that even in the rare cases subtitles have such scrolls or axis-aligned movement, modern libass rarely signals this kind of change. Possibly this is because of sub-pixel handling and such, which break this. As such, it's a worthless optimization and just introduces additional complexity and subtle bugs (especially in cases libass does the opposite: incorrectly signaling a position change only, which happened before). Remove this optimization, and rename bitmap_pos_id to change_id.
* vd_lavc: change message about using hardware decodingwm42015-03-171-1/+1
| | | | This was requested. Apparently some find the old mesage confusing.
* video: don't drop anamorphic scaling if it's too minorwm42015-03-161-8/+1
| | | | | | | | | This played e.g. a 1264x722 file as 1264x720. There was some code which dropped the aspect ratio if the video (in original resolution) wasn't scaled by more than 4 pixels. Commit 5f3c3f8c introduced this (although I'm not really sure what the code replaced by it did). Just remove this "feature".
* vo_opengl: reduce number of uniforms in dithering passwm42015-03-161-8/+5
| | | | | | | We now update uniforms every time, so we should try to reduce the number of uniforms to avoid performance penalties. (Originally, some caching was planned, but it looks like it would be too complicated to implement compared to the expected gains.)
* vo_opengl: move glViewport call closer to draw callwm42015-03-162-2/+3
|
* vo_opengl: fix srgb replacement optionsJames Ross-Gowan2015-03-161-1/+1
| | | | | | OPT_REPLACED can't specify option values or multiple options. Change to OPT_REMOVED. Also, target-prim doesn't have an srgb option. BT.709 uses sRGB primaries, so use it instead.
* vo_opengl: fix incorrectly drawn OSD in idle modewm42015-03-161-2/+2
| | | | | | Trade one bug for another, I don't even care anymore. Fixes #1691.
* vo_opengl: apply OSD color managementNiklas Haas2015-03-161-24/+39
|
* vo_opengl: improve queue size heuristicNiklas Haas2015-03-161-1/+1
| | | | | | | | The default scaling was a slight bit too low, which could cause buffer underruns in some cases. This should improve the result when using tscale filters other than oversample. The oversample case should be unaffected.
* vo_opengl: improve interpolation diagnosticsNiklas Haas2015-03-161-6/+9
| | | | | | This adds extra debugging output for buffer underruns, to help track down possible queueing issues. It also inverts the numberic output for tscale=oversample to make more sense, without changing the logic.
* vo_opengl: color manage after interpolationNiklas Haas2015-03-161-13/+18
| | | | | | | | | | | | This moves the color management code out of pass_render_main (which is now dedicated solely to up/downscaling and hence renamed pass_scale_main) and into a new function, which gets called from pass_draw_to_screen instead. This makes more sense from a logical standpoint, and also means that we interpolate in linear RGB, before color management - rather than after it, which is significantly better for color accuracy and probably also interpolation quality.
* filter_kernels: add comment to prevent confusionNiklas Haas2015-03-151-0/+2
| | | | There are conflicting definitons of Ginseng.
* vo_opengl: add oversample support for tscaleNiklas Haas2015-03-151-24/+45
| | | | | This is interesting mainly because it's essentially equivalent to the old smoothmotion algorithm. As such, it is now the default for tscale.
* vo_opengl: add oversample scalerNiklas Haas2015-03-151-0/+38
| | | | | | This is like nearest neighbour, but the edges between pixels are linearly interpolating if needed, as if they had been (naively) oversampled.
* vo_opengl: refactor smoothmotion -> interpolationNiklas Haas2015-03-154-88/+159
| | | | | | | | | | | | | This replaces the old smoothmotion code by a more flexible tscale option, which essentially allows any scaler to be used for interpolating frames. (The actual "smoothmotion" scaler which behaves identical to the old code does not currently exist, but it will be re-added in a later commit) The only odd thing is that larger filters require a larger queue size offset, which is currently set dynamically as it introduces some issues when pausing or framestepping. Filters with a lower radius are not affected as much, so this is identical to the old smoothmotion if the smoothmotion interpolator is used.
* vo_opengl: increase the number of video buffersNiklas Haas2015-03-151-12/+16
| | | | | | Also the size is now a simple #define that can easily be changed later. This is done for smoothmotion, which might want to blend more than 4 frames at once, depending on the setting.
* vo_opengl: remove hwdec unmap_image callbackwm42015-03-145-22/+1
| | | | Not needed anymore; see previous commit.
* vo_opengl: silence vdpau hwdec warnings with smoothmotionwm42015-03-141-4/+10
| | | | | | | | | | | | | | | | Since the gl_rework merge, this started to print some OpenGL errors when using vdpau hardware decoding with vo_opengl smoothmotion. This happens because some hwdec unmap_image call were not paired with a map_image call. Unlike the old vo_opengl, the new code does not do this out of convenience (it would be a pain to track this exactly). It was triggered by smoothmotion, because not every rendered frame has actually a new input video frame (i.e. no map_image call, but it called unmap_image anyway). Solve this by handling unmapping differently in the vdpau code. The next commit will remove the unmap_image callback completely. Fixes #1687.
* vo_opengl: only clamp when necessaryNiklas Haas2015-03-141-2/+2
| | | | | This essentially makes it so that every gamma function that crops up somewhere has a corresponding clamp in front of it.
* cocoa: signal VO_EVENT_WIN_STATE on fps changeStefano Pigozzi2015-03-141-0/+2
| | | | Fixes #1686
* vo_opengl: fix incorrect wording in commentNiklas Haas2015-03-141-1/+1
| | | | | "compand" was used where the actual operation was "compress". Change to avoid confusion.
* vo_opengl: fix uninitialization logicNiklas Haas2015-03-141-1/+8
| | | | | The FBOs we use never actually got cleaned up anywhere, and the vimg planes were hard-coded to only clean up 3.
* vo_opengl: apply alpha after conversion to rgbNiklas Haas2015-03-131-12/+7
| | | | | Currently this was done before conversion, which could fuck up a hypothetical YUVA stream.
* vo_opengl: replace float array with a structwm42015-03-134-59/+64
| | | | Slightly less painful, because C arrays suck.
* vo_opengl: remove unused declarationwm42015-03-131-5/+0
| | | | Stupid compiler.
* vo: make sure display-fps is up-to-datewm42015-03-131-2/+8
| | | | Sigh.
* win32: support get display fpsAvi Halachmi (:avih)2015-03-131-0/+54
|
* command: fix display-fps property (again)wm42015-03-132-7/+24
| | | | | | | This caused complaints because the fps was basically rounded on microsecond boundaries in the vsync interval (it seemed convenient to store only the vsync interval). So store the fps as float too, and let the "display-fps" property return it directly.
* vo_opengl: restore GL(ES) 2 compatibilitywm42015-03-131-0/+2
|
* vo_opengl: don't test for arrayswm42015-03-133-8/+2
| | | | | | Even the lowest supported GL versions have arrays. This test was for returning arrays from functions, which didn't work in lower GL versions, but we don't need it anymore.
* vo_opengl: minor fix to a commentwm42015-03-131-2/+2
|
* w32_common: don't hide cursor when the menu is openJames Ross-Gowan2015-03-131-8/+8
| | | | | | | | | | | | Previously, mpv would hide the cursor when the autohide timer expired, even if the window menu was open. This made it difficult to use the menu with the mouse. When handling VOCTRL_SET_CURSOR_VISIBILITY, instead of determining whether to call SetCursor by checking if the cursor is in the client area, call it based on the parameters to the last WM_SETCURSOR message. When the window enters "menu mode," it gets a WM_SETCURSOR message with HIWORD(lParam) set to 0 to indicate that the cursor shouldn't be set.
* vo_opengl: sample from the right tex for separated scalersNiklas Haas2015-03-131-8/+8
| | | | | These were still hard-coded to texture0, rather than respecting src_tex like they should. A simple oversight.
* command: display-fps is the display FPS as assumed by the VOwm42015-03-121-1/+1
| | | | | | | | | Requested change in behavior. Note that we set the assumed "infinite" display_fps to 1e6, which conveniently lets vo_get_vsync_interval() return a dummy value of 1, which can be easily checked against, and still avoids doing math with float INFs.
* vo: update FPS only on state changeswm42015-03-122-13/+33
| | | | | | | | I'm not comfortable with VOCTRL_GET_DISPLAY_FPS being called every frame. This requires the VO to set VO_EVENT_WIN_STATE if the FPS could have changed. At least the X11 backend does this.
* vo_opengl: refactor shader generation (part 2)Niklas Haas2015-03-127-199/+706
| | | | | | | | | | | | | | | | | | | | | | | | | | | This adds stuff related to gamma, linear light, sigmoid, BT.2020-CL, etc, as well as color management. Also adds a new gamma function (gamma22). This adds new parameters to configure the CMS settings, in particular letting us target simple colorspaces without requiring usage of a 3DLUT. This adds smoothmotion. Mostly working, but it's still sensitive to timing issues. It's based on an actual queue now, but the queue size is kept small to avoid larger amounts of latency. Also makes “upscale before blending” the default strategy. This is justified because the "render after blending" thing doesn't seme to work consistently any way (introduces stutter due to the way vsync timing works, or something), so this behavior is a bit closer to master and makes pausing/unpausing less weird/jumpy. This adds the remaining scalers, including bicubic_fast, sharpen3, sharpen5, polar filters and antiringing. Apparently, sharpen3/5 also consult scale-param1, which was undocumented in master. This also implements cropping and chroma transformation, plus rotation/flipping. These are inherently part of the same logic, although it's a bit rough around the edges in some case, mainly due to the fallback code paths (for bilinear scaling without indirection).
* vo_opengl: refactor shader generation (part 1)wm42015-03-129-1990/+1280
| | | | | | | | | | | | | | | | | | | The basic idea is to use dynamically generated shaders instead of a single monolithic file + a ton of ifdefs. Instead of having to setup every aspect of it separately (like compiling shaders, setting uniforms, perfoming the actual rendering steps, the GLSL parts), we generate the GLSL on the fly, and perform the rendering at the same time. The GLSL is regenerated every frame, but the actual compiled OpenGL-level shaders are cached, which makes it fast again. Almost all logic can be in a single place. The new code is significantly more flexible, which allows us to improve the code clarity, performance and add more features easily. This commit is incomplete. It drops almost all previous code, and readds only the most important things (some of them actually buggy). The next commit will complete it - it's separate to preserve authorship information.
* x11: ignore mouse enter/leave events due to pointer grabwm42015-03-111-0/+4
| | | | | | | | | | | If you click on a window that doesn't have a focus, a LeaveNotify followed by a EnterNotify event can be generated. The former will have mode set to NotifyGrab, the latter to NotifyUngrab. This will make the player think the mouse left the window, even though this is not the case. Ignore these and only react to those with mode set to NotifyNormal. Probably fixes #1672, and some other strange issues on some WMs.
* vo: hide opengl-cb in --vo=helpwm42015-03-101-1/+1
| | | | Avoids stupid questions.
* vo_opengl_cb: clear last video frame on uninit()wm42015-03-101-8/+9
| | | | | | | | | | | | mpv_opengl_cb_render() is supposed to clear the screen with the background color if there's no video... I think. It didn't do this, because although uninit() requested gl_video_config() to be called, this didn't happen, because this function checks whether the VO is set - and it's unsert after uninit() releases the lock. Also call the user wakeup callback in this situation, so the user actually redraws immediately.
* vo_opengl: move minor helper to common codewm42015-03-093-10/+6
| | | | | The generic image format code should cary most of the "knowledge" about image formats.
* w32_common: remove redundant is_maximized functionJames Ross-Gowan2015-03-091-8/+1
| | | | This already exists as IsMaximized in the Windows API.
* cocoa: fix minimized state getterStefano Pigozzi2015-03-091-5/+2
|
* x11: fix VOCTRL_GET_WIN_STATEwm42015-03-091-0/+1
| | | | | | | | | | Do not rely on the pointed-to argument to be initialized; VOCTRLs are supposed to completely overwrite them on success (or not to touch them on failure). The currently only caller of VOCTRL_GET_WIN_STATE initializes the value before calling this, so this is merely about correctness and didn't lead to any actual bugs.
* w32_common: support the "window-minimized" propertyJames Ross-Gowan2015-03-091-0/+6
|
* cocoa: support the "window-minimized" propertyJaime Marquínez Ferrándiz2015-03-082-0/+32
| | | | Signed-off-by: Stefano Pigozzi <stefano.pigozzi@gmail.com>
* vf_vavpp: fix deinterlacingFilip Milivojevic2015-03-081-0/+8
| | | | | | | Add filter parameters to VAAPI deinterlacing filter to actually process bottom fields instead of deinterlacing top field twice. Signed-off-by: wm4 <wm4@nowhere>
* cocoa: fix autohide in fullscreenStefano Pigozzi2015-03-084-5/+26
|
* cocoa: fix mouse hiding with launchpad and dock foldersStefano Pigozzi2015-03-083-1/+18
| | | | | | | | | | | | Some UI elements in OS X – like Launchpad and Dock folders – are implemented using borderless windows in background demonized applications. When we use these elements, mpv doesn't stop to be the active application, but the mpv window leaves keyWindow state while we use the OS controls. This commit just keeps track of window state to update the cursor visibility accordingly. Fixes #513
* cocoa: clamp mouse position to window.torque2015-03-071-0/+2
| | | | | Prevents out-of-window coordinates being reported for mouse coordinates. Previously they could be out-of-window coordinates on init or on resize.
* cocoa: update mouse coordinates when window is initialized.torque2015-03-073-2/+4
| | | | | | Make MpvEventsView -signalMousePosition a public method so it can be called without a compiler warning. Previously, the mouse position would be reported as (0,0) until the cursor was moved.
* cocoa: don't uninit light sensor if not presentStefano Pigozzi2015-03-071-2/+4
|
* vo_opengl/x11: fix automatic ICC profile loadingMartin Herkt2015-03-072-6/+11
| | | | | | | | | | | | mpv would attempt to load ICC profiles several times during VO init even if no window is displayed. This potentially causes it to load a profile for a different screen than it is going to be displayed on, thereby invalidating the profile cache and rebuilding the LUT every single time. It would not unload a previously loaded profile when the video window is moved to a display without an installed profile. Fix these issues and tweak the log messages a little.
* cocoa: remove possible use after freeStefano Pigozzi2015-03-071-5/+5
|
* cocoa: fix some crashes caused by async uninitStefano Pigozzi2015-03-071-31/+15
| | | | | | | Always keep around our private state and destroy it when we are really done in the async uninit callback. Fixes #1657
* vo_vaapi: fix video equalizer (second try)wm42015-03-061-12/+36
| | | | | | | | | | | | The vaapi equalizer have a custom range, and can have a smaller range than mpv's normalized video equalizer values. The result is that a vaapi equalizer value can map to multiple mpv values, so changing a mpv value by 1 can get "stuck". Fix by remember the mpv value, and returning it if it still corresponds to the vaapi value. Really fixes #1647. (Why am I even bothering with this irredeemable crap?)
* vo_opengl: make smoothmotion-threshold inclusiveNiklas Haas2015-03-051-2/+2
| | | | | This behavior makes more sense near the borders, eg. smoothmotion-threshold=0 and smoothmotion-threshold=0.5.
* vd_lavc: let --hwdec=auto select "vaapi-copy"wm42015-03-051-1/+1
| | | | | | | | | | | | Instead of "vaapi", simply by changing the probe order. "vaapi" uses the GLX GL interop, which has causing us more problems than it solved. Unfortunately this leads also to copying if "--hwdec=auto --vo=vaapi" is used, even though GLX is not involved in this case - but I don't care enough to make the probe logic cleverer just for this. You can still get the zero-copy path with --hwdec=vaapi.
* vo_vaapi: round equalizer valueswm42015-03-051-2/+5
| | | | |