summaryrefslogtreecommitdiffstats
path: root/video
Commit message (Collapse)AuthorAgeFilesLines
* video: display last frame, drain frames on video reconfigwm42013-12-102-0/+5
| | | | | | | | | | | | | | | | | | | | | | Until now, the player didn't care to drain frames on video reconfig. Instead, the VO was reconfigured (i.e. resized) before the queued frames finished displaying. This can for example be observed by passing multiple images with different size as mf:// filename. Then the window would resize one frame before image with the new size is displayed. With --vo=vdpau, the effect is worse, because this VO queues more than 1 frame internally. Fix this by explicitly draining buffered frames before video reconfig. Raise the display time of the last frame. Otherwise, the last frame would be shown for a very short time only. This usually doesn't matter, but helps when playing image files. This is a byproduct of frame draining, because normally, video timing is based on the frames queued to the VO, and we can't do that with frames of different size or format. So we pretend that the frame before the change is the last frame in order to time it. This code is incorrect though: it tries to use the framerate, which often doesn't make sense. But it's good enough to test this code with mf://.
* vo: reset some fields properlywm42013-12-101-0/+6
| | | | | | Otherwise, next_pts2 can be == next_pts (and not MP_NOPTS_VALUE), in which case the player thinks the first frame has duration 0. (Weird corner case.)
* video: move VO reinit from filter chain to playerwm42013-12-103-117/+34
| | | | | | | | | This gets rid of the vf_vo pseudo-filter. It ends the idea of MPlayer's architecture that the VO is just a (terminating) video filter. It didn't really work for us with respect to video timing (the "end" of the video chain isn't really made for video timing, and making it do so would be awkward), and now we're removing it entirely. We will be able to fix some things, such as properly draining video on reconfiguration.
* video: move handling of brightness and deinterlacing controlwm42013-12-103-30/+42
| | | | | Handling of brightness/gamma/saturation/etc. and deinterlacing is moved from vf_vo.c to dec_video.c.
* vf_vo: remove VO reset on filter uninitwm42013-12-101-5/+0
| | | | | | I don't think this has any reason to exist. It's likely that this used to be required by the old direct rendering infrastructure. (See git blame output.)
* video: move video filter chain initialization from decoder to playerwm42013-12-105-62/+37
| | | | | | | | | | | | | This should help fixing some issues (like not draining video frames correctly on reinit), as well as decoupling the decoder, filter chain, and VO code. I also wanted to make the hardware video decoding fallback work properly if software-only video filters are inserted. This currently has the issue that the fallback is too violent, and throws away a bunch of demuxer packets needed to restart software decoding properly. But keeping "backup" packets turned out as too hacky, so I'm not doing this, at least not yet.
* compat: add compatibility kludge for Libav 9wm42013-12-081-8/+14
| | | | | | | | Libav 9 still uses the unprefixed PIX_FMT_... symbols, but they will probably be removed some time in the future. There are some other deprecations we have yet to take care of, but there are no clear replacements yet.
* vf: redo conversion filter insertion/format negotiationwm42013-12-076-175/+187
| | | | | | | | | | | | | | | | | Remove the inconsistent, duplicated, and insufficient scale filter insertion code, and do it in one place instead. This also compensates for the earlier removal of vf_match_csp() (which was in fact duplicated code). The algorithm to determine where to insert a filter etc. is probably the same, though it also comes with some changes that should make debugging easier when trying to figure out why a chain is failing to configure. Add an "in" pseudo filter, which makes insertion of conversion filters easier. Also change the vf->reconfig signature. At a later point, I'll probably change format negotiation such that the generic filter code will choose the output format, so having separate in and out params will be useful.
* video/filter: make vf->control non-recursivewm42013-12-0712-32/+27
| | | | | | Reason: I never liked it being recursive. Generally, this seems to cause more problems than trouble, and is less flexible for access outside of the chain.
* vf: remove flags from filter format statuswm42013-12-074-37/+25
| | | | | | | | I don't think we need these flags anymore. Simplify the code and get rid of the vf_format struct. There still is the vf_format.configured field, but this can be replaced by checking for a valid image format.
* video: create a separate context for video filter chainwm42013-12-077-137/+175
| | | | | | This adds vf_chain, which unlike vf_instance refers to the filter chain as a whole. This makes the filter API less awkward, and will allow handling format negotiation better.
* video/filter: remove vf_match_csp()wm42013-12-076-119/+4
| | | | | | | | | This function improves automatic filter insertion, but this really should be done by the generic filter code. Remove vf_match_csp() and all code using it as preparation for that. This commit temporarily makes handling of filter insertion worse for now, but it will be fixed with the following commits.
* vf: remove unused functionwm42013-12-072-23/+0
|
* vf: print error when creating filter failswm42013-12-071-0/+1
| | | | Before that we relied on the filters printing their own error messages.
* cocoa: make borderless window resizableagiz2013-12-071-1/+1
| | | | Fixes #399
* vf: declare config() as legacywm42013-12-051-5/+5
|
* video/filter: remove unneeded config callbackswm42013-12-055-45/+0
| | | | | | | | They didn't do anything. vf_screenshot.c actually did release the previous image, but that's not really required. At worst you could take a screenshot and get an old frame when there's no new frame yet.
* video: remove --flipwm42013-12-057-22/+7
| | | | | | | | | | | | | | | | The --flip option flipped the image upside-down, by trying to use VO support, or if not available, by inserting a video filter. I'm not sure why it existed. Maybe it was important in ancient times when VfW based decoders output an image this way (but even then, flipping an image is a free operation by negating the stride). One nice thing about this is that it provided a possible path for implementing video orientation, which is a feature we should probably support eventually. The important part is that it would be for free for VOs that support it, and would work even with hardware decoding. But for now get rid of it. It's useless, trivial, stands in the way, and supporting video orientation would require solving other problems first.
* vf: move norm_qscale() to the only filter which uses itwm42013-12-052-15/+15
|
* vf_sub, vf_dlopen: default struct is not neededwm42013-12-052-7/+3
|
* vf: cleanup removed filter entrywm42013-12-051-1/+0
|
* video/filter: fix some bogus free() callswm42013-12-054-8/+0
| | | | The generic filter code frees these; recent regression.
* options: remove legacy hacks for sub-option handlingwm42013-12-041-17/+8
|
* vd_lavc: factor out libavcodec thread setupwm42013-12-041-15/+1
|
* vd_lavc: don't check required hwdec fieldswm42013-12-041-4/+3
|
* av_common: add timebase parameter to mp_set_av_packet()wm42013-12-041-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | If the timebase is set, it's used for converting the packet timestamps. Otherwise, the previous method of reinterpret-casting the mpv style double timestamps to libavcodec style int64_t timestamps is used. Also replace the kind of awkward mp_get_av_frame_pkt_ts() function by mp_pts_from_av(), which simply converts timestamps in a way the old function did. (Plus it takes a timebase parameter, similar to the addition to mp_set_av_packet().) Note that this should not change anything yet. The code in ad_lavc.c and vd_lavc.c passes NULL for the timebase parameters. We could set AVCodecContext.pkt_timebase and use that if we want to give libavcodec "proper" timestamps. This could be important for ad_lavc.c: some codecs (opus, probably mp3 and aac too) have weird requirements about doing decoding preroll on the container level, and thus require adjusting the audio start timestamps in some cases. libavcodec doesn't tell us how much was skipped, so we either get shifted timestamps (by the length of the skipped data), or we give it proper timestamps. (Note: libavcodec interprets or changes timestamps only if pkt_timebase is set, which by default it is not.) This would require selecting a timebase though, so I feel uncomfortable with the idea. At least this change paves the way, and will allow some testing.
* wayland: print waylands display errosAlexander Preisinger2013-12-041-0/+40
| | | | | This is very usefull especially if you want to use newer wayland stuff like wl_subsurfaces and xdg_surfaces.
* vf_noise: reduce binary sizewm42013-12-041-4/+1
| | | | Same issues as in previous commit.
* vf_eq: revert unintended binary size increasewm42013-12-041-13/+10
| | | | | | The vf_eq context contains a very large lookup table, and the method of setting default values caused the vf_eq context to be included in the compiled code.
* video/filter: remove legacy option handling hackswm42013-12-0432-37/+35
| | | | | | | | | All filters now either use the generic option parser, or don't have options. This finally finishes a transition started in 2003 (see git commit 33b62af94760186c). Why are MPlayer devs so monumentally lazy? Sorry, but this takes the cake. You had 10 years.
* vf_vo: don't abuse option strings to set VOwm42013-12-042-6/+15
| | | | Whoever thought this was a good idea should be punched.
* vf_rotate: use option parserwm42013-12-041-2/+7
|
* vf_pp: use option parserwm42013-12-041-5/+14
|
* vf_ilpack: use option parserwm42013-12-041-8/+10
|
* vf_eq: use option parserwm42013-12-041-26/+22
|
* vf_dsize: use option parserwm42013-12-041-31/+19
| | | | | | | Mostly backwards compatible, we don't change much because we just want to get rid of the legacy option string handling. You can't pass an aspect as first argument anymore.
* vf_divtc: use option parserwm42013-12-041-78/+36
|
* video/filter: remove vf_down3drightwm42013-12-042-158/+0
| | | | | | | | Apparently you can get this with: stereo3d=ab[2]{l,r}:sbs[2]{l,r} So it seems the filter is redundant and can be removed. Also see FFmpeg commit 2f11aa141a01.
* vf: remove unneeded fieldwm42013-12-041-1/+0
| | | | | This was once required for padding, because many filters didn't use designated initializers, and initialized a removed field with NULL.
* vf_pullup: change options, reroute to vf_lavfiwm42013-12-041-10/+37
| | | | The options are probably mostly backwards compatible.
* vf_unsharp: change options, reroute to vf_lavfiwm42013-12-041-50/+37
|
* vf_phase: change options, reroute to vf_lavfiwm42013-12-041-35/+48
| | | | The option change is probably backwards compatible.
* vf_noise: reroute to vf_lavfiwm42013-12-041-26/+42
| | | | | | | | Unfortunately, this forces filtering both luma and chroma, because otherwise we'd have to deal with libavfilter's vf_noise weird handling of YUV vs. RGB formats. Would we e.g. filter luma only, it would filter red in RGB mode only, because it goes by component and there's no way to distinguish YUV and RGB by just using the filter's options.
* vf_stereo3d: reroute to vf_lavfiwm42013-12-041-10/+31
|
* vf_hqdn3d: change options, reroute to vf_lavfiwm42013-12-041-67/+34
|
* vf_gradfun: reroute to vf_lavfiwm42013-12-041-0/+23
| | | | | Also update the manpage. We changed defaults and added a suboption quite some time ago, and we forgot to update the manpage at all.
* vf_delogo: reroute to vf_lavfiwm42013-12-041-2/+20
| | | | The ``file`` suboption is unsupported on lavfi.
* vf_yadif: change options, reroute to vf_lavfiwm42013-12-041-15/+24
| | | | | | Also remove the ability to disable deinterlacing at runtime. You can still disable deinterlacing at runtime by using the ``D`` key and its automatical filter insertion/removal.
* vf_lavfi: export a wrapper functionwm42013-12-042-6/+156
| | | | | | | | | | | This will allow old filter to run libavfilter instead by calling vf_lw_set_graph(), which turns the filter into a wrapper, using a given libavfilter graph. Later commits use that to automatically "reroute" a bunch of filters to libavfilter. We want to get rid of the old MPlayer filter code, because it's bad an unmaintained, but we still don't want to force everyone to use vf_lavfi, so this solution will do for a while.
* video: remove VFCAP_POSTPROCwm42013-12-042-7/+1
| | | | This wasn't used anymore, not even until recently.
* vf_screenshot: remove unnecessary codewm42013-12-041-5/+0
|
* gl_video: change internal API for hwdec mp_image downloadStefano Pigozzi2013-12-023-10/+13
| | | | | | Previous API worked under the assumption that download_image is always called after map_image. In practice this is true, but it's better to have a much generic API that doesn't depend on the order in which the functions are called.
* gl_video: use hwdec download_image call only if hwdec is activewm42013-12-021-2/+3
| | | | | | | | | | The hwdec driver can be loaded, even if it's not used (e.g. when playing a file with no hardware decoding after one with it enabled). Also, check whether dlimage is NULL. Since this will do call into the native hwdec API, there's a chance a driver could fail doing this, it's better to check the return value, even if this case currently can't happen.
* options: add option to disable using right Alt key as Alt GrVivek Jain2013-12-022-4/+6
| | | | | | | | | mpv was hardcoded to always consider the right Alt key as Alt Gr, but there are parituclar combinations of platforms and keyboard layouts where it's more convenient to treat the right Alt as a keyboard modifier just like the left one. Fixes #388
* vo_opengl: support for vda hardware decodingStefano Pigozzi2013-12-025-0/+161
| | | | | | | | | | | The harder work was done in the previous commits. After that this feature comes out almost for free. The only problem is I can't get the textures created with CGLTexImageIOSurface2D to download properly, thus the code performs download using some CoreVideo APIs. If someone knows why download of textures created with CGLTexImageIOSurface2D doesn't work please contact me :)
* gl_video: support packed YUV formats with Apple extensionsStefano Pigozzi2013-12-024-2/+47
| | | | | | | | | | This adds support for packed YUV formats (YUVY and UYVY) using the extension GL_APPLE_rgb_422. While supporting this formats on their own is not that important (considering most video is planar YUV) they are used for interoperability with IOSurfaces. Next commit will use this formats to render VDA hardware decoded frames through IOSurface and OpenGL interoperability.
* vo_opengl: add support for rectangle textureswm42013-12-015-44/+86
| | | | | | | | | This allows vo_opengl to use GL_TEXTURE_RECTANGLE textures, either by enabling it with the 'rectangle-textures' sub-option, or by having a hwdec backend force it. By default it's off. The _only_ reason we're adding this is because VDA can export rectangle textures only.
* mp_image: deal with FFmpeg PSEUDOPAL braindeathwm42013-12-013-3/+15
| | | | | | | | | | We got a crash in libavutil when encoding with Y8 (GRAY8). The reason was that libavutil was copying an Y8 image allocated by us, and expected a palette. This is because GRAY8 is a PSEUDOPAL format. It's not clear what PSEUDOPAL means, and it makes literally no sense at all. However, it does expect a palette allocated for some formats that are not paletted, and libavutil crashed when trying to access the non-existent palette.
* vo_null: don't reject hwaccel formatswm42013-12-011-2/+0
| | | | | | This is not strictly needed anymore. (On the other hand, it's not really possible to do hw decoding with vo_null, because the VO is still responsible for opening the hw decoder API, but that's another story.)
* options: add options that set defaults for af/vf/ao/vowm42013-12-012-0/+4
| | | | | | | | There are some use cases for this. For example, you can use it to set defaults of automatically inserted filters (like af_lavrresample). It's also useful if you have a non-trivial VO configuration, and want to use --vo to quickly change between the drivers without repeating the whole configuration in the --vo argument.
* Take care of some libavutil deprecations, drop support for FFmpeg 1.0wm42013-11-298-158/+156
| | | | | | | | | | | | | | PIX_FMT_* -> AV_PIX_FMT_* (except some pixdesc constants) enum PixelFormat -> enum AVPixelFormat Losen some version checks in certain newer pixel formats. av_pix_fmt_descriptors -> av_pix_fmt_desc_get This removes support for FFmpeg 1.0.x, which is even older than Libav 9.x. Support for it probably was already broken, and its libswresample was rejected by our build system anyway because it's broken. Mostly untested; it does compile with Libav 9.9.
* vf_pullup: properly reset on seekwm42013-11-291-14/+37
| | | | | | | Sometimes, vf_pullup hanged on seek. This was because it never was properly reset. Old timestamps messed up the timestamp calculations, which made the player show frames for a ridiculously long time, which is perceived as pausing or hanging.
* gl_hwdec: use a imgfmt field instead of a query_format callbackwm42013-11-294-15/+5
| | | | | Now that vdpau always uses a single image format, this can be simplified.
* vdpau: always let decoder output IMGFMT_VDPAUwm42013-11-293-3/+4
| | | | | | | | | | The old ffmpeg vdpau support code uses separate vdpau pixel formats for each decoder (pretty much because mplayer's architecture sucked), which just gets into the way. Force the old decoder's output to IMGFMT_VDPAU, and remove IMGFMT_IS_VDPAU() where we can remove it. This should completely remove the differences betwene the old and new vdpau decoder outside of the decoder.
* vaapi: remove unused hw image formats, simplifywm42013-11-297-26/+11
| | | | | | | | | | PIX_FMT_VDA_VLD and PIX_FMT_VAAPI_VLD were never used anywhere. I'm not sure why they were even added, and they sound like they are just for compatibility with XvMC-style decoding, which sucks anyway. Now that there's only a single vaapi format, remove the IMGFMT_IS_VAAPI() macro. Also get rid of IMGFMT_IS_VDA(), which was unused.
* build: make pthreads mandatorywm42013-11-283-21/+5
| | | | | | | | | | | pthreads should be available anywhere. Even if not, for environment without threads a pthread wrapper could be provided that can't actually start threads, thus disabling features that require threads. Make pthreads mandatory in order to simplify build dependencies and to reduce ifdeffery. (Admittedly, there wasn't much complexity, but maybe we will use pthreads more in the future, and then it'd become a real bother.)
* video: add insane hack to work around FFmpeg/Libav insanitywm42013-11-281-3/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | So, FFmpeg/Libav requires us to figure out video timestamps ourselves (see last 10 commits or so), but the methods it provides for this aren't even sufficient. In particular, everything that uses AVI-style DTS (avi, vfw-mux