summaryrefslogtreecommitdiffstats
path: root/video
Commit message (Collapse)AuthorAgeFilesLines
* video: cleanup stereo mode parsingwm42015-04-023-21/+20
| | | | | | | | | Use OPT_CHOICE_C() instead of the custom parser. The functionality is pretty much equivalent. (On a side note, it seems --video-stereo-mode can't be removed, because it controls whether to "reduce" stereo video to mono, which is also the default. In fact I'm not sure how this should be handled at all.)
* vdpau: fix preemption handlingDan Oscarsson2015-03-311-0/+23
| | | | Signed-off-by: wm4 <wm4@nowhere>
* video/out: remove unused colorspace reportingwm42015-03-317-58/+1
| | | | | | | | Rarely used and essentially useless. The only VO for which this was implemented correctly and for which this did anything was vo_xv, but you shouldn't use vo_xv anyway (plus it support BT.601 only, plus a vendor specific extension for BT.709, whose presence this function essentially reported - use xvinfo instead).
* video: move colorspace overrides to vf_format, simplifywm42015-03-315-50/+75
| | | | | | | | | | | | | | | | | | | Remove the colorspace-related top-level options, add them to vf_format. They are rather obscure and not needed often, so it's better to get them out of the way. In particular, this gets rid of the semi-complicated logic in command.c (most of which was needed for OSD display and the direct feedback from the VO). It removes the duplicated color-related name mappings. This removes the ability to write the colormatrix and related properties. Since filters can be changed at runtime, there's no loss of functionality, except that you can't cycle automatically through the color constants anymore (but who needs to do this). This also changes the type of the mp_csp_names and related variables, so they can directly be used with OPT_CHOICE. This probably ended up a bit awkward, for the sake of not adding a new option type which would have used the previous format.
* vf_format: don't crash if nonsense parameters are passedwm42015-03-311-3/+23
| | | | | | | It was "by design" possible to make mpv crash if the parameters didn't make enough sense, like "format=rgb24:yuv420p". While forcing the format has some minor (rather questionable) use for debugging, allowing it to crash is just stupid.
* vf_format: by default, pass through video without changewm42015-03-311-22/+17
| | | | | | Instead of forcing a useless format (packed YUV??) by default. Also cleanup.
* csputils: unify names for colorspace/etc. nameswm42015-03-311-23/+23
|
* RPI supportwm42015-03-2911-1/+865
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This requires FFmpeg git master for accelerated hardware decoding. Keep in mind that FFmpeg must be compiled with --enable-mmal. Libav will also work. Most things work. Screenshots don't work with accelerated/opaque decoding (except using full window screenshot mode). Subtitles are very slow - even simple but huge overlays can cause frame drops. This always uses fullscreen mode. It uses dispmanx and mmal directly, and there are no window managers or anything on this level. vo_opengl also kind of works, but is pretty useless and slow. It can't use opaque hardware decoding (copy back can be used by forcing the option --vd=lavc:h264_mmal). Keep in mind that the dispmanx backend is preferred over the X11 ones in case you're trying on X11; but X11 is even more useless on RPI. This doesn't correctly reject extended h264 profiles and thus doesn't fallback to software decoding. The hw supports only up to the high profile, and will e.g. return garbage for Hi10P video. This sets a precedent of enabling hw decoding by default, but only if RPI support is compiled (which most hopefully it will be disabled on desktop Linux platforms). While it's more or less required to use hw decoding on the weak RPI, it causes more problems than it solves on real platforms (Linux has the Intel GPU problem, OSX still has some cases with broken decoding.) So I can live with this compromise of having different defaults depending on the platform. Raspberry Pi 2 is required. This wasn't tested on the original RPI, though at least decoding itself seems to work (but full playback was not tested).
* vo_opengl: treat non-blended subtitles as sRGBNiklas Haas2015-03-271-32/+44
| | | | | | | | Currently, the code just skipped CMS completely. This commit treats them as sRGB by default, instead. This also refactors much of the color management code to make it more generalized and re-usable.
* vo_opengl: add FBOTEX_FUZZY aliasNiklas Haas2015-03-262-6/+5
| | | | Minor reusability factor
* vo_opengl: simplify sampler preludeNiklas Haas2015-03-261-46/+44
| | | | | This moves common re-definitions to a custom function and also shortens the names to make stuff less verbose in general.
* vo_opengl: reset surfaces on equalizer updatesNiklas Haas2015-03-261-0/+1
| | | | | This makes the VO more responsive to equalizer changes (eg. brightness) when interpolation is used.
* vo_opengl: increase shader cache sizeNiklas Haas2015-03-261-1/+1
| | | | | | | This is a minor precaution, because in some cases the number of shader programs can already hit 10. (chroma merging + separated cscale/scale + + sub blending (interpolated) + sub blending (non-interpolated) + output (interpolated) + output (non-interpolated) + OSD)
* vo_opengl: draw subtitles directly onto the videoNiklas Haas2015-03-264-60/+89
| | | | | | | | | | | | | | | | This has a number of user-visible changes: 1. A new flag blend-subtitles (default on for opengl-hq) to control this behavior. 2. The OSD itself will not be color managed or affected by gamma controls. To get subtitle CMS/gamma, blend-subtitles must be used. 3. When enabled, this will make subtitles be cleanly interpolated by :interpolation, and also dithered etc. (just like the normal output). Signed-off-by: wm4 <wm4@nowhere>
* vo_opengl: set cscale=spline36 as default for opengl-hqNiklas Haas2015-03-251-1/+1
| | | | | | | Bilinear scaling is not a suitable default for something named "hq"; the whole reason this was done in the past was because cscale used to be obscenely slow. This is no longer the case, with cscale being nearly free.
* vo_opengl: correct OSD PTS when using interpolationNiklas Haas2015-03-251-1/+22
|
* vf_vapoursynth: handle approximate EOF drainingwm42015-03-251-9/+28
| | | | | | | | | | | | | Handling this perfectly with VapourSynth is probably not possible: you either need to tell it the total number of input frames in advance, or deliver an infinite stream. With playback, EOF can happen at an unpredictable point, for which the VapourSynth API has no mechanism at all. We handle EOF by returning an error to the filter, which will the filter return all pending frame callbacks. We still can try to handle it approximately: if the filter requests a frame past EOF, then send it an error. This seems to work relatively well with filters which don't request future frames.
* vo_opengl: minor simplificationwm42015-03-251-17/+12
| | | | We don't need alternative function names in the GL loader anymore.
* vo_opengl: check extensions properlywm42015-03-251-1/+9
| | | | | | | | | With the previous commit, we have no need anymore to check a part of an extension string (for ignoring a prefix). So check the extension string properly, instead of just using the broken old strstr() method, which could accidentally ignore prefixes or suffixes. Do this by extending the check to whether the extension name is properly delimited by spaces or string start/end.
* vo_opengl: cleanup swap_control extension loadingwm42015-03-252-6/+15
| | | | | | | | | | | | | | | | Instead of somehow looking for the substring "_swap_control" and trying to several arbitrary function names, do it cleanly. The old approach has the problem that it's not very exact, and may even load a pointer to a function which doesn't exist. (Some GL implementations like Mesa return function pointers even the functions which don't exist, and calling them crashes.) I couldn't find any evidence that glXSwapInterval, wglSwapIntervalSGI, or wglSwapInterval actually exist, so don't include them. They were carried over from MPlayer times. To make diagnostics easier, print a warning in verbose mode if the function could not be loaded.
* vo_opengl: drop support for old framebuffer extensionwm42015-03-251-15/+0
| | | | | | | | Drop support for GL_EXT_framebuffer_object. It has 2 problems: semantics might be slightly different from the "proper" GL_ARB_framebuffer_object extension (but is likely completely untested), and also our extension loader is too dumb to load the same group of function pointers represented by different extensions only once.
* vo_wayland: fix null dereferenceJari Vetoniemi2015-03-231-1/+1
| | | | | If compositor sends configure event before back_buffer is allocated, it will cause null dereference.
* vo_opengl: do not block on waylandJari Vetoniemi2015-03-235-0/+31
| | | | | | | | | When not receiving frame callbacks, we should not draw anything to avoid blocking the OpenGL renderer. We do this by extending gl context api, by introducing new optional function 'is_active', that indicates whether OpenGL renderers should draw or not. This fixes issue #249.
* vo_wayland: define opaque regionJari Vetoniemi2015-03-231-0/+9
| | | | | This allows compositor to optimize rendering, as it will know mpv is not transparent.
* vo_wayland: share frame callbacks.Jari Vetoniemi2015-03-234-39/+58
| | | | | | | | Define frame callback logic in wayland_common.c As this should be used by opengl renderer as well. Preferably drawing should be skipped entierly when no frame callbacks are received. However, for now only swap buffers is skipped.
* mp_image: reject 0-sized imageswm42015-03-231-2/+1
| | | | | | Like FFmpeg/Libav do. It seems not all code can actually deal with this situation, so it's better to shift the special-cases to code which needs it (possibly OSD code; screenshots of 0x0 windows would just fail).
* vo_opengl: fix XYZ input gammaNiklas Haas2015-03-231-1/+1
| | | | | This seems to have been a mistranslation from the original code, which multiplied the gamma by 2.6 (*not* the color itself).
* vo_vdpau: remove some minor code duplicationwm42015-03-231-13/+7
| | | | | The way-too-big API call for clearing the screen can be easily shared between two completely different codepaths.
* vo_vdpau: check vdpau API return valuewm42015-03-231-0/+1
|
* vdpau: remove dead assignmentwm42015-03-231-2/+1
| | | | | | I guess we don't really care whether this particular function succeeds. If it fails, it must be completely broken anyway and it would not matter much to us.
* vo_opengl: remove dead assignmentwm42015-03-231-3/+3
|
* vo_opengl_cb: don't render OSD while VO is not createdwm42015-03-234-15/+25
| | | | | | | | | | | Unlike other VOs, this rendered OSD even while no VO was created (because the renderer lives as long as the API user wants). Change this, and refactor the code so that the OSD object is accessible only while the VO is created. (There is a short time where the OSD can still be accessed even after VO destruction - this is not a race condition, though it's inelegant and unfortunately unavoidable.)
* vo_opengl: move OSD rendering to separate functionwm42015-03-231-39/+41
| | | | | Also reindent the few lines that call into the actual renderer to remove the "draw_osd" goto.
* vo_opengl: fix video equalizer gamma controlswm42015-03-221-1/+4
| | | | It was ignored.
* vo_opengl: fix background color optionwm42015-03-211-7/+5
| | | | | | gl_video_set_options() didn't update it, so the default value set on initialization was used. Fix by always setting the clear color before the clear command; it's slightly easier to follow too.
* vo_opengl: fix bicubic_fast scalerwm42015-03-211-1/+1
|
* vd_lavc: less confusing message when hardware decoding won't workwm42015-03-201-2/+3
| | | | | | Codecs for hardware acceleration are not blacklisted, but whitelisted. Also, if this emssage is printed, the codec might not have any hardware acceleration support in the first place.
* 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