X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=cmdutils.h;h=45d98586fa58a568df9c41d3e2bc78cd9b3bbee4;hb=2575b1917b2703fae41a4b4901ad85c888374dfd;hp=1ae1978ab2a381d47c30524e9d25b98c8bd16a5d;hpb=9d3009c6c4b9b6734f07df7c88f6a42ded6cdf38;p=ffmpeg diff --git a/cmdutils.h b/cmdutils.h index 1ae1978ab2a..45d98586fa5 100644 --- a/cmdutils.h +++ b/cmdutils.h @@ -44,6 +44,16 @@ extern AVFormatContext *avformat_opts; extern struct SwsContext *sws_opts; extern AVDictionary *format_opts, *codec_opts, *resample_opts; +/** + * Register a program-specific cleanup routine. + */ +void register_exit(void (*cb)(int ret)); + +/** + * Wraps exit with a program-specific cleanup routine. + */ +void exit_program(int ret) av_noreturn; + /** * Initialize the cmdutils option system, in particular * allocate the *_opts contexts. @@ -61,6 +71,11 @@ void uninit_opts(void); */ void log_callback_help(void* ptr, int level, const char* fmt, va_list vl); +/** + * Override the cpuflags mask. + */ +int opt_cpuflags(void *optctx, const char *opt, const char *arg); + /** * Fallback for options that are not explicitly handled, these will be * parsed through AVOptions. @@ -445,18 +460,6 @@ int show_sample_fmts(void *optctx, const char *opt, const char *arg); */ int read_yesno(void); -/** - * Read the file with name filename, and put its content in a newly - * allocated 0-terminated buffer. - * - * @param filename file to read from - * @param bufptr location where pointer to buffer is returned - * @param size location where size of buffer is returned - * @return 0 in case of success, a negative value corresponding to an - * AVERROR error code in case of failure. - */ -int cmdutils_read_file(const char *filename, char **bufptr, size_t *size); - typedef struct PtsCorrectionContext { int64_t num_faulty_pts; /// Number of incorrect PTS values so far int64_t num_faulty_dts; /// Number of incorrect DTS values so far @@ -514,6 +517,11 @@ FILE *get_preset_file(char *filename, size_t filename_size, */ void *grow_array(void *array, int elem_size, int *size, int new_size); +/** + * Get a string describing a media type. + */ +const char *media_type_string(enum AVMediaType media_type); + #define GROW_ARRAY(array, nb_elems)\ array = grow_array(array, sizeof(*array), &nb_elems, nb_elems + 1)