All remaining code accessing it only needs to know whether this
filtergraph output has been bound or not.
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Stop digging through encoder options manually.
Will allow decoupling filtering from encoding in future commits.
Signed-off-by: Paul B Mahol <onemda@gmail.com>
The decision whether -apad actually does anything is made based on muxer
properties, and so more properly belongs there. Filtering code only
receives the result.
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Do not read them from OutputStream directly.
Will allow decoupling filtering from encoding in future commits.
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Do not read it from OutputStream directly.
Will allow decoupling filtering from encoding in future commits.
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Do not read them from OutputStream directly.
Will allow decoupling filtering from encoding in future commits.
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Do not construct it from OutputStream manually.
Will allow decoupling filtering from encoding in future commits.
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Do not read it from OutputStream directly.
Will allow decoupling filtering from encoding in future commits.
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Pass all the necessary value through OutputFilterOptions.
Will allow decoupling filtering from encoding in future commits.
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Reduces the need to access OutputStream, which will allow decoupling
filtering from encoding in future commits.
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Reduces the need to access OutputStream, which will allow decoupling
filtering from encoding in future commits.
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Reduces the need to access OutputFile, which will allow decoupling
filtering from encoding in future commits.
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Instead pass the encoder through a newly-added output options struct,
analogous to previously added input options.
Will allow decoupling filtering from encoding in future commits.
Signed-off-by: Paul B Mahol <onemda@gmail.com>
MATCH_PER_STREAM_OPT iterates over all options of a given
OptionDef and tests whether they apply to the current stream;
if so, they are set to ost->apad, otherwise, the code errors
out. If no error happens, ost->apad is av_strdup'ed in order
to take ownership of this pointer.
But this means that setting it originally was premature,
as it leads to double-frees when an error happens lateron.
This can simply be reproduced with
ffmpeg -filter_complex anullsrc -apad bar -apad:n baz -f null -
This is a regression since 83ace80bfd.
Fix this by using a temporary variable instead of directly
setting ost->apad. Also only strdup the string if it actually
is != NULL.
Reviewed-by: Marth64 <marth64@proxyid.net>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Signed-off-by: Paul B Mahol <onemda@gmail.com>
The filename is freed with the OptionsContext and therefore
there will be a use-after-free when reporting the filename
in print_stream_maps(). So create a copy of the string.
This is a regression since 8aed3911fc454e79697e183660bf30d31334a64b.
fate-lavf-mkv_attachment exhibits it (and reports a random nonsense
filename here), but this does not make the test fail (not even with
valgrind; only with ASAN, as it aborts on use-after-free).
Reviewed-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Makes it robust against adding fields before it, which will be useful in
following commits.
Majority of the patch generated by the following Coccinelle script:
@@
typedef AVOption;
identifier arr_name;
initializer list il;
initializer list[8] il1;
expression tail;
@@
AVOption arr_name[] = { il, { il1,
- tail
+ .unit = tail
}, ... };
with some manual changes, as the script:
* has trouble with options defined inside macros
* sometimes does not handle options under an #else branch
* sometimes swallows whitespace
Use 8 packets/frames by default rather than 1, which seems to provide
better throughput.
Allow -thread_queue_size to set the muxer queue size manually again.
Signed-off-by: Paul B Mahol <onemda@gmail.com>
If the arguments are read from a file, things like line breaks could be present
Signed-off-by: James Almer <jamrial@gmail.com>
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Unnecessary since acf63d5350adeae551d412db699f8ca03f7e76b9;
also avoids relocations.
Reviewed-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Currently it requires every single OPT_SPEC option to be accompanied by
an array of alternate names for this option. The vast majority of
options have no alternate names, resulting in a large numbers of
unnecessary single-element arrays that merely contain the option name.
Extend the option parsing API to allow marking options as having
alternate names, or as being the canonical name for some existing
alternatives. Use this new information to avoid the need for
abovementioned unnecessary single-element arrays.
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Long is 32 bits signed on Windows, and nb_stream{s,_groups} are both unsigned
int. In a realistic scenario this wont make a difference, but it's still
proper.
Also ensure the parsed string is an integer while at it.
Signed-off-by: James Almer <jamrial@gmail.com>
Signed-off-by: Paul B Mahol <onemda@gmail.com>
They cannot store 1 as signed, only 0 and -1.
Avoids warnings such as:
implicit truncation from 'int' to a one-bit wide bit-field changes value from 1 to -1 [-Wsingle-bit-bitfield-constant-conversion]
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Change the main loop and every component (demuxers, decoders, filters,
encoders, muxers) to use the previously added transcode scheduler. Every
instance of every such component was already running in a separate
thread, but now they can actually run in parallel.
Changes the results of ffmpeg-fix_sub_duration_heartbeat - tested by
JEEB to be more correct and deterministic.
Signed-off-by: Paul B Mahol <onemda@gmail.com>
See the comment block at the top of fftools/ffmpeg_sched.h for more
details on what this scheduler is for.
This commit adds the scheduling code itself, along with minimal
integration with the rest of the program:
* allocating and freeing the scheduler
* passing it throughout the call stack in order to register the
individual components (demuxers/decoders/filtergraphs/encoders/muxers)
with the scheduler
The scheduler is not actually used as of this commit, so it should not
result in any change in behavior. That will change in future commits.
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Fixes ticket #10638 (and should also fix ticket #10482)
by restoring the behaviour from before
3c7dd5ed37.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Always use the functionality of the latter, which makes more sense as it
avoids losing keyframes due to vsync code dropping frames.
Deprecate the 'source_no_drop' value, as it is now redundant.
It is badly named (should have been -top_field_first, or at least -tff),
underdocumented and underspecified, and (most importantly) entirely
redundant with the setfield filter.