History

lavfi: add a new filtergraph parsing API

Callers currently have two ways of adding filters to a graph - they can either - create, initialize, and link them manually - use one of the avfilter_graph_parse*() functions, which take a (typically end-user-written) string, split it into individual filter definitions+options, then create filters, apply options, initialize filters, and finally link them - all based on information from this string. A major problem with the second approach is that it performs many actions as a single atomic unit, leaving the caller no space to intervene in between. Such intervention would be useful e.g. to - modify filter options; - supply hardware device contexts; both of which typically must be done before the filter is initialized. Callers who need such intervention are then forced to invent their own filtergraph parsing, which is clearly suboptimal. This commit aims to address this problem by adding a new modular filtergraph parsing API. It adds a new avfilter_graph_segment_parse() function to parse a string filtergraph description into an intermediate tree-like representation (AVFilterGraphSegment and its children). This intermediate form may then be applied step by step using further new avfilter_graph_segment*() functions, with user intervention possible between each step.

Anton Khirnov committed 3 years ago

Commit d1b9a3d1 parent 4310b664 files · +999 −8Browse files

Showing the changes to doc/APIchanges (1 of 4 files). Show all

Unified · Split

doc/APIchanges+15−0
@@ -2,6 +2,21 @@ The last version increases of all libraries were on 2023-02-09 · 1 unmodified line
2 2
3API changes, most recent first:3API changes, most recent first:
4 4
52023-02-12 - xxxxxxxxxx - lavfi 9.1.100 - avfilter.h
6 Add filtergraph segment parsing API.
7 New structs:
8 - AVFilterGraphSegment
9 - AVFilterChain
10 - AVFilterParams
11 - AVFilterPadParams
12 New functions:
13 - avfilter_graph_segment_parse()
14 - avfilter_graph_segment_create_filters()
15 - avfilter_graph_segment_apply_opts()
16 - avfilter_graph_segment_init()
17 - avfilter_graph_segment_link()
18 - avfilter_graph_segment_apply()
19
52023-02-xx - xxxxxxxxxx - lavu 58.0.100 - csp.h202023-02-xx - xxxxxxxxxx - lavu 58.0.100 - csp.h
6 Add av_csp_approximate_trc_gamma() and av_csp_trc_func_from_id().21 Add av_csp_approximate_trc_gamma() and av_csp_trc_func_from_id().
7 Add av_csp_trc_function.22 Add av_csp_trc_function.

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t