X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=fftools%2Fffmpeg.h;h=606f2afe0c19f46a2e32f569229562aca4b364ad;hb=e625ae609206e0550ff733965c6f5447579320aa;hp=eb1eaf63633bcf284055bb647322d068d0a9e19b;hpb=1a8be90adbaf86faa3053ff98118004ad7711c8c;p=ffmpeg diff --git a/fftools/ffmpeg.h b/fftools/ffmpeg.h index eb1eaf63633..606f2afe0c1 100644 --- a/fftools/ffmpeg.h +++ b/fftools/ffmpeg.h @@ -61,7 +61,6 @@ enum HWAccelID { HWACCEL_GENERIC, HWACCEL_VIDEOTOOLBOX, HWACCEL_QSV, - HWACCEL_CUVID, }; typedef struct HWAccel { @@ -72,7 +71,7 @@ typedef struct HWAccel { } HWAccel; typedef struct HWDevice { - char *name; + const char *name; enum AVHWDeviceType type; AVBufferRef *device_ref; } HWDevice; @@ -109,6 +108,8 @@ typedef struct OptionsContext { int nb_audio_sample_rate; SpecifierOpt *frame_rates; int nb_frame_rates; + SpecifierOpt *max_frame_rates; + int nb_max_frame_rates; SpecifierOpt *frame_sizes; int nb_frame_sizes; SpecifierOpt *frame_pix_fmts; @@ -216,6 +217,8 @@ typedef struct OptionsContext { int nb_passlogfiles; SpecifierOpt *max_muxing_queue_size; int nb_max_muxing_queue_size; + SpecifierOpt *muxing_queue_data_threshold; + int nb_muxing_queue_data_threshold; SpecifierOpt *guess_layout_max; int nb_guess_layout_max; SpecifierOpt *apad; @@ -230,6 +233,8 @@ typedef struct OptionsContext { int nb_time_bases; SpecifierOpt *enc_time_bases; int nb_enc_time_bases; + SpecifierOpt *autoscale; + int nb_autoscale; } OptionsContext; typedef struct InputFilter { @@ -302,9 +307,10 @@ typedef struct InputStream { #define DECODING_FOR_FILTER 2 AVCodecContext *dec_ctx; - AVCodec *dec; + const AVCodec *dec; AVFrame *decoded_frame; AVFrame *filter_frame; /* a ref of decoded_frame, to be sent to filters */ + AVPacket *pkt; int64_t start; /* time when read started */ /* predicted dts of the next packet read for this stream or (when there are @@ -349,6 +355,7 @@ typedef struct InputStream { AVFifoBuffer *sub_queue; ///< queue of AVSubtitle* before filter init AVFrame *frame; int w, h; + unsigned int initialize; ///< marks if sub2video_update should force an initialization } sub2video; int dr1; @@ -412,6 +419,8 @@ typedef struct InputFile { int rate_emu; int accurate_seek; + AVPacket *pkt; + #if HAVE_THREADS AVThreadMessageQueue *in_thread_queue; pthread_t thread; /* thread reading from this file */ @@ -430,7 +439,8 @@ enum forced_keyframes_const { FKF_NB }; -#define ABORT_ON_FLAG_EMPTY_OUTPUT (1 << 0) +#define ABORT_ON_FLAG_EMPTY_OUTPUT (1 << 0) +#define ABORT_ON_FLAG_EMPTY_OUTPUT_STREAM (1 << 1) extern const char *const forced_keyframes_const_names[]; @@ -459,15 +469,15 @@ typedef struct OutputStream { AVRational mux_timebase; AVRational enc_timebase; - int nb_bitstream_filters; - AVBSFContext **bsf_ctx; + AVBSFContext *bsf_ctx; AVCodecContext *enc_ctx; AVCodecParameters *ref_par; /* associated input codec parameters with encoders options applied */ - AVCodec *enc; + const AVCodec *enc; int64_t max_frames; AVFrame *filtered_frame; AVFrame *last_frame; + AVPacket *pkt; int last_dropped; int last_nb0_frames[3]; @@ -475,10 +485,12 @@ typedef struct OutputStream { /* video only */ AVRational frame_rate; + AVRational max_frame_rate; int is_cfr; int force_fps; int top_field_first; int rotate_overridden; + int autoscale; double rotate_override_value; AVRational frame_aspect_ratio; @@ -544,6 +556,15 @@ typedef struct OutputStream { /* the packets are buffered here until the muxer is ready to be initialized */ AVFifoBuffer *muxing_queue; + /* + * The size of the AVPackets' buffers in queue. + * Updated when a packet is either pushed or pulled from the queue. + */ + size_t muxing_queue_data_size; + + /* Threshold after which max_muxing_queue_size will be in effect */ + size_t muxing_queue_data_threshold; + /* packet picture type */ int pict_type; @@ -600,6 +621,7 @@ extern int debug_ts; extern int exit_on_error; extern int abort_on_flags; extern int print_stats; +extern int64_t stats_period; extern int qp_hist; extern int stdin_interaction; extern int frame_bits_per_raw_sample; @@ -610,12 +632,12 @@ extern char *videotoolbox_pixfmt; extern int filter_nbthreads; extern int filter_complex_nbthreads; extern int vstats_version; +extern int auto_conversion_filters; extern const AVIOInterruptCB int_cb; extern const OptionDef options[]; extern const HWAccel hwaccels[]; -extern AVBufferRef *hw_device_ctx; #if CONFIG_QSV extern char *qsv_device; #endif @@ -625,28 +647,20 @@ extern HWDevice *filter_hw_device; void term_init(void); void term_exit(void); -void reset_options(OptionsContext *o, int is_input); void show_usage(void); -void opt_output_file(void *optctx, const char *filename); - void remove_avoptions(AVDictionary **a, AVDictionary *b); void assert_avoptions(AVDictionary *m); int guess_input_channel_layout(InputStream *ist); -enum AVPixelFormat choose_pixel_fmt(AVStream *st, AVCodecContext *avctx, AVCodec *codec, enum AVPixelFormat target); -void choose_sample_fmt(AVStream *st, AVCodec *codec); - int configure_filtergraph(FilterGraph *fg); -int configure_output_filter(FilterGraph *fg, OutputFilter *ofilter, AVFilterInOut *out); void check_filter_outputs(void); -int ist_in_filtergraph(FilterGraph *fg, InputStream *ist); int filtergraph_is_simple(FilterGraph *fg); int init_simple_filtergraph(InputStream *ist, OutputStream *ost); int init_complex_filtergraph(FilterGraph *fg); -void sub2video_update(InputStream *ist, AVSubtitle *sub); +void sub2video_update(InputStream *ist, int64_t heartbeat_pts, AVSubtitle *sub); int ifilter_parameters_from_frame(InputFilter *ifilter, const AVFrame *frame); @@ -654,7 +668,6 @@ int ffmpeg_parse_options(int argc, char **argv); int videotoolbox_init(AVCodecContext *s); int qsv_init(AVCodecContext *s); -int cuvid_init(AVCodecContext *s); HWDevice *hw_device_get_by_name(const char *name); int hw_device_init_from_string(const char *arg, HWDevice **dev); @@ -662,6 +675,7 @@ void hw_device_free_all(void); int hw_device_setup_for_decode(InputStream *ist); int hw_device_setup_for_encode(OutputStream *ost); +int hw_device_setup_for_filter(FilterGraph *fg); int hwaccel_decode_init(AVCodecContext *avctx);