summaryrefslogtreecommitdiffstats
path: root/video
Commit message (Collapse)AuthorAgeFilesLines
* vf_vapoursynth: reset error state on seekingwm42014-07-051-0/+1
| | | | | | | | | | | | When seeking, we violently destroy the filter, because vapoursynth has no proper API for terminating a video with unknown frame count. This looks like an error to vapoursynth, and the error is returned via the frame callbacks. The bug is that we remember this error state across reinitialization, so on the first filter call after reinitialization, we thought filtering the current frame failed. This caused a shift by 1 frame on each seek. CC: @mpv-player/stable
* x11: clear window only on initial mapwm42014-07-051-1/+2
| | | | | | | | | | | | | | | | | | | Apparently clearing on every map can cause problems with vdpau when switching virtual desktops and such. This was observed with at least XMonad and nvidia-340.17. It's not observed on some other setups without XMonad. It's not clear why this happens. Normally, the window background is not saved, so clearing should have no additional affect. It's a complete mystery. Possible, the use of legacy X drawing commands (used to clear the window) interferes with vdpau operation in non-trivial ways. Work this around by clearing on initial map only. This probably only hides the underlying issue, but good enough. Closes #897. CC: @mpv-player/stable
* vo_opengl: Make approx-gamma affect OSD/subNiklas Haas2014-06-222-4/+8
| | | | | | Close #837 Signed-off-by: wm4 <wm4@nowhere>
* video: Include better heuristics for guessing primariesNiklas Haas2014-06-223-4/+25
| | | | | | | These consult the vertical resolution, matching against 576 for PAL and 480/486 for NTSC. The documentation has also been updated. Signed-off-by: wm4 <wm4@nowhere>
* video: Refactor rendering intent for DCP XYZ and :srgbNiklas Haas2014-06-223-59/+98
| | | | | | Notably, we now conform to SMPTE 428-1-2006 when decoding XYZ12 input, and we can support rendering intents other than colorimetric when converting between BT.709 and BT.2020, like with :srgb or :icc-profile.
* video: Better support for XYZ inputNiklas Haas2014-06-224-11/+67
| | | | | | | | | With this change, XYZ input is directly converted to the output colorspace wherever possible, and to the colorspace specified by the tags and/or --primaries option, otherwise. This commit also restructures some of the CMS code in gl_video.c to hopefully make it clearer which decision is being done where and why.
* video: Generate an accurate CMS matrix instead of hard-codingNiklas Haas2014-06-225-129/+290
| | | | | | | | | This also avoids an extra matrix multiplication when using :srgb, making that path both more efficient and also eliminating more hard-coded values. In addition, the previously hard-coded XYZ to RGB matrix will be dynamically generated.
* video: Support BT.2020 constant luminance systemNiklas Haas2014-06-225-12/+73
| | | | Signed-off-by: wm4 <wm4@nowhere>
* options: Expose --colormatrix-primaries to the userNiklas Haas2014-06-221-0/+2
| | | | Signed-off-by: wm4 <wm4@nowhere>
* video: Add support for non-BT.709 primariesNiklas Haas2014-06-228-17/+187
| | | | | | | This add support for reading primary information from lavc, categorized into BT.601-525, BT.601-625, BT.709 and BT.2020; and passes it on to the vo. In vo_opengl, we always generate the 3dlut against the wider BT.2020 and transform our source into this colorspace in the shader.
* video: Add BT.2020-NCL colorspace and transfer functionNiklas Haas2014-06-224-16/+33
| | | | Source: http://www.itu.int/dms_pubrec/itu-r/rec/bt/R-REC-BT.2020-0-201208-I!!PDF-E.pdf
* vo_xv: de-ancient some help messageswm42014-06-211-10/+2
| | | | | One message pointed to a removed file, so just get rid of the messages. They were helpful in the earlier 2000s, but now they're just confusing.
* vo_vaapi: fix reference counting when using software decodingwm42014-06-201-1/+2
| | | | Recent regression.
* vf_dlopen: fix the order of the arguments to mp_image_allocMarcoen Hirschberg2014-06-191-2/+2
|
* vo_wayland: fix clearing the screen on reconfigwm42014-06-181-12/+11
| | | | | | Do this simply by clearing the mapped buffer on every draw_image() call without an actual video frame. (Maybe this is a bit expensive, but at least not more expensive than regular video display.)
* vo_sdl: fix clearing the screen on reconfigwm42014-06-181-35/+53
| | | | | | Clear the texture on reconfig(). (We could probably also do this simpler with a flag, but this is actually less complicated - except that we move the code to "map" a texture to a separate function.)
* video/out: fix redrawing with no video frame for some VOswm42014-06-185-31/+15
| | | | | | With the change to merge osd drawing into video frame drawing, some bogus logic got in: they skipped drawing the OSD if no video frame is available. This broke --no-video --force-window mode.
* vo_opengl: fix regression with opengl:pbowm42014-06-181-4/+3
| | | | | In the pbo case, mpi was reassigned to a stack pointer, and later deallocated. Just change the code so it doesn't need to be reassigned.
* gl_video: fix refcountingwm42014-06-181-0/+1
|
* video: correct spelling: mp_image_params_equals -> mp_image_params_equalwm42014-06-177-12/+12
| | | | | The type is struct mp_image_params, so the "params" should have a "s". "equals" shouldn't, because it's plural for 2 params. Important.
* video: remove redundant functionwm42014-06-173-11/+2
| | | | mp_image_params_from_image() is now trivial and can be removed.
* vo: make draw_image and vo_queue_image transfer image ownershipwm42014-06-1716-30/+53
| | | | Basically a cosmetic change. This is probably more intuitive.
* video: check image parameterswm42014-06-173-4/+38
| | | | | | | | | Make sure every video filter has valid parameters for input and output. (This also ensures we don't take possibly invalid decoder output, or feed invalid decodr/filter output to VOs.) Also, the updated image size check now (almost) works like the corresponding check in FFmpeg.
* video: introduce failure path for image allocationswm42014-06-1742-51/+175
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Until now, failure to allocate image data resulted in a crash (i.e. abort() was called). This was intentional, because it's pretty silly to degrade playback, and in almost all situations, the OOM will probably kill you anyway. (And then there's the standard Linux overcommit behavior, which also will kill you at some point.) But I changed my opinion, so here we go. This change does not affect _all_ memory allocations, just image data. Now in most failure cases, the output will just be skipped. For video filters, this coincidentally means that failure is treated as EOF (because the playback core assumes EOF if nothing comes out of the video filter chain). In other situations, output might be in some way degraded, like skipping frames, not scaling OSD, and such. Functions whose return values changed semantics: mp_image_alloc mp_image_new_copy mp_image_new_ref mp_image_make_writeable mp_image_setrefp mp_image_to_av_frame_and_unref mp_image_from_av_frame mp_image_new_external_ref mp_image_new_custom_ref mp_image_pool_make_writeable mp_image_pool_get mp_image_pool_new_copy mp_vdpau_mixed_frame_create vf_alloc_out_image vf_make_out_image_writeable glGetWindowScreenshot
* gl_lcms: use thread-safe lcms API, require lcms2 2.6wm42014-06-161-27/+16
| | | | | | | | | | | | | | The error log callback was not thread-safe and not library-safe. And apparently there were some other details that made it not library-safe, such as a global lcms plugin registry. Switch the the thread-safe API provided by lcms2 starting with 2.6. Remove our approximate thread-safety hacks. Note that lcms basically provides 2 APIs now, the old functions, and the thread-safe alternatives whose names end with THR. Some functions don't change, because they already have a context of some sort. Care must be taken not to accidentally use old APIs.
* vo_opengl: simplify redraw callback OSD handlingwm42014-06-165-82/+23
| | | | | | | | | OSD used to be not thread-safe at all, so a track was used to get it redrawn. This mostly reverts commit 6a2a8880, because OSD not being thread-safe was the non-trivial part of it. Mostly untested, because this code path is used on OSX only, and I don't have OSX.
* video/out: change aspects of OSD handlingwm42014-06-1518-134/+116
| | | | | | | | | Let the VOs draw the OSD on their own, instead of making OSD drawing a separate VO driver call. Further, let it be the VOs responsibility to request subtitles with the correct PTS. We also basically allow the VO to request OSD/subtitles at any time. OSX changes untested.
* vo_vaapi: fix a crash on the init error handling pathwm42014-06-151-1/+2
| | | | No X display or libva can't be initialized -> crash.
* wayland: move subsurfaces to wayland voAlexander Preisinger2014-06-153-34/+43
| | | | | | | Subsurfaces are only used by the wayland vo. Thats why it makes sense to move all osd and subsurface specific parts to the vo_wayland.c Also destroy the subsurfaces and subcompositor properly.
* wayland: attach NULL surface on osd creationAlexander Preisinger2014-06-151-0/+3
| | | | | | | When using the EGL output the subsurfaces have no buffer attached and the size seems to be infinite. Fix this by attaching a NULL buffer. Fixes #846
* cocoa: add fallback for automatic GPU switchingStefano Pigozzi2014-06-151-1/+14
| | | | | | Not all the hardware supports kCGLPFASupportsAutomaticGraphicsSwitching (apparently all Mid-2010 and before MacBooks do not work with it), so fallback to not asking for this attribute in the GL pixel format.
* cocoa: allow automatic gpu switchingStefano Pigozzi2014-06-151-0/+3
| | | | Fixes #820
* cocoa: switch to CGL APIs for GL context creationStefano Pigozzi2014-06-151-16/+23
| | | | | CGL APIs are lower level thus giving us better control and more options for the context creation.
* gl_w32: remove unused variablewm42014-06-141-2/+0
|
* video: cosmetics: reformat image format names tablewm42014-06-141-25/+17
|
* video: synchronize mpv rgb pixel format names with ffmpeg nameswm42014-06-1411-131/+117
| | | | | | | | | | | This affects packed RGB formats up to 16 bits per pixel. The old mplayer names used LSB-to-MSB order, while FFmpeg (and some other libraries) use MSB-to-LSB. Nothing should change with this commit, i.e. no bit order or endian bugs should be added or fixed. In some cases, the name stays the same, even though the byte order changes, e.g. RGB8->BGR8 and BGR8->RGB8, and this affects the user-visible names too; this might cause confusion.
* video: automatically strip "le" and "be" suffix from pixle format nameswm42014-06-143-20/+27
| | | | | | | | | | | | | These suffixes are annoying when they're redundant, so strip them automatically. On little endian machines, always strip the "le" suffix, and on big endian machines vice versa (although I don't think anyone ever tried to run mpv on a big endian machine). Since pixel format strings are returned by a certain function and we can't just change static strings, use a trick to pass a stack buffer transparently. But this also means the string can't be permanently stored by the caller, so vf_dlopen.c has to be updated. There seems to be no other case where this is done, though.
* options: remove OPT_FLAG_CONSTANTSwm42014-06-131-4/+4
| | | | | | | This means use of the min/max fields can be dropped for the flag option type, which makes some things slightly easier. I'm also not sure if the client API handled the case of flag not being 0 or 1 correctly, and this change gets rid of this concern.
* vd_lavc: use option parser for skip suboptionswm42014-06-131-22/+25
|
* vd_lavc: make option struct localwm42014-06-111-15/+34
| | | | | Removes specifics from options.h and options.c, and puts everything into vd_lavc.c.
* vf_noise: remove global variableswm42014-06-111-9/+4
|
* vf_divtc: remove a global variablewm42014-06-111-5/+1
|
* Add more constwm42014-06-1113-71/+67
| | | | | | | While I'm not very fond of "const", it's important for declarations (it decides whether a symbol is emitted in a read-only or read/write section). Fix all these cases, so we have writeable global data only when we really need.
* vo_caca: remove global variableswm42014-06-111-68/+84
| | | | The shit I put up with...
* options: remove global variables for swscale options; rename themwm42014-06-117-31/+51
| | | | | | Additionally to removing the global variables, this makes the options more uniform. --ssf-... becomes --sws-..., and --sws becomes --sws- scaler. For --sws-scaler, use choices instead of magic integer values.
* video: fix another cover art corner casewm42014-06-091-1/+1
| | | | | | | Playing a video and then an audio file with cover art kept displaying the last frame of the video. This was because the hasframe flag was set, perhaps due to redrawing the last video frame before the cover art image is decoded.
* x11: cleanup motif hints handlingwm42014-06-062-38/+17
| | | | | | | | It seems we can't really get rid of this. There are no other hints to remove decorations that work across all reasonable WMs, so we're stuck with the ugly motif stuff. But at least we can make the code for it less ugly.
* filter_kernels: fix nearest scalerwm42014-06-041-1/+1
| | | | | | | | | | The previous commit assumed the filter would be 1x1 (then constant weight is correct) - but our code in fact uses at least a 2x2 filter. A 1x1 filter would generally be useless, except for nearest scaling - so it didn't exist. Insteasd of adding such a 1x1 filter, just turn the nearest weight function into a scare function, which should take care of the issue.
* filter_kernels: add nearest neighbour scalinglucy2014-06-031-0/+6
| | | | | | This is useful for playing content containing pixel art that hasn't been pre-scaled, such as TASVideos' high quality encodes. The implementation is lifted from <https://code.google.com/p/glumpy/source/browse/glumpy/image/filter.py#413>.
* wayland: remove stub for unimplemented functionwm42014-06-021-15/+0
|
* vo: correctly initialize parameters in corner caseswm42014-06-011-1/+4
|
* player: hide audio/video codec and file format messageswm42014-05-311-2/+1
| | | | | None of these are very important usually. For error analysis, the plain log is useless anyway, and this information is still printed with "-v".
* gl_common: remove dlsym() fallbackwm42014-05-311-21/+1
| | | | See previous commits.
* gl_wayland: remove probably unneeded workaroundwm42014-05-311-2/+0
| | | | | | | | This would imply eglGetProcAddress() doesn't work correctly, but using dlsym() does. For now get rid of it - it won't work in libmpv, and we'll probably need a better workaround if it's still broken. This code was in the initial wayland commit.
* gl_x11: remove workaround for PPC OSX 10.4wm42014-05-311-7/+0
| | | | | Added in 2010 with commit 4a8486f8 (svn commit 30994). I doubt anyone still uses X11 on OSX, and we probably don't support 10.4 either.
* gl_x11: always require some GLX API functions, avoid dlsym()wm42014-05-313-20/+6
| | | | | | | | | | | | | | The functions glXGetProcAddressARB() and glXQueryExtensionsString() were loaded using dlsym(). This could fail when compiling to libmpv, because then dlopen(NULL, ...) will look in the main program's list of libraries, and the libGL linked to libmpv is never considered. (Don't know if this somehow could be worked around.) The result is that using vo_opengl with libmpv can fail. Avoid this by not using dlsym(). glXGetProcAddressARB() was already used directly in the same file, and that never caused any problems. (Still add it to the configure test.) glXQueryExtensionsString() is documented as added in GLX 1.1 - that's ancient.
* vd_lavc: set video bitrate if availableMarcoen Hirschberg2014-05-281-0/+5
| | | | Set the bitrate of dec_video if it is available in avcodec.
* audio: rename i_bps to 'bitrate' to avoid confusionMarcoen Hirschberg2014-05-282-3/+3
| | | | Since i_bps now contains bits/sec, rename it to reflect this change.
* audio: change values from bytes-per-second to bits-per-secondMarcoen Hirschberg2014-05-282-3/+3
| | | | | | | The i_bps members of the sh_audio and dev_video structs are mostly used for displaying the average audio and video bitrates. Keeping them in bits-per-second avoids truncating them to bytes-per-second and changing them back lateron.
* vaapi: fix destruction with --hwdec=haapi-copywm42014-05-281-2/+6
| | | | | | | This is incomplete; the video chain will still hold some vaapi objects after destroying the decoder and thus the vaapi context. This is very bad. Fixing it would require something like refcounting the vaapi context, but I don't really want to.
* video: warn if an emulated hwdec API is usedwm42014-05-2811-4/+48
| | | | | | | | | | | | | | | | mpv supports two hardware decoding APIs on Linux: vdpau and vaapi. Each of these has emulation wrappers. The wrappers are usually slower and have fewer features than their native opposites. In particular the libva vdpau driver is practically unmaintained. Check the vendor string and print a warning if emulation is detected. Checking vendor strings is a very stupid thing to do, but I find the thought of people using an emulated API for no reason worse. Also, make --hwdec=auto never use an API that is detected as emulated. This doesn't work quite right yet, because once one API is loaded, vo_opengl doesn't unload it, so no hardware decoding will be used if the first probed API (usually vdpau) is rejected. But good enough.
* vo_vaapi: cleanup error handling on initwm42014-05-282-4/+10
| | | | Close the X connection if initializing vaapi fails.
* video: better handling for (very) broken timestampswm42014-05-271-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Sometimes, Matroska files store monotonic PTS for h264 tracks with b-frames, which means the decoder actually returns non-monotonic PTS. Handle this with an evil trick: if DTS is missing, set it to the PTS. Then the existing logic, which deals with falling back to DTS if PTS is broken. Actually, this trick is not so evil at all, because usually, PTS has no errors, and DTS is either always set, or always unset. So this _should_ provoke no regressions (famous last words). libavformat actually does something similar: it derives DTS from PTS in ways unknown to me. The result is very broken, but it causes the DTS fallback to become active, and thus happens to work. Also, prevent the heuristic from being active if PTS is merely monotonic instead of strictly-monotonic. Non-unique PTS is broken, but we can't fallback to DTS anyway in these cases. The specific mkv file that is fixed with this commit had the following fields set: Muxing application: libebml v1.3.0 + libmatroska v1.4.1 Writing application: mkvmerge v6.7.0 ('Back to the Ground') [...] But I know that this should also fix playback of mencoder produced mkv files.
* gl_common: minor cosmetic changeswm42014-05-261-10/+9
| | | | Why are you reading this message.
* gl_common: correct a typewm42014-05-261-1/+1
| | | | | | | We pass a pointer to a GLint to sscanf, using the %d format. That format _always_ takes int, and not GLint (whatever the heck that is). If GLint is always int, then it doesn't make a difference, but is still better because it doesn't play russian roulette with pointers.
*