summaryrefslogtreecommitdiffstats
path: root/filters/filter.c
Commit message (Collapse)AuthorAgeFilesLines
* filter: hide warning when disconnecting pins drops frameswm42018-04-291-2/+2
| | | | | | | | | | Sometimes this hints that there's a bug, but sometimes it's normal. Since the code for --end/--frames puts frames that should not be shown anymore back into the pin, using those options will show this warning when playback ends. This is a minor annoyance. We could change how it's done (e.g. set an explicit flag somewhere), but that seems bothersome, so just change the message from warning to verbose.
* filter: fix potential NULL pointer derefwm42018-02-161-1/+1
| | | | | | The rest of the function should be executed only if both are set. It seems like in practice this didn't happen yet with only one of them unset, but in theory it's possible. Found by Coverity.
* filter: simplify/fix external filter graph usagewm42018-02-131-34/+37
| | | | | | | | | | | | | | | | There was the following problem: if a filter graph had asynchronous filters, and the filter graph user did not call mp_filter_run() (and only accessed the mp_pins), then filtering could stall, because using mp_pin_out_request_data() only recursively invoked filtering if the data_requested flag wasn't already set. The latter can happen if a request was tried earlier but failed, and then an asynchronous filter actually produced output that would satisfy the request. Obviously, it has to invoke filtering again to get the requested frame. Fix this by organizing the code differently, and making sure to invoke mp_filter_run() on every request (if there's nothing to do, it doesn't do anything anyway). Simplify it a bit by removing things which are not needed, like connecting filter graphs with different root filters.
* filter: adjust root log prefixwm42018-02-131-2/+3
| | | | | | | | | | Avoids that the audio decoder shows up with a "[root/ad]" log prefix. This is an annoying consequence of mp_log_new(): if a log parent doesn't have a prefix with "!", it'll add the prefix to all mp_logs created from it. This should probably be fixed in the mp_log code itself, but doing so would be a big deal as we'd have to make sure all the other log prefixes are what we want. So work it around for now.
* filter: don't randomly lose async wakeup notificationswm42018-02-051-5/+4
| | | | | | | | | | | | Another "what was I thinking" thing - destroying filters explicitly skipped async wakeups for no reason. These were notifications for filters that are not going to be destroyed too, and so their wakeup will be lost, leading to stalled playback. This is completely unnecessary and the special code can be removed. Fixes #5488. (This case destroyed all audio filters due to AO init failure, which could make clear out the f_demux_in.c wakeup for video, and "freeze" playback.)
* filter: add/use a convenience functionwm42018-02-031-0/+6
| | | | | I guess this is generally useful for filters which buffer data internally.
* video: rewrite filtering glue codewm42018-01-301-0/+790
Get rid of the old vf.c code. Replace it with a generic filtering framework, which can potentially handle more than just --vf. At least reimplementing --af with this code is planned. This changes some --vf semantics (including runtime behavior and the "vf" command). The most important ones are listed in interface-changes. vf_convert.c is renamed to f_swscale.c. It is now an internal filter that can not be inserted by the user manually. f_lavfi.c is a refactor of player/lavfi.c. The latter will be removed once --lavfi-complex is reimplemented on top of f_lavfi.c. (which is conceptually easy, but a big mess due to the data flow changes). The existing filters are all changed heavily. The data flow of the new filter framework is different. Especially EOF handling changes - EOF is now a "frame" rather than a state, and must be passed through exactly once. Another major thing is that all filters must support dynamic format changes. The filter reconfig() function goes away. (This sounds complex, but since all filters need to handle EOF draining anyway, they can use the same code, and it removes the mess with reconfig() having to predict the output format, which completely breaks with libavfilter anyway.) In addition, there is no automatic format negotiation or conversion. libavfilter's primitive and insufficient API simply doesn't allow us to do this in a reasonable way. Instead, filters can use f_autoconvert as sub-filter, and tell it which formats they support. This filter will in turn add actual conversion filters, such as f_swscale, to perform necessary format changes. vf_vapoursynth.c uses the same basic principle of operation as before, but with worryingly different details in data flow. Still appears to work. The hardware deint filters (vf_vavpp.c, vf_d3d11vpp.c, vf_vdpaupp.c) are heavily changed. Fortunately, they all used refqueue.c, which is for sharing the data flow logic (especially for managing future/past surfaces and such). It turns out it can be used to factor out most of the data flow. Some of these filters accepted software input. Instead of having ad-hoc upload code in each filter, surface upload is now delegated to f_autoconvert, which can use f_hwupload to perform this. Exporting VO capabilities is still a big mess (mp_stream_info stuff). The D3D11 code drops the redundant image formats, and all code uses the hw_subfmt (sw_format in FFmpeg) instead. Although that too seems to be a big mess for now. f_async_queue is unused.