Go to the documentation of this file.
48 #define SANE_CHUNK_SIZE (50000000)
76 if (
ret != read_size) {
93 #if FF_API_INIT_PACKET
146 if (bps <= 0 || bps > 64)
161 if (sflags & (1 << (
bps - 1))) {
204 for (
int i = 0; tags && tags[
i];
i++) {
207 if (codec_tags->
id ==
id) {
219 for (
int i = 0; tags && tags[
i];
i++) {
254 uint64_t ntp_ts, frac_part, sec;
258 sec = ntp_time_us / 1000000;
259 usec = ntp_time_us % 1000000;
262 frac_part = usec * 0xFFFFFFFFULL;
263 frac_part /= 1000000;
265 if (sec > 0xFFFFFFFFULL)
276 uint64_t sec = ntp_ts >> 32;
277 uint64_t frac_part = ntp_ts & 0xFFFFFFFFULL;
278 uint64_t usec = (frac_part * 1000000) / 0xFFFFFFFFULL;
280 return (sec * 1000000) + usec;
286 char *q, buf1[20],
c;
287 int nd,
len, percentd_found;
300 if (nd >= INT_MAX / 10 - 255)
302 nd = nd * 10 + *p++ -
'0';
316 snprintf(buf1,
sizeof(buf1),
"%0*" PRId64, nd, number);
318 if ((q - buf +
len) > buf_size - 1)
320 memcpy(q, buf1,
len);
328 if ((q - buf) < buf_size - 1)
352 char *authorization,
int authorization_size,
353 char *hostname,
int hostname_size,
354 int *port_ptr,
char *path,
int path_size,
const char *url)
356 const char *p, *ls, *at, *at2, *col, *brk;
362 if (authorization_size > 0)
363 authorization[0] = 0;
364 if (hostname_size > 0)
370 if ((p = strchr(url,
':'))) {
384 ls = p + strcspn(p,
"/?#");
391 while ((at = strchr(p,
'@')) && at < ls) {
393 FFMIN(authorization_size, at + 1 - at2));
397 if (*p ==
'[' && (brk = strchr(p,
']')) && brk < ls) {
400 FFMIN(hostname_size, brk - p));
401 if (brk[1] ==
':' && port_ptr)
402 *port_ptr = atoi(brk + 2);
403 }
else if ((col = strchr(p,
':')) && col < ls) {
405 FFMIN(col + 1 - p, hostname_size));
407 *port_ptr = atoi(col + 1);
410 FFMIN(ls + 1 - p, hostname_size));
421 if (!path || !
temp) {
431 for ( ; *
pos !=
'\0'; ++
pos) {
432 if (*
pos ==
'/' || *
pos ==
'\\') {
440 if ((*(
pos - 1) !=
'/') && (*(
pos - 1) !=
'\\')) {
450 static const char hex_table_uc[16] = {
'0',
'1',
'2',
'3',
453 'C',
'D',
'E',
'F' };
454 static const char hex_table_lc[16] = {
'0',
'1',
'2',
'3',
457 'c',
'd',
'e',
'f' };
458 const char *hex_table =
lowercase ? hex_table_lc : hex_table_uc;
460 for (
int i = 0;
i <
s;
i++) {
461 buff[
i * 2] = hex_table[
src[
i] >> 4];
462 buff[
i * 2 + 1] = hex_table[
src[
i] & 0xF];
480 if (
c >=
'0' &&
c <=
'9')
482 else if (
c >=
'A' &&
c <=
'F')
500 const char *ptr = str;
505 char *dest =
NULL, *dest_end;
506 int key_len, dest_len = 0;
509 while (*ptr && (
av_isspace(*ptr) || *ptr ==
','))
516 if (!(ptr = strchr(
key,
'=')))
521 callback_get_buf(
context,
key, key_len, &dest, &dest_len);
522 dest_end = dest ? dest + dest_len - 1 :
NULL;
526 while (*ptr && *ptr !=
'\"') {
530 if (dest && dest < dest_end)
534 if (dest && dest < dest_end)
542 for (; *ptr && !(
av_isspace(*ptr) || *ptr ==
','); ptr++)
543 if (dest && dest < dest_end)
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.
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
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.
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)
void ff_network_close(void)
int av_get_frame_filename(char *buf, int buf_size, const char *path, int number)
int ff_network_init(void)
int av_filename_number_test(const char *filename)
Check whether filename actually is a numbered sequence generator.
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.
int avformat_network_init(void)
Do global initialization of network libraries.
#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
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.
int av_bprint_finalize(AVBPrint *buf, char **ret_str)
Finalize a print buffer.
static av_const int av_isdigit(int c)
Locale-independent conversion of ASCII isdigit.
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 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
#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.
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.
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.
#define flags(name, subs,...)
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.