summaryrefslogtreecommitdiffstats
path: root/video/filter/vf_dlopen.c
Commit message (Collapse)AuthorAgeFilesLines
* vf_dlopen: remove this filterwm42017-06-181-350/+0
| | | | | | | | | | | | | | | | It was an attempt to move some MPlayer filters (which were removed from mpv) to external, loadable filters. That worked well, but then the MPlayer filters were ported to libavfilter (independently), so they're available again. Also there is a more widely supported and more advanced loadable filter system supported by mpv: vapoursynth. In conclusion, vf_dlopen is not useful anymore, confusing, and requires quite a bit of code (and probably wouldn't survive the rewrite of the mpv video filter chain, which has to come at some point). It has some implicit dependencies on internal conventions, like possibly the format names dropped in the previous commit. We also deprecated it last release. Drop it.
* video: deprecate almost all video filterswm42017-04-021-0/+2
| | | | | | | | | | | | | The plan is to nuke the custom filter chain completely. It's not clear what will happen to the still needed builtin filters (mostly hardware deinterlacing and vf_vapoursynth). Most likely we'll replace them with different filter chain concept (whose main purpose will be providing builtin things and bridging to libavfilter). The undocumented "warn" options are there to disable deprecation warnings when the player inserts filter automatically. The same will be done to audio filters, at a later point.
* Relicense some non-MPlayer source files to LGPL 2.1 or laterwm42016-01-191-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This covers source files which were added in mplayer2 and mpv times only, and where all code is covered by LGPL relicensing agreements. There are probably more files to which this applies, but I'm being conservative here. A file named ao_sdl.c exists in MPlayer too, but the mpv one is a complete rewrite, and was added some time after the original ao_sdl.c was removed. The same applies to vo_sdl.c, for which the SDL2 API is radically different in addition (MPlayer supports SDL 1.2 only). common.c contains only code written by me. But common.h is a strange case: although it originally was named mp_common.h and exists in MPlayer too, by now it contains only definitions written by uau and me. The exceptions are the CONTROL_ defines - thus not changing the license of common.h yet. codec_tags.c contained once large tables generated from MPlayer's codecs.conf, but all of these tables were removed. From demux_playlist.c I'm removing a code fragment from someone who was not asked; this probably could be done later (see commit 15dccc37). misc.c is a bit complicated to reason about (it was split off mplayer.c and thus contains random functions out of this file), but actually all functions have been added post-MPlayer. Except get_relative_time(), which was written by uau, but looks similar to 3 different versions of something similar in each of the Unix/win32/OSX timer source files. I'm not sure what that means in regards to copyright, so I've just moved it into another still-GPL source file for now. screenshot.c once had some minor parts of MPlayer's vf_screenshot.c, but they're all gone.
* video: switch from using display aspect to sample aspectwm42015-12-191-4/+5
| | | | | | | | | | | | | | | | MPlayer traditionally always used the display aspect ratio, e.g. 16:9, while FFmpeg uses the sample (aka pixel) aspect ratio. Both have a bunch of advantages and disadvantages. Actually, it seems using sample aspect ratio is generally nicer. The main reason for the change is making mpv closer to how FFmpeg works in order to make life easier. It's also nice that everything uses integer fractions instead of floats now (except --video-aspect option/property). Note that there is at least 1 user-visible change: vf_dsize now does not set the display size, only the display aspect ratio. This is because the image_params d_w/d_h fields did not just set the display aspect, but also the size (except in encoding mode).
* vf: remove old config() callbackwm42015-12-191-24/+25
|
* Update license headersMarcin Kurczewski2015-04-131-4/+4
| | | | Signed-off-by: wm4 <wm4@nowhere>
* mp_image: remove redundant chroma_x/y_shift fieldswm42015-04-101-4/+4
|
* win32: request UTF-16 API variants, Vista+ APIs, and COM C macroswm42015-01-071-1/+1
| | | | | Put the Vista+ (_WIN32_WINNT) and the COM C (COBJMACROS) defines into the build system, instead of defining them over and over in the code.
* video: remove internal QP passingwm42014-12-031-45/+3
| | | | | | | | | | | This was required by vf_pp, which was just removed. vf_dlopen has this stuff in its API. This API is considered stable, so the related fields are not removed from it. But the fields are always 0 now, so there's no point in keeping the example program around. vf_pullup.c did some extremely awkward passthrough of this information, but didn't actually use it.
* vf_dlopen: fix the order of the arguments to mp_image_allocMarcoen Hirschberg2014-06-191-2/+2
|
* video: introduce failure path for image allocationswm42014-06-171-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* video: automatically strip "le" and "be" suffix from pixle format nameswm42014-06-141-2/+3
| | | | | | | | | | | | | 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.
* vf_dlopen: update usage message to new-style argsKevin Mitchell2014-05-151-1/+1
|
* vf_dlopen: remove buggy private name -> imgfmt conversionKevin Mitchell2014-05-151-31/+14
| | | | | This was presumably for backward compatibility, but it was preventing the use of the new names.
* video: don't drop last frame when deinterlacing with yadifwm42014-04-281-0/+3
| | | | | | | | | | | | | | | | | | Or in other words, add support for properly draining remaining frames from video filters. vf_yadif is buffering at least one frame, and the buffered frame was not retrieved on EOF. For most filters, ignore this for now, and just adjust them to the changed semantics of filter_ext. But for vf_lavfi (used by vf_yadif), real support is implemented. libavfilter handles this simply by passing a NULL frame to av_buffersrc_add_frame(), so we just have to make mp_to_av() handle NULL arguments. In load_next_vo_frame(), we first try to output a frame buffered in the VO, then the filter, and then (if EOF is reached and there's still no new frame) the VO again, with draining enabled. I guess this was implemented slightly incorrectly before, because the filter chain still could have had remaining output frames.
* video/filter: mp_msg conversionswm42013-12-211-14/+9
|
* Split mpvcore/ into common/, misc/, bstr/wm42013-12-171-1/+1
|
* Move options/config related files from mpvcore/ to options/wm42013-12-171-1/+1
| | | | | | | | | Since m_option.h and options.h are extremely often included, a lot of files have to be changed. Moving path.c/h to options/ is a bit questionable, but since this is mainly about access to config files (which are also handled in options/), it's probably ok.
* vf: move norm_qscale() to the only filter which uses itwm42013-12-051-0/+15
|
* vf_sub, vf_dlopen: default struct is not neededwm42013-12-051-3/+2
|
* video/filter: remove legacy option handling hackswm42013-12-041-1/+1
| | | | | | | | | 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.
* video/filter: remove useless vf_info fieldswm42013-10-231-5/+3
| | | | | This time I didn't bother to move the contents of the author field to the file headers. "git log" is your friend.
* core: move contents to mpvcore (2/2)Stefano Pigozzi2013-08-061-2/+2
| | | | Followup commit. Fixes all the files references.
* options: use m_config for options instead of m_structwm42013-07-211-32/+28
| | | | | | | | | | | | | | | | | | For some reason, both m_config and m_struct are somewhat similar, except that m_config is much more powerful. m_config is used for VOs and some other things, so to unify them. We plan to kick out m_struct and use m_config for everything. (Unfortunately, m_config is also a bit more bloated, so this commit isn't all that great, but it will allow to reduce the option parser mess somewhat.) This commit also switches all video filters to use the option macros. One reason is that m_struct and m_config, even though they both use m_option, store the offsets of the option fields differently (sigh...), meaning the options defined for either are incompatible. It's easier to switch everything in one go. This commit will allow using the -vf option parser for other things, like VOs and AOs.
* fix compile, sorryRudolf Polzer2013-06-161-0/+1
|
* vf_dlopen filters: add an "ildetect" filter that detects interlacingRudolf Polzer2013-06-161-4/+21
| | | | | The filter analyzes each frame for combing, and decides at the end whether the content is likely interlaced, telecined or progressive.
* vf_dlopen: fix external pixel format nameswm42013-02-031-7/+35
| | | | | "yv12" stopped working a while ago, and so did other FourCC-like names. Make "yv12" work again, so that the examples in TOOLS/vf_dlopen/ work.
* mp_image: change how palette is handledwm42013-01-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | According to DOCS/OUTDATED-tech/colorspaces.txt, the following formats are supposed to be palettized: IMGFMT_BGR8 IMGFMT_RGB8, IMGFMT_BGR4_CHAR IMGFMT_RGB4_CHAR IMGFMT_BGR4 IMGFMT_RGB4 Of these, only BGR8 and RGB8 are actually treated as palettized in some way. ffmpeg has only one palettized format (AV_PIX_FMT_PAL8), and IMGFMT_BGR8 was inconsistently mapped to packed non-palettized RGB formats too (AV_PIX_FMT_BGR8). Moreover, vf_scale.c contained messy hacks to generate a palette when AV_PIX_FMT_BGR8 is output. (libswscale does not support AV_PIX_FMT_PAL8 output in the first place.) Get rid of all of this, and introduce IMGFMT_PAL8, which directly maps to AV_PIX_FMT_PAL8. Remove the palette creation code from vf_scale.c. IMGFMT_BGR8 maps to AV_PIX_FMT_RGB8 (don't ask me why it's swapped), without any palette use. Enabling it in vo_x11 or using it as vf_scale input seems to give correct results.
* video: remove things related to old DR codewm42013-01-131-1/+1
| | | | | | | | | | | | | | | Remove mp_image.width/height. The w/h members are the ones to use. width/height were used internally by vf_get_image(), and sometimes for other purposes. Remove some image flags, most of which are now useless or completely unused. This includes VFCAP_ACCEPT_STRIDE: the vf_expand insertion in vf.c does nothing. Remove some other unused mp_image fields. Some rather messy changes in vo_opengl[_old] to get rid of legacy mp_image flags and fields. This is left from when vo_gl supported DR.
* video/filter: change filter API, use refcounting, remove filter DRwm42013-01-131-79/+36
| | | | | | | | | | | | | | | | | | | | Change the entire filter API to use reference counted images instead of vf_get_image(). Remove filter "direct rendering". This was useful for vf_expand and (in rare cases) vf_sub: DR allowed these filters to pass a cropped image to the filters before them. Then, on filtering, the image was "uncropped", so that black bars could be added around the image without copying. This means that in some cases, vf_expand will be slower (-vf gradfun,expand for example). Note that another form of DR used for in-place filters has been replaced by simpler logic. Instead of trying to do DR, filters can check if the image is writeable (with mp_image_is_writeable()), and do true in-place if that's the case. This affects filters like vf_gradfun and vf_sub. Everything has to support strides now. If something doesn't, making a copy of the image data is required.
* vf_dlopen: fix a typo in zeroing memory (thanks, pigoz)Rudolf Polzer2012-11-131-1/+1
| | | | Accidentally had put the & inside the sizeof call too. Typing too fast.
* Rename directories, move files (step 2 of 2)wm42012-11-121-5/+5
| | | | | | | | | | | | Finish renaming directories and moving files. Adjust all include statements to make the previous commit compile. The two commits are separate, because git is bad at tracking renames and content changes at the same time. Also take this as an opportunity to remove the separation between "common" and "mplayer" sources in the Makefile. ("common" used to be shared between mplayer and mencoder.)
* Rename directories, move files (step 1 of 2) (does not compile)wm42012-11-121-0/+389
Tis drops the silly lib prefixes, and attempts to organize the tree in a more logical way. Make the top-level directory less cluttered as well. Renames the following directories: libaf -> audio/filter libao2 -> audio/out libvo -> video/out libmpdemux -> demux Split libmpcodecs: vf* -> video/filter vd*, dec_video.* -> video/decode mp_image*, img_format*, ... -> video/ ad*, dec_audio.* -> audio/decode libaf/format.* is moved to audio/ - this is similar to how mp_image.* is located in video/. Move most top-level .c/.h files to core. (talloc.c/.h is left on top- level, because it's external.) Park some of the more annoying files in compat/. Some of these are relicts from the time mplayer used ffmpeg internals. sub/ is not split, because it's too much of a mess (subtitle code is mixed with OSD display and rendering). Maybe the organization of core is not ideal: it mixes playback core (like mplayer.c) and utility helpers (like bstr.c/h). Should the need arise, the playback core will be moved somewhere else, while core contains all helper and common code.