diff options
author | Anton Khirnov <anton@khirnov.net> | 2024-02-22 13:24:38 +0100 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2024-03-13 08:01:15 +0100 |
commit | f5d03b972c49323a0cb03195d596aaae0ab397b1 (patch) | |
tree | 473ff6f82f9f591fe31c66833b162a8150aa0082 /fftools/ffmpeg.h | |
parent | cabeac91238773ec7395048eedafef661255a8de (diff) | |
download | ffmpeg-f5d03b972c49323a0cb03195d596aaae0ab397b1.tar.gz |
fftools/ffmpeg: simplify propagating fallback parameters from decoders to filters
Current callstack looks like this:
* ifilter_bind_ist() (filter) calls ist_filter_add() (demuxer);
* ist_filter_add() opens the decoder, and then calls
dec_add_filter() (decoder);
* dec_add_filter() calls ifilter_parameters_from_dec() (i.e. back into
the filtering code) in order to give post-avcodec_open2() parameters
to the filter.
This is unnecessarily complicated. Pass the parameters as follows
instead:
* dec_init() (which opens the decoder) returns post-avcodec_open2()
parameters to its caller (i.e. the demuxer) in a parameter-only
AVFrame
* the demuxer passes these parameters to the filter in
InputFilterOptions, together with other filter options
Diffstat (limited to 'fftools/ffmpeg.h')
-rw-r--r-- | fftools/ffmpeg.h | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/fftools/ffmpeg.h b/fftools/ffmpeg.h index d3e03543ac..1a60f035b0 100644 --- a/fftools/ffmpeg.h +++ b/fftools/ffmpeg.h @@ -259,6 +259,8 @@ typedef struct InputFilterOptions { // a combination of IFILTER_FLAG_* unsigned flags; + + AVFrame *fallback; } InputFilterOptions; typedef struct InputFilter { @@ -735,16 +737,17 @@ AVBufferRef *hw_device_for_filter(void); /** * @param dec_opts Dictionary filled with decoder options. Its ownership * is transferred to the decoder. + * @param param_out If non-NULL, media properties after opening the decoder + * are written here. * * @retval ">=0" non-negative scheduler index on success * @retval "<0" an error code on failure */ int dec_init(Decoder **pdec, Scheduler *sch, - AVDictionary **dec_opts, const DecoderOpts *o); + AVDictionary **dec_opts, const DecoderOpts *o, + AVFrame *param_out); void dec_free(Decoder **pdec); -int dec_add_filter(Decoder *dec, InputFilter *ifilter); - int enc_alloc(Encoder **penc, const AVCodec *codec, Scheduler *sch, unsigned sch_idx); void enc_free(Encoder **penc); |