1
0
Fork 0

fftools/ffmpeg: cosmetics, vertically align structs

This commit is contained in:
Anton Khirnov 2024-02-14 19:08:18 +01:00
parent 6b6815b1c8
commit a3f69cdec7
4 changed files with 146 additions and 146 deletions

View File

@ -35,20 +35,20 @@
#include "thread_queue.h" #include "thread_queue.h"
typedef struct DecoderPriv { typedef struct DecoderPriv {
Decoder dec; Decoder dec;
AVCodecContext *dec_ctx; AVCodecContext *dec_ctx;
AVFrame *frame; AVFrame *frame;
AVPacket *pkt; AVPacket *pkt;
// override output video sample aspect ratio with this value // override output video sample aspect ratio with this value
AVRational sar_override; AVRational sar_override;
AVRational framerate_in; AVRational framerate_in;
// a combination of DECODER_FLAG_*, provided to dec_open() // a combination of DECODER_FLAG_*, provided to dec_open()
int flags; int flags;
enum AVPixelFormat hwaccel_pix_fmt; enum AVPixelFormat hwaccel_pix_fmt;
enum HWAccelID hwaccel_id; enum HWAccelID hwaccel_id;
@ -58,22 +58,22 @@ typedef struct DecoderPriv {
// pts/estimated duration of the last decoded frame // pts/estimated duration of the last decoded frame
// * in decoder timebase for video, // * in decoder timebase for video,
// * in last_frame_tb (may change during decoding) for audio // * in last_frame_tb (may change during decoding) for audio
int64_t last_frame_pts; int64_t last_frame_pts;
int64_t last_frame_duration_est; int64_t last_frame_duration_est;
AVRational last_frame_tb; AVRational last_frame_tb;
int64_t last_filter_in_rescale_delta; int64_t last_filter_in_rescale_delta;
int last_frame_sample_rate; int last_frame_sample_rate;
/* previous decoded subtitles */ /* previous decoded subtitles */
AVFrame *sub_prev[2]; AVFrame *sub_prev[2];
AVFrame *sub_heartbeat; AVFrame *sub_heartbeat;
Scheduler *sch; Scheduler *sch;
unsigned sch_idx; unsigned sch_idx;
void *log_parent; void *log_parent;
char log_name[32]; char log_name[32];
char *parent_name; char *parent_name;
} DecoderPriv; } DecoderPriv;
static DecoderPriv *dp_from_dec(Decoder *d) static DecoderPriv *dp_from_dec(Decoder *d)

View File

@ -40,41 +40,41 @@
#include "libavformat/avformat.h" #include "libavformat/avformat.h"
typedef struct DemuxStream { typedef struct DemuxStream {
InputStream ist; InputStream ist;
// name used for logging // name used for logging
char log_name[32]; char log_name[32];
int sch_idx_stream; int sch_idx_stream;
int sch_idx_dec; int sch_idx_dec;
double ts_scale; double ts_scale;
/* non zero if the packets must be decoded in 'raw_fifo', see DECODING_FOR_* */ /* non zero if the packets must be decoded in 'raw_fifo', see DECODING_FOR_* */
int decoding_needed; int decoding_needed;
#define DECODING_FOR_OST 1 #define DECODING_FOR_OST 1
#define DECODING_FOR_FILTER 2 #define DECODING_FOR_FILTER 2
/* true if stream data should be discarded */ /* true if stream data should be discarded */
int discard; int discard;
// scheduler returned EOF for this stream // scheduler returned EOF for this stream
int finished; int finished;
int streamcopy_needed; int streamcopy_needed;
int have_sub2video; int have_sub2video;
int reinit_filters; int reinit_filters;
int wrap_correction_done; int wrap_correction_done;
int saw_first_ts; int saw_first_ts;
///< dts of the first packet read for this stream (in AV_TIME_BASE units) ///< dts of the first packet read for this stream (in AV_TIME_BASE units)
int64_t first_dts; int64_t first_dts;
/* predicted dts of the next packet read for this stream or (when there are /* predicted dts of the next packet read for this stream or (when there are
* several frames in a packet) of the next frame in current packet (in AV_TIME_BASE units) */ * several frames in a packet) of the next frame in current packet (in AV_TIME_BASE units) */
int64_t next_dts; int64_t next_dts;
///< dts of the last packet read for this stream (in AV_TIME_BASE units) ///< dts of the last packet read for this stream (in AV_TIME_BASE units)
int64_t dts; int64_t dts;
const AVCodecDescriptor *codec_desc; const AVCodecDescriptor *codec_desc;
@ -82,45 +82,45 @@ typedef struct DemuxStream {
DecoderOpts dec_opts; DecoderOpts dec_opts;
char dec_name[16]; char dec_name[16];
AVBSFContext *bsf; AVBSFContext *bsf;
/* number of packets successfully read for this stream */ /* number of packets successfully read for this stream */
uint64_t nb_packets; uint64_t nb_packets;
// combined size of all the packets read // combined size of all the packets read
uint64_t data_size; uint64_t data_size;
} DemuxStream; } DemuxStream;
typedef struct Demuxer { typedef struct Demuxer {
InputFile f; InputFile f;
// name used for logging // name used for logging
char log_name[32]; char log_name[32];
int64_t wallclock_start; int64_t wallclock_start;
/** /**
* Extra timestamp offset added by discontinuity handling. * Extra timestamp offset added by discontinuity handling.
*/ */
int64_t ts_offset_discont; int64_t ts_offset_discont;
int64_t last_ts; int64_t last_ts;
int64_t recording_time; int64_t recording_time;
int accurate_seek; int accurate_seek;
/* number of times input stream should be looped */ /* number of times input stream should be looped */
int loop; int loop;
int have_audio_dec; int have_audio_dec;
/* duration of the looped segment of the input file */ /* duration of the looped segment of the input file */
Timestamp duration; Timestamp duration;
/* pts with the smallest/largest values ever seen */ /* pts with the smallest/largest values ever seen */
Timestamp min_pts; Timestamp min_pts;
Timestamp max_pts; Timestamp max_pts;
/* number of streams that the user was warned of */ /* number of streams that the user was warned of */
int nb_streams_warn; int nb_streams_warn;
float readrate; float readrate;
double readrate_initial_burst; double readrate_initial_burst;
Scheduler *sch; Scheduler *sch;

View File

@ -43,27 +43,27 @@
#include "libavcodec/mathops.h" #include "libavcodec/mathops.h"
typedef struct FilterGraphPriv { typedef struct FilterGraphPriv {
FilterGraph fg; FilterGraph fg;
// name used for logging // name used for logging
char log_name[32]; char log_name[32];
int is_simple; int is_simple;
// true when the filtergraph contains only meta filters // true when the filtergraph contains only meta filters
// that do not modify the frame data // that do not modify the frame data
int is_meta; int is_meta;
// source filters are present in the graph // source filters are present in the graph
int have_sources; int have_sources;
int disable_conversions; int disable_conversions;
unsigned nb_outputs_done; unsigned nb_outputs_done;
const char *graph_desc; const char *graph_desc;
// frame for temporarily holding output from the filtergraph // frame for temporarily holding output from the filtergraph
AVFrame *frame; AVFrame *frame;
// frame for sending output to the encoder // frame for sending output to the encoder
AVFrame *frame_enc; AVFrame *frame_enc;
Scheduler *sch; Scheduler *sch;
unsigned sch_idx; unsigned sch_idx;
@ -81,70 +81,70 @@ static const FilterGraphPriv *cfgp_from_cfg(const FilterGraph *fg)
// data that is local to the filter thread and not visible outside of it // data that is local to the filter thread and not visible outside of it
typedef struct FilterGraphThread { typedef struct FilterGraphThread {
AVFilterGraph *graph; AVFilterGraph *graph;
AVFrame *frame; AVFrame *frame;
// Temporary buffer for output frames, since on filtergraph reset // Temporary buffer for output frames, since on filtergraph reset
// we cannot send them to encoders immediately. // we cannot send them to encoders immediately.
// The output index is stored in frame opaque. // The output index is stored in frame opaque.
AVFifo *frame_queue_out; AVFifo *frame_queue_out;
// index of the next input to request from the scheduler // index of the next input to request from the scheduler
unsigned next_in; unsigned next_in;
// set to 1 after at least one frame passed through this output // set to 1 after at least one frame passed through this output
int got_frame; int got_frame;
// EOF status of each input/output, as received by the thread // EOF status of each input/output, as received by the thread
uint8_t *eof_in; uint8_t *eof_in;
uint8_t *eof_out; uint8_t *eof_out;
} FilterGraphThread; } FilterGraphThread;
typedef struct InputFilterPriv { typedef struct InputFilterPriv {
InputFilter ifilter; InputFilter ifilter;
InputFilterOptions opts; InputFilterOptions opts;
int index; int index;
AVFilterContext *filter; AVFilterContext *filter;
InputStream *ist; InputStream *ist;
// used to hold submitted input // used to hold submitted input
AVFrame *frame; AVFrame *frame;
/* for filters that are not yet bound to an input stream, /* for filters that are not yet bound to an input stream,
* this stores the input linklabel, if any */ * this stores the input linklabel, if any */
uint8_t *linklabel; uint8_t *linklabel;
// filter data type // filter data type
enum AVMediaType type; enum AVMediaType type;
// source data type: AVMEDIA_TYPE_SUBTITLE for sub2video, // source data type: AVMEDIA_TYPE_SUBTITLE for sub2video,
// same as type otherwise // same as type otherwise
enum AVMediaType type_src; enum AVMediaType type_src;
int eof; int eof;
// parameters configured for this input // parameters configured for this input
int format; int format;
int width, height; int width, height;
AVRational sample_aspect_ratio; AVRational sample_aspect_ratio;
enum AVColorSpace color_space; enum AVColorSpace color_space;
enum AVColorRange color_range; enum AVColorRange color_range;
int sample_rate; int sample_rate;
AVChannelLayout ch_layout; AVChannelLayout ch_layout;
AVRational time_base; AVRational time_base;
AVFifo *frame_queue; AVFifo *frame_queue;
AVBufferRef *hw_frames_ctx; AVBufferRef *hw_frames_ctx;
int displaymatrix_present; int displaymatrix_present;
int32_t displaymatrix[9]; int32_t displaymatrix[9];
// fallback parameters to use when no input is ever sent // fallback parameters to use when no input is ever sent
struct { struct {
@ -177,15 +177,15 @@ static InputFilterPriv *ifp_from_ifilter(InputFilter *ifilter)
} }
typedef struct FPSConvContext { typedef struct FPSConvContext {
AVFrame *last_frame; AVFrame *last_frame;
/* number of frames emitted by the video-encoding sync code */ /* number of frames emitted by the video-encoding sync code */
int64_t frame_number; int64_t frame_number;
/* history of nb_frames_prev, i.e. the number of times the /* history of nb_frames_prev, i.e. the number of times the
* previous frame was duplicated by vsync code in recent * previous frame was duplicated by vsync code in recent
* do_video_out() calls */ * do_video_out() calls */
int64_t frames_prev_hist[3]; int64_t frames_prev_hist[3];
uint64_t dup_warning; uint64_t dup_warning;
int last_dropped; int last_dropped;
int dropped_keyframe; int dropped_keyframe;
@ -197,38 +197,38 @@ typedef struct FPSConvContext {
} FPSConvContext; } FPSConvContext;
typedef struct OutputFilterPriv { typedef struct OutputFilterPriv {
OutputFilter ofilter; OutputFilter ofilter;
int index; int index;
AVFilterContext *filter; AVFilterContext *filter;
/* desired output stream properties */ /* desired output stream properties */
int format; int format;
int width, height; int width, height;
int sample_rate; int sample_rate;
AVChannelLayout ch_layout; AVChannelLayout ch_layout;
// time base in which the output is sent to our downstream // time base in which the output is sent to our downstream
// does not need to match the filtersink's timebase // does not need to match the filtersink's timebase
AVRational tb_out; AVRational tb_out;
// at least one frame with the above timebase was sent // at least one frame with the above timebase was sent
// to our downstream, so it cannot change anymore // to our downstream, so it cannot change anymore
int tb_out_locked; int tb_out_locked;
AVRational sample_aspect_ratio; AVRational sample_aspect_ratio;
// those are only set if no format is specified and the encoder gives us multiple options // those are only set if no format is specified and the encoder gives us multiple options
// They point directly to the relevant lists of the encoder. // They point directly to the relevant lists of the encoder.
const int *formats; const int *formats;
const AVChannelLayout *ch_layouts; const AVChannelLayout *ch_layouts;
const int *sample_rates; const int *sample_rates;
AVRational enc_timebase; AVRational enc_timebase;
// offset for output timestamps, in AV_TIME_BASE_Q // offset for output timestamps, in AV_TIME_BASE_Q
int64_t ts_offset; int64_t ts_offset;
int64_t next_pts; int64_t next_pts;
FPSConvContext fps; FPSConvContext fps;
} OutputFilterPriv; } OutputFilterPriv;
static OutputFilterPriv *ofp_from_ofilter(OutputFilter *ofilter) static OutputFilterPriv *ofp_from_ofilter(OutputFilter *ofilter)

View File

@ -34,73 +34,73 @@
#include "libavutil/fifo.h" #include "libavutil/fifo.h"
typedef struct MuxStream { typedef struct MuxStream {
OutputStream ost; OutputStream ost;
// name used for logging // name used for logging
char log_name[32]; char log_name[32];
AVBSFContext *bsf_ctx; AVBSFContext *bsf_ctx;
AVPacket *bsf_pkt; AVPacket *bsf_pkt;
AVPacket *pkt; AVPacket *pkt;
EncStats stats; EncStats stats;
int sch_idx; int sch_idx;
int sch_idx_enc; int sch_idx_enc;
int sch_idx_src; int sch_idx_src;
int sq_idx_mux; int sq_idx_mux;
int64_t max_frames; int64_t max_frames;
// timestamp from which the streamcopied streams should start, // timestamp from which the streamcopied streams should start,
// in AV_TIME_BASE_Q; // in AV_TIME_BASE_Q;
// everything before it should be discarded // everything before it should be discarded
int64_t ts_copy_start; int64_t ts_copy_start;
/* dts of the last packet sent to the muxer, in the stream timebase /* dts of the last packet sent to the muxer, in the stream timebase
* used for making up missing dts values */ * used for making up missing dts values */
int64_t last_mux_dts; int64_t last_mux_dts;
int64_t stream_duration; int64_t stream_duration;
AVRational stream_duration_tb; AVRational stream_duration_tb;
// state for av_rescale_delta() call for audio in write_packet() // state for av_rescale_delta() call for audio in write_packet()
int64_t ts_rescale_delta_last; int64_t ts_rescale_delta_last;
// combined size of all the packets sent to the muxer // combined size of all the packets sent to the muxer
uint64_t data_size_mux; uint64_t data_size_mux;
int copy_initial_nonkeyframes; int copy_initial_nonkeyframes;
int copy_prior_start; int copy_prior_start;
int streamcopy_started; int streamcopy_started;
} MuxStream; } MuxStream;
typedef struct Muxer { typedef struct Muxer {
OutputFile of; OutputFile of;
// name used for logging // name used for logging
char log_name[32]; char log_name[32];
AVFormatContext *fc; AVFormatContext *fc;
Scheduler *sch; Scheduler *sch;
unsigned sch_idx; unsigned sch_idx;
// OutputStream indices indexed by scheduler stream indices // OutputStream indices indexed by scheduler stream indices
int *sch_stream_idx; int *sch_stream_idx;
int nb_sch_stream_idx; int nb_sch_stream_idx;
AVDictionary *opts; AVDictionary *opts;
/* filesize limit expressed in bytes */ /* filesize limit expressed in bytes */
int64_t limit_filesize; int64_t limit_filesize;
atomic_int_least64_t last_filesize; atomic_int_least64_t last_filesize;
int header_written; int header_written;
SyncQueue *sq_mux; SyncQueue *sq_mux;
AVPacket *sq_pkt; AVPacket *sq_pkt;
} Muxer; } Muxer;
int mux_check_init(void *arg); int mux_check_init(void *arg);