Go to the documentation of this file.
59 #define SANE_CHUNK_SIZE (50000000)
87 if (
ret != read_size) {
104 #if FF_API_INIT_PACKET
157 if (bps <= 0 || bps > 64)
172 if (sflags & (1 << (
bps - 1))) {
215 for (
int i = 0; tags && tags[
i];
i++) {
218 if (codec_tags->
id ==
id) {
230 for (
int i = 0; tags && tags[
i];
i++) {
265 uint64_t ntp_ts, frac_part, sec;
269 sec = ntp_time_us / 1000000;
270 usec = ntp_time_us % 1000000;
273 frac_part = usec * 0xFFFFFFFFULL;
274 frac_part /= 1000000;
276 if (sec > 0xFFFFFFFFULL)
287 uint64_t sec = ntp_ts >> 32;
288 uint64_t frac_part = ntp_ts & 0xFFFFFFFFULL;
289 uint64_t usec = (frac_part * 1000000) / 0xFFFFFFFFULL;
291 return (sec * 1000000) + usec;
297 char *q, buf1[20],
c;
298 int nd,
len, percentd_found;
311 if (nd >= INT_MAX / 10 - 255)
313 nd = nd * 10 + *p++ -
'0';
327 snprintf(buf1,
sizeof(buf1),
"%0*d", nd, number);
329 if ((q - buf +
len) > buf_size - 1)
331 memcpy(q, buf1,
len);
339 if ((q - buf) < buf_size - 1)
358 char *authorization,
int authorization_size,
359 char *hostname,
int hostname_size,
360 int *port_ptr,
char *path,
int path_size,
const char *url)
362 const char *p, *ls, *at, *at2, *col, *brk;
368 if (authorization_size > 0)
369 authorization[0] = 0;
370 if (hostname_size > 0)
376 if ((p = strchr(url,
':'))) {
390 ls = p + strcspn(p,
"/?#");
397 while ((at = strchr(p,
'@')) && at < ls) {
399 FFMIN(authorization_size, at + 1 - at2));
403 if (*p ==
'[' && (brk = strchr(p,
']')) && brk < ls) {
406 FFMIN(hostname_size, brk - p));
407 if (brk[1] ==
':' && port_ptr)
408 *port_ptr = atoi(brk + 2);
409 }
else if ((col = strchr(p,
':')) && col < ls) {
411 FFMIN(col + 1 - p, hostname_size));
413 *port_ptr = atoi(col + 1);
416 FFMIN(ls + 1 - p, hostname_size));
427 if (!path || !
temp) {
437 for ( ; *
pos !=
'\0'; ++
pos) {
438 if (*
pos ==
'/' || *
pos ==
'\\') {
446 if ((*(
pos - 1) !=
'/') && (*(
pos - 1) !=
'\\')) {
456 static const char hex_table_uc[16] = {
'0',
'1',
'2',
'3',
459 'C',
'D',
'E',
'F' };
460 static const char hex_table_lc[16] = {
'0',
'1',
'2',
'3',
463 'c',
'd',
'e',
'f' };
464 const char *hex_table =
lowercase ? hex_table_lc : hex_table_uc;
466 for (
int i = 0;
i <
s;
i++) {
467 buff[
i * 2] = hex_table[
src[
i] >> 4];
468 buff[
i * 2 + 1] = hex_table[
src[
i] & 0xF];
486 if (
c >=
'0' &&
c <=
'9')
488 else if (
c >=
'A' &&
c <=
'F')
506 const char *ptr =
str;
511 char *dest =
NULL, *dest_end;
512 int key_len, dest_len = 0;
515 while (*ptr && (
av_isspace(*ptr) || *ptr ==
','))
522 if (!(ptr = strchr(
key,
'=')))
527 callback_get_buf(
context,
key, key_len, &dest, &dest_len);
528 dest_end = dest ? dest + dest_len - 1 :
NULL;
532 while (*ptr && *ptr !=
'\"') {
536 if (dest && dest < dest_end)
540 if (dest && dest < dest_end)
548 for (; *ptr && !(
av_isspace(*ptr) || *ptr ==
','); ptr++)
549 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.
static int ff_mutex_unlock(AVMutex *mutex)
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.
#define AV_MUTEX_INITIALIZER
static av_const int av_isdigit(int c)
Locale-independent conversion of ASCII isdigit.
static int ff_mutex_lock(AVMutex *mutex)
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.