various utility functions for use within FFmpeg More...
#include "avformat.h"
#include "avio_internal.h"
#include "internal.h"
#include "libavcodec/internal.h"
#include "libavcodec/raw.h"
#include "libavutil/opt.h"
#include "libavutil/dict.h"
#include "libavutil/pixdesc.h"
#include "metadata.h"
#include "id3v2.h"
#include "libavutil/avstring.h"
#include "riff.h"
#include "audiointerleave.h"
#include "url.h"
#include <sys/time.h>
#include <time.h>
#include <strings.h>
#include <stdarg.h>
#include "network.h"
#include <assert.h>
#include "libavutil/parseutils.h"
Go to the source code of this file.
Defines | |
#define | LICENSE_PREFIX "libavformat license: " |
#define | PROBE_BUF_MIN 2048 |
#define | PROBE_BUF_MAX (1<<20) |
#define | DURATION_MAX_READ_SIZE 250000 |
#define | DURATION_MAX_RETRY 3 |
#define | PRINT(...) do { if (!f) av_log(avcl, level, __VA_ARGS__); else fprintf(f, __VA_ARGS__); } while(0) |
#define | PRINT(...) do { if (!f) av_log(avcl, level, __VA_ARGS__); else fprintf(f, __VA_ARGS__); } while(0) |
Functions | |
unsigned | avformat_version (void) |
Return the LIBAVFORMAT_VERSION_INT constant. | |
const char * | avformat_configuration (void) |
Return the libavformat build-time configuration. | |
const char * | avformat_license (void) |
Return the libavformat license. | |
static void | av_frac_init (AVFrac *f, int64_t val, int64_t num, int64_t den) |
f = val + (num / den) + 0.5. | |
static void | av_frac_add (AVFrac *f, int64_t incr) |
Fractional addition to f: f = f + (incr / f->den). | |
AVInputFormat * | av_iformat_next (AVInputFormat *f) |
If f is NULL, returns the first registered input format, if f is non-NULL, returns the next registered input format after f or NULL if f is the last one. | |
AVOutputFormat * | av_oformat_next (AVOutputFormat *f) |
If f is NULL, returns the first registered output format, if f is non-NULL, returns the next registered output format after f or NULL if f is the last one. | |
void | av_register_input_format (AVInputFormat *format) |
void | av_register_output_format (AVOutputFormat *format) |
int | av_match_ext (const char *filename, const char *extensions) |
Return a positive value if the given filename has one of the given extensions, 0 otherwise. | |
static int | match_format (const char *name, const char *names) |
AVOutputFormat * | guess_format (const char *short_name, const char *filename, const char *mime_type) |
AVOutputFormat * | av_guess_format (const char *short_name, const char *filename, const char *mime_type) |
Return the output format in the list of registered output formats which best matches the provided parameters, or return NULL if there is no match. | |
AVOutputFormat * | guess_stream_format (const char *short_name, const char *filename, const char *mime_type) |
enum CodecID | av_guess_codec (AVOutputFormat *fmt, const char *short_name, const char *filename, const char *mime_type, enum AVMediaType type) |
Guess the codec ID based upon muxer and filename. | |
AVInputFormat * | av_find_input_format (const char *short_name) |
Find AVInputFormat based on the short name of the input format. | |
Variables | |
AVInputFormat * | first_iformat = NULL |
head of registered input format linked list | |
AVOutputFormat * | first_oformat = NULL |
head of registered output format linked list |
various utility functions for use within FFmpeg
Definition in file utils.c.
#define DURATION_MAX_READ_SIZE 250000 |
#define DURATION_MAX_RETRY 3 |
#define LICENSE_PREFIX "libavformat license: " |
#define PRINT | ( | ... | ) | do { if (!f) av_log(avcl, level, __VA_ARGS__); else fprintf(f, __VA_ARGS__); } while(0) |
#define PRINT | ( | ... | ) | do { if (!f) av_log(avcl, level, __VA_ARGS__); else fprintf(f, __VA_ARGS__); } while(0) |
#define PROBE_BUF_MAX (1<<20) |
#define PROBE_BUF_MIN 2048 |
AVInputFormat* av_find_input_format | ( | const char * | short_name | ) |
Find AVInputFormat based on the short name of the input format.
Definition at line 291 of file utils.c.
Referenced by http_receive_data(), movie_init(), opt_format(), opt_input_file(), parse_ffconfig(), and sap_read_header().
static void av_frac_add | ( | AVFrac * | f, | |
int64_t | incr | |||
) | [static] |
static void av_frac_init | ( | AVFrac * | f, | |
int64_t | val, | |||
int64_t | num, | |||
int64_t | den | |||
) | [static] |
enum CodecID av_guess_codec | ( | AVOutputFormat * | fmt, | |
const char * | short_name, | |||
const char * | filename, | |||
const char * | mime_type, | |||
enum AVMediaType | type | |||
) |
Guess the codec ID based upon muxer and filename.
Definition at line 270 of file utils.c.
Referenced by new_audio_stream(), new_subtitle_stream(), and new_video_stream().
AVOutputFormat* av_guess_format | ( | const char * | short_name, | |
const char * | filename, | |||
const char * | mime_type | |||
) |
Return the output format in the list of registered output formats which best matches the provided parameters, or return NULL if there is no match.
short_name | if non-NULL checks if short_name matches with the names of the registered formats | |
filename | if non-NULL checks if filename terminates with the extensions of the registered formats | |
mime_type | if non-NULL checks if mime_type matches with the MIME type of the registered formats |
Definition at line 214 of file utils.c.
Referenced by av_guess_format(), ff_rtp_chain_mux_open(), ffserver_guess_format(), guess_format(), guess_stream_format(), parse_ffconfig(), and rtp_new_av_stream().
AVInputFormat* av_iformat_next | ( | AVInputFormat * | f | ) |
If f is NULL, returns the first registered input format, if f is non-NULL, returns the next registered input format after f or NULL if f is the last one.
Definition at line 131 of file utils.c.
Referenced by av_find_input_format(), opt_default(), opt_find(), opt_formats(), and probe().
int av_match_ext | ( | const char * | filename, | |
const char * | extensions | |||
) |
Return a positive value if the given filename has one of the given extensions, 0 otherwise.
extensions | a comma-separated list of filename extensions |
Definition at line 161 of file utils.c.
Referenced by av_guess_format(), http_parse_request(), ipod_get_codec_tag(), mpegts_probe(), and nsv_probe().
AVOutputFormat* av_oformat_next | ( | AVOutputFormat * | f | ) |
If f is NULL, returns the first registered output format, if f is non-NULL, returns the next registered output format after f or NULL if f is the last one.
Definition at line 137 of file utils.c.
Referenced by av_guess_format(), opt_default(), opt_find(), opt_formats(), and opt_help().
void av_register_input_format | ( | AVInputFormat * | format | ) |
void av_register_output_format | ( | AVOutputFormat * | format | ) |
const char* avformat_configuration | ( | void | ) |
const char* avformat_license | ( | void | ) |
unsigned avformat_version | ( | void | ) |
AVOutputFormat* guess_format | ( | const char * | short_name, | |
const char * | filename, | |||
const char * | mime_type | |||
) |
AVOutputFormat* guess_stream_format | ( | const char * | short_name, | |
const char * | filename, | |||
const char * | mime_type | |||
) |
static int match_format | ( | const char * | name, | |
const char * | names | |||
) | [static] |
Definition at line 188 of file utils.c.
Referenced by av_find_input_format().