Go to the documentation of this file.
55 #define SANE_CHUNK_SIZE (50000000)
83 if (
ret != read_size) {
100 #if FF_API_INIT_PACKET
156 if (bps <= 0 || bps > 64)
171 if (sflags & (1 << (
bps - 1))) {
214 for (
int i = 0; tags && tags[
i];
i++) {
217 if (codec_tags->
id ==
id) {
229 for (
int i = 0; tags && tags[
i];
i++) {
264 uint64_t ntp_ts, frac_part, sec;
268 sec = ntp_time_us / 1000000;
269 usec = ntp_time_us % 1000000;
272 frac_part = usec * 0xFFFFFFFFULL;
273 frac_part /= 1000000;
275 if (sec > 0xFFFFFFFFULL)
286 uint64_t sec = ntp_ts >> 32;
287 uint64_t frac_part = ntp_ts & 0xFFFFFFFFULL;
288 uint64_t usec = (frac_part * 1000000) / 0xFFFFFFFFULL;
290 return (sec * 1000000) + usec;
297 int nd, percentd_found;
309 if (nd >= INT_MAX / 10 - 255)
311 nd = nd * 10 + *
p++ -
'0';
362 char *authorization,
int authorization_size,
363 char *hostname,
int hostname_size,
364 int *port_ptr,
char *path,
int path_size,
const char *url)
366 const char *
p, *ls, *at, *at2, *col, *brk;
372 if (authorization_size > 0)
373 authorization[0] = 0;
374 if (hostname_size > 0)
380 if ((
p = strchr(url,
':'))) {
394 ls =
p + strcspn(
p,
"/?#");
401 while ((at = strchr(
p,
'@')) && at < ls) {
403 FFMIN(authorization_size, at + 1 - at2));
407 if (*
p ==
'[' && (brk = strchr(
p,
']')) && brk < ls) {
410 FFMIN(hostname_size, brk -
p));
411 if (brk[1] ==
':' && port_ptr)
412 *port_ptr = atoi(brk + 2);
413 }
else if ((col = strchr(
p,
':')) && col < ls) {
415 FFMIN(col + 1 -
p, hostname_size));
417 *port_ptr = atoi(col + 1);
420 FFMIN(ls + 1 -
p, hostname_size));
431 if (!path || !
temp) {
441 for ( ; *
pos !=
'\0'; ++
pos) {
442 if (*
pos ==
'/' || *
pos ==
'\\') {
450 if ((*(
pos - 1) !=
'/') && (*(
pos - 1) !=
'\\')) {
460 static const char hex_table_uc[16] = {
'0',
'1',
'2',
'3',
463 'C',
'D',
'E',
'F' };
464 static const char hex_table_lc[16] = {
'0',
'1',
'2',
'3',
467 'c',
'd',
'e',
'f' };
468 const char *hex_table =
lowercase ? hex_table_lc : hex_table_uc;
470 for (
int i = 0;
i <
s;
i++) {
471 buff[
i * 2] = hex_table[
src[
i] >> 4];
472 buff[
i * 2 + 1] = hex_table[
src[
i] & 0xF];
490 if (
c >=
'0' &&
c <=
'9')
492 else if (
c >=
'A' &&
c <=
'F')
510 const char *ptr = str;
515 char *dest =
NULL, *dest_end;
516 int key_len, dest_len = 0;
519 while (*ptr && (
av_isspace(*ptr) || *ptr ==
','))
526 if (!(ptr = strchr(
key,
'=')))
531 callback_get_buf(
context,
key, key_len, &dest, &dest_len);
532 dest_end = dest ? dest + dest_len - 1 :
NULL;
536 while (*ptr && *ptr !=
'\"') {
540 if (dest && dest < dest_end)
544 if (dest && dest < dest_end)
552 for (; *ptr && !(
av_isspace(*ptr) || *ptr ==
','); ptr++)
553 if (dest && dest < dest_end)
612 time_t seconds = timestamp / 1000000;
613 struct tm *ptm, tmbuf;
617 if (!strftime(buf,
sizeof(buf),
"%Y-%m-%dT%H:%M:%S", ptm))
619 av_strlcatf(buf,
sizeof(buf),
".%06dZ", (
int)(timestamp % 1000000));
628 char decoded_name[128];
645 size_t len = strcspn(str,
"=&");
648 if (!allow_unknown) {
656 len = strcspn(str,
"&");
658 }
else if (*str ==
'&' || *str ==
'\0') {
672 len = strcspn(str,
"&");
void av_packet_unref(AVPacket *pkt)
Wipe the packet.
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it be(in the first position) for now. Options ------- Then comes the options array. This is what will define the user accessible options. For example
#define FF_ENABLE_DEPRECATION_WARNINGS
#define AV_LOG_WARNING
Something somehow does not look correct.
uint8_t * extradata
Extra binary data needed for initializing the decoder, codec-dependent.
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf default minimum maximum flags name is the option name
static int av_bprint_is_complete(const AVBPrint *buf)
Test if the print buffer is complete (not truncated).
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample they are references to shared objects When the negotiation mechanism computes the intersection of the formats supported at each end of a all references to both lists are replaced with a reference to the intersection And when a single format is eventually chosen for a link amongst the remaining all references to the list are updated That means that if a filter requires that its input and output have the same format amongst a supported all it has to do is use a reference to the same list of formats query_formats can leave some formats unset and return AVERROR(EAGAIN) to cause the negotiation mechanism toagain later. That can be used by filters with complex requirements to use the format negotiated on one link to set the formats supported on another. Frame references ownership and permissions
void av_bprint_init(AVBPrint *buf, unsigned size_init, unsigned size_max)
This struct describes the properties of an encoded stream.
static av_always_inline FFIOContext * ffiocontext(AVIOContext *ctx)
int av_grow_packet(AVPacket *pkt, int grow_by)
Increase packet size, correctly zeroing padding.
int av_strcasecmp(const char *a, const char *b)
Locale-independent case-insensitive compare.
static av_const int av_isspace(int c)
Locale-independent conversion of ASCII isspace.
#define AV_FRAME_FILENAME_FLAGS_IGNORE_TRUNCATION
Ignore truncated output instead of returning an error.
int av_get_frame_filename2(char *buf, int buf_size, const char *path, int number, int flags)
Return in 'buf' the path with 'd' replaced by a number.
unsigned int ff_toupper4(unsigned int x)
#define AV_LOG_VERBOSE
Detailed information.
void ff_network_close(void)
int av_get_frame_filename(char *buf, int buf_size, const char *path, int number)
size_t av_strlcatf(char *dst, size_t size, const char *fmt,...)
int ff_network_init(void)
int av_filename_number_test(const char *filename)
Check whether filename actually is a numbered sequence generator.
void av_bprint_init_for_buffer(AVBPrint *buf, char *buffer, unsigned size)
Init a print buffer using a pre-existing buffer.
#define AV_BPRINT_SIZE_COUNT_ONLY
void av_shrink_packet(AVPacket *pkt, int size)
Reduce packet size, correctly zeroing padding.
static av_always_inline int64_t avio_tell(AVIOContext *s)
ftell() equivalent for AVIOContext.
#define AVERROR_OPTION_NOT_FOUND
Option not found.
int av_opt_set(void *obj, const char *name, const char *val, int search_flags)
int avformat_network_init(void)
Do global initialization of network libraries.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
#define AV_PKT_FLAG_CORRUPT
The packet content is corrupted.
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf default minimum maximum flags name is the option keep it simple and lowercase description are in without and describe what they for example set the foo of the bar offset is the offset of the field in your context
Undefined Behavior In the C some operations are like signed integer dereferencing freed accessing outside allocated Undefined Behavior must not occur in a C it is not safe even if the output of undefined operations is unused The unsafety may seem nit picking but Optimizing compilers have in fact optimized code on the assumption that no undefined Behavior occurs Optimizing code based on wrong assumptions can and has in some cases lead to effects beyond the output of computations The signed integer overflow problem in speed critical code Code which is highly optimized and works with signed integers sometimes has the problem that often the output of the computation does not c
int av_opt_set_int(void *obj, const char *name, int64_t val, int search_flags)
AVCodecID
Identify the syntax and semantics of the bitstream.
int extradata_size
Size of the extradata content in bytes.
int av_strncasecmp(const char *a, const char *b, size_t n)
Locale-independent case-insensitive compare.
const AVOption * av_opt_find(void *obj, const char *name, const char *unit, int opt_flags, int search_flags)
Look for an option in an object.
int av_bprint_finalize(AVBPrint *buf, char **ret_str)
Finalize a print buffer.
int ff_urldecode_len(char *dest, size_t dest_len, const char *url, size_t url_max_len, int decode_plus_sign)
Decodes an URL from its percent-encoded form back into normal representation.
static av_const int av_isdigit(int c)
Locale-independent conversion of ASCII isdigit.
#define AVERROR_EXTERNAL
Generic error in an external library.
int flags
A combination of AV_PKT_FLAG values.
#define AV_FRAME_FILENAME_FLAGS_MULTIPLE
Allow multiple d.
int ffio_limit(AVIOContext *s, int size)
#define av_assert2(cond)
assert() equivalent, that does lie in speed critical code.
#define i(width, name, range_min, range_max)
static av_const int av_toupper(int c)
Locale-independent conversion of ASCII characters to uppercase.
void av_url_split(char *proto, int proto_size, char *authorization, int authorization_size, char *hostname, int hostname_size, int *port_ptr, char *path, int path_size, const char *url)
Split a URL string into components.
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf default minimum maximum flags name is the option keep it simple and lowercase description are in lowercase
void av_bprintf(AVBPrint *buf, const char *fmt,...)
#define AV_INPUT_BUFFER_PADDING_SIZE
int avformat_network_deinit(void)
Undo the initialization done by avformat_network_init.
int avio_read(AVIOContext *s, unsigned char *buf, int size)
Read size bytes from AVIOContext into buf.
IDirect3DDxgiInterfaceAccess _COM_Outptr_ void ** p
int64_t av_gettime(void)
Get the current time in microseconds.
#define FF_DISABLE_DEPRECATION_WARNINGS
char * av_strdup(const char *s)
Duplicate a string.
This structure stores compressed data.
@ AV_OPT_TYPE_BOOL
Underlying C type is int.
int av_dict_set(AVDictionary **pm, const char *key, const char *value, int flags)
Set the given entry in *pm, overwriting an existing entry.
int64_t pos
byte position in stream, -1 if unknown
const char * avio_find_protocol_name(const char *url)
Return the name of the protocol that will handle the passed URL.
size_t av_strlcpy(char *dst, const char *src, size_t size)
Copy the string src to dst, but no more than size - 1 bytes, and null-terminate dst.
void av_bprint_chars(AVBPrint *buf, char c, unsigned n)
Append char c n times to a print buffer.