diff options
Diffstat (limited to 'cmdutils.h')
-rw-r--r-- | cmdutils.h | 88 |
1 files changed, 31 insertions, 57 deletions
@@ -2,25 +2,25 @@ * Various utilities for command line tools * copyright (c) 2003 Fabrice Bellard * - * This file is part of Libav. + * This file is part of FFmpeg. * - * Libav is free software; you can redistribute it and/or + * FFmpeg is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * - * Libav is distributed in the hope that it will be useful, + * FFmpeg is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with Libav; if not, write to the Free Software + * License along with FFmpeg; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef LIBAV_CMDUTILS_H -#define LIBAV_CMDUTILS_H +#ifndef FFMPEG_CMDUTILS_H +#define FFMPEG_CMDUTILS_H #include <stdint.h> @@ -29,6 +29,10 @@ #include "libavformat/avformat.h" #include "libswscale/swscale.h" +#ifdef __MINGW32__ +#undef main /* We don't want SDL to override our main() */ +#endif + /** * program name, defined by the program for show_version(). */ @@ -58,7 +62,7 @@ void uninit_opts(void); /** * Trivial log callback. - * Only suitable for show_help and similar since it lacks prefix handling. + * Only suitable for opt_help and similar since it lacks prefix handling. */ void log_callback_help(void* ptr, int level, const char* fmt, va_list vl); @@ -147,7 +151,7 @@ void show_help_options(const OptionDef *options, const char *msg, int mask, int * not have to be processed. */ void parse_options(int argc, char **argv, const OptionDef *options, - void (* parse_arg_function)(const char*)); + int (* parse_arg_function)(const char *opt, const char *arg)); void set_context_opts(void *ctx, void *opts_ctx, int flags, AVCodec *codec); @@ -173,50 +177,58 @@ void show_banner(void); * Print the version of the program to stdout. The version message * depends on the current versions of the repository and of the libav* * libraries. + * This option processing function does not utilize the arguments. */ -void show_version(void); +int opt_version(const char *opt, const char *arg); /** * Print the license of the program to stdout. The license depends on * the license of the libraries compiled into the program. + * This option processing function does not utilize the arguments. */ -void show_license(void); +int opt_license(const char *opt, const char *arg); /** * Print a listing containing all the formats supported by the * program. + * This option processing function does not utilize the arguments. */ -void show_formats(void); +int opt_formats(const char *opt, const char *arg); /** * Print a listing containing all the codecs supported by the * program. + * This option processing function does not utilize the arguments. */ -void show_codecs(void); +int opt_codecs(const char *opt, const char *arg); /** * Print a listing containing all the filters supported by the * program. + * This option processing function does not utilize the arguments. */ -void show_filters(void); +int opt_filters(const char *opt, const char *arg); /** * Print a listing containing all the bit stream filters supported by the * program. + * This option processing function does not utilize the arguments. */ -void show_bsfs(void); +int opt_bsfs(const char *opt, const char *arg); /** * Print a listing containing all the protocols supported by the * program. + * This option processing function does not utilize the arguments. */ -void show_protocols(void); +int opt_protocols(const char *opt, const char *arg); /** * Print a listing containing all the pixel formats supported by the * program. + * This option processing function does not utilize the arguments. */ -void show_pix_fmts(void); +int opt_pix_fmts(const char *opt, const char *arg); /** * Return a positive value if a line read from standard input @@ -235,37 +247,14 @@ int read_yesno(void); */ int read_file(const char *filename, char **bufptr, size_t *size); -typedef struct { - int64_t num_faulty_pts; /// Number of incorrect PTS values so far - int64_t num_faulty_dts; /// Number of incorrect DTS values so far - int64_t last_pts; /// PTS of the last frame - int64_t last_dts; /// DTS of the last frame -} PtsCorrectionContext; - -/** - * Reset the state of the PtsCorrectionContext. - */ -void init_pts_correction(PtsCorrectionContext *ctx); - -/** - * Attempt to guess proper monotonic timestamps for decoded video frames - * which might have incorrect times. Input timestamps may wrap around, in - * which case the output will as well. - * - * @param pts the pts field of the decoded AVPacket, as passed through - * AVCodecContext.reordered_opaque - * @param dts the dts field of the decoded AVPacket - * @return one of the input values, may be AV_NOPTS_VALUE - */ -int64_t guess_correct_pts(PtsCorrectionContext *ctx, int64_t pts, int64_t dts); - /** * Get a file corresponding to a preset file. * * If is_path is non-zero, look for the file in the path preset_name. * Otherwise search for a file named arg.ffpreset in the directories * $FFMPEG_DATADIR (if set), $HOME/.ffmpeg, and in the datadir defined - * at configuration time, in that order. If no such file is found and + * at configuration time or in a "ffpresets" folder along the executable + * on win32, in that order. If no such file is found and * codec_name is defined, then search for a file named * codec_name-preset_name.ffpreset in the above-mentioned directories. * @@ -279,19 +268,4 @@ int64_t guess_correct_pts(PtsCorrectionContext *ctx, int64_t pts, int64_t dts); FILE *get_preset_file(char *filename, size_t filename_size, const char *preset_name, int is_path, const char *codec_name); -typedef struct { - enum PixelFormat pix_fmt; -} FFSinkContext; - -extern AVFilter ffsink; - -/** - * Extract a frame from sink. - * - * @return a negative error in case of failure, 1 if one frame has - * been extracted successfully. - */ -int get_filtered_video_frame(AVFilterContext *sink, AVFrame *frame, - AVFilterBufferRef **picref, AVRational *pts_tb); - -#endif /* LIBAV_CMDUTILS_H */ +#endif /* FFMPEG_CMDUTILS_H */ |