There's no reason for it to be explicitly 32 bits. It's declared as a
plain int in all other places in Libav.
This breaks audio filtering API and ABI in theory, but since it's
unusable right now this shouldn't be a problem.
The additional parameters are just complicating the function interface.
Assume that a requested samples buffer will *always* have the format
specified in the requested link.
This breaks audio filtering API and ABI in theory, but since it's
unusable right now this shouldn't be a problem.
Signed-off-by: Anton Khirnov <anton@khirnov.net>
Remove AVFilterBufferRefAudioProps.size, and use nb_samples in its place
everywhere.
This is required as the size in the audio buffer may be aligned, so it
may not contain a well defined number of samples.
Also remove the useless planar parameter, which can be deduced from the
sample format.
This is technically an API and ABI break, but since the audio part of
lavfi is not usable now, this should not be a problem in practice.
Signed-off-by: Anton Khirnov <anton@khirnov.net>
This fixes a double-free crash if lists are the same due to the two
merge_ref() calls at the end of the (useless) merging that happens.
Signed-off-by: Anton Khirnov <anton@khirnov.net>
This is required for letting applications to create and destroy
AVFilterInOut structs in a convenient way.
Signed-off-by: Anton Khirnov <anton@khirnov.net>
Right now, e.g. scale,[in]overlay would connect scale to the first
overlay input and [in] to the second, which goes against the
documentation and is unintuitive.
The bug happens because of the ordering mess in curr_inputs variable:
1) the unlabeled links from the previous filter are added to it in
correct order
2) input labels are parsed and inserted to the beginning one by one
(i.e. in reverse order)
3) curr_inputs is matched against filter inputs in reverse order
Fix the problem by always using proper ordering without trying to be
clever.
Unlike avfilter_graph_parse(), it returns unlinked inputs and outputs
to the caller, which allows parsing of graphs where inputs/outputs are
not known in advance.
Signal that it can output a frame when there are frames on the main
input and EOF on the overlay input, but a frame is buffered -- e.g.
single picture overlay.
Current code, with a filterchain such as
(input - yuv411) -> (scale - any) -> (sink - any)
will result in yuv420 being chosen for the second link, which is clearly
not right.
This commit attempts to improve in the following way:
repeat until convergence:
loop over all filters
find input link with exactly one format
force this format on all output links of the same type (if possible)
Before, drawtext filter deliberately altered given text coordinates if
text didn't fully fit on the picture. This breaks the use case of
scrolling large text, e.g. movie closing credits.
Add 'fix_bounds', to make it usable in such cases (by setting its value to 0).
Default behavior is not changed, and non-fitting text coords are fixed.
Signed-off-by: Anton Khirnov <anton@khirnov.net>