36 #define IO_BUFFER_SIZE 32768
43 #define SHORT_SEEK_THRESHOLD 32768
48 return prev ?
NULL :
s->opaque;
51 #if FF_API_CHILD_CLASS_NEXT
61 *iter = (
void*)(uintptr_t)
c;
65 #define OFFSET(x) offsetof(AVIOContext,x)
66 #define E AV_OPT_FLAG_ENCODING_PARAM
67 #define D AV_OPT_FLAG_DECODING_PARAM
69 {
"protocol_whitelist",
"List of protocols that are allowed to be used",
OFFSET(protocol_whitelist),
AV_OPT_TYPE_STRING, { .str =
NULL }, 0, 0,
D },
79 #if FF_API_CHILD_CLASS_NEXT
100 s->orig_buffer_size =
101 s->buffer_size = buffer_size;
116 s->min_packet_size = 0;
117 s->max_packet_size = 0;
118 s->update_checksum =
NULL;
122 s->pos = buffer_size;
123 s->buf_end =
s->buffer + buffer_size;
125 s->read_pause =
NULL;
128 s->write_data_type =
NULL;
129 s->ignore_boundary_point = 0;
132 s->short_seek_get =
NULL;
169 if (
s->write_data_type)
174 else if (
s->write_packet)
179 if (
s->pos +
len >
s->written)
180 s->written =
s->pos +
len;
188 s->writeout_count ++;
194 s->buf_ptr_max =
FFMAX(
s->buf_ptr,
s->buf_ptr_max);
195 if (
s->write_flag &&
s->buf_ptr_max >
s->buffer) {
197 if (
s->update_checksum) {
198 s->checksum =
s->update_checksum(
s->checksum,
s->checksum_ptr,
199 s->buf_ptr_max -
s->checksum_ptr);
200 s->checksum_ptr =
s->buffer;
203 s->buf_ptr =
s->buf_ptr_max =
s->buffer;
205 s->buf_end =
s->buffer;
212 if (
s->buf_ptr >=
s->buf_end)
219 int len =
FFMIN(
s->buf_end -
s->buf_ptr, count);
220 memset(
s->buf_ptr,
b,
len);
223 if (
s->buf_ptr >=
s->buf_end)
234 if (
s->direct && !
s->update_checksum) {
241 memcpy(
s->buf_ptr, buf,
len);
244 if (
s->buf_ptr >=
s->buf_end)
254 int seekback =
s->write_flag ?
FFMIN(0,
s->buf_ptr -
s->buf_ptr_max) : 0;
275 buffer_size =
s->buf_end -
s->buffer;
277 pos =
s->pos - (
s->write_flag ? 0 : buffer_size);
279 if (whence != SEEK_CUR && whence != SEEK_SET)
282 if (whence == SEEK_CUR) {
283 offset1 =
pos + (
s->buf_ptr -
s->buffer);
286 if (
offset > INT64_MAX - offset1)
293 short_seek =
s->short_seek_threshold;
294 if (
s->short_seek_get)
295 short_seek =
FFMAX(
s->short_seek_get(
s->opaque), short_seek);
298 s->buf_ptr_max =
FFMAX(
s->buf_ptr_max,
s->buf_ptr);
299 if ((!
s->direct || !
s->seek) &&
300 offset1 >= 0 && offset1 <= (
s->write_flag ?
s->buf_ptr_max -
s->buffer : buffer_size)) {
302 s->buf_ptr =
s->buffer + offset1;
304 offset1 <= buffer_size + short_seek) &&
305 !
s->write_flag && offset1 >= 0 &&
306 (!
s->direct || !
s->seek) &&
307 (whence != SEEK_END || force)) {
308 while(
s->pos <
offset && !
s->eof_reached)
312 s->buf_ptr =
s->buf_end - (
s->pos -
offset);
313 }
else if(!
s->write_flag && offset1 < 0 && -offset1 < buffer_size>>1 &&
s->seek &&
offset > 0) {
317 if ((res =
s->seek(
s->opaque,
pos, SEEK_SET)) < 0)
320 s->buf_ptr =
s->buffer;
332 if ((res =
s->seek(
s->opaque,
offset, SEEK_SET)) < 0)
336 s->buf_end =
s->buffer;
337 s->checksum_ptr =
s->buf_ptr =
s->buf_ptr_max =
s->buffer;
363 if ((
size =
s->seek(
s->opaque, -1, SEEK_END)) < 0)
366 s->seek(
s->opaque,
s->pos, SEEK_SET);
379 return s->eof_reached;
439 #define PUT_STR16(type, big_endian) \
440 int avio_put_str16 ## type(AVIOContext *s, const char *str) \
442 return put_str16(s, str, big_endian); \
489 if (
s->buf_ptr -
s->buffer >=
s->min_packet_size)
493 if (!
s->write_data_type)
510 if (
type ==
s->current_type)
518 s->current_type =
type;
528 ret =
s->read_packet(
s->opaque, buf,
size);
529 #if FF_API_OLD_AVIO_EOF_0
530 if (!ret && !
s->max_packet_size) {
544 int max_buffer_size =
s->max_packet_size ?
546 uint8_t *dst =
s->buf_end -
s->buffer + max_buffer_size <=
s->buffer_size ?
547 s->buf_end :
s->buffer;
548 int len =
s->buffer_size - (dst -
s->buffer);
556 if (!
s->read_packet &&
s->buf_ptr >=
s->buf_end)
563 if (
s->update_checksum && dst ==
s->buffer) {
564 if (
s->buf_end >
s->checksum_ptr)
565 s->checksum =
s->update_checksum(
s->checksum,
s->checksum_ptr,
566 s->buf_end -
s->checksum_ptr);
567 s->checksum_ptr =
s->buffer;
571 if (
s->read_packet &&
s->orig_buffer_size &&
s->buffer_size >
s->orig_buffer_size &&
len >=
s->orig_buffer_size) {
572 if (dst ==
s->buffer &&
s->buf_ptr != dst) {
577 s->checksum_ptr = dst =
s->buffer;
579 len =
s->orig_buffer_size;
587 }
else if (
len < 0) {
593 s->buf_end = dst +
len;
594 s->bytes_read +=
len;
618 s->checksum =
s->update_checksum(
s->checksum,
s->checksum_ptr,
619 s->buf_ptr -
s->checksum_ptr);
620 s->update_checksum =
NULL;
629 if (
s->update_checksum) {
631 s->checksum_ptr =
s->buf_ptr;
638 if (
s->buf_ptr >=
s->buf_end)
640 if (
s->buf_ptr <
s->buf_end)
641 return *
s->buf_ptr++;
652 if (
len == 0 ||
s->write_flag) {
653 if((
s->direct ||
size >
s->buffer_size) && !
s->update_checksum &&
s->read_packet) {
665 }
else if (
len < 0) {
671 s->bytes_read +=
len;
675 s->buf_ptr =
s->buffer;
676 s->buf_end =
s->buffer;
680 len =
s->buf_end -
s->buf_ptr;
685 memcpy(buf,
s->buf_ptr,
len);
692 if (
s->error)
return s->error;
710 if (
s->buf_end -
s->buf_ptr >=
size && !
s->write_flag) {
727 if (
s->read_packet &&
s->write_flag) {
734 len =
s->buf_end -
s->buf_ptr;
737 len =
s->buf_end -
s->buf_ptr;
741 memcpy(buf,
s->buf_ptr,
len);
744 if (
s->error)
return s->error;
812 if (
c &&
i < maxlen-1)
814 }
while (
c !=
'\n' &&
c !=
'\r' &&
c);
841 end = (
c ==
'\r' ||
c ==
'\n' ||
c ==
'\0');
844 }
while (!end &&
len <
sizeof(
tmp));
883 buflen =
FFMIN(buflen - 1, maxlen);
884 for (
i = 0;
i < buflen;
i++)
888 for (;
i < maxlen;
i++)
894 #define GET_STR16(type, read) \
895 int avio_get_str16 ##type(AVIOContext *pb, int maxlen, char *buf, int buflen)\
900 return AVERROR(EINVAL); \
901 while (ret + 1 < maxlen) {\
904 GET_UTF16(ch, (ret += 2) <= maxlen ? read(pb) : 0, break;)\
907 PUT_UTF8(ch, tmp, if (q - buf < buflen - 1) *q++ = tmp;)\
940 int buffer_size, max_packet_size;
942 max_packet_size =
h->max_packet_size;
943 if (max_packet_size) {
944 buffer_size = max_packet_size;
949 if (buffer_size > INT_MAX/2)
965 (*s)->protocol_whitelist =
av_strdup(
h->protocol_whitelist);
966 if (!(*s)->protocol_whitelist &&
h->protocol_whitelist) {
970 (*s)->protocol_blacklist =
av_strdup(
h->protocol_blacklist);
971 if (!(*s)->protocol_blacklist &&
h->protocol_blacklist) {
978 (*s)->max_packet_size = max_packet_size;
979 (*s)->min_packet_size =
h->min_packet_size;
981 (*s)->read_pause = (
int (*)(
void *,
int))
h->prot->url_read_pause;
985 if (
h->prot->url_read_seek)
1006 if (
s->update_checksum &&
s->buf_ptr >
s->checksum_ptr) {
1007 s->checksum =
s->update_checksum(
s->checksum,
s->checksum_ptr,
1008 s->buf_ptr -
s->checksum_ptr);
1015 int max_buffer_size =
s->max_packet_size ?
1017 ptrdiff_t filled =
s->buf_end -
s->buf_ptr;
1019 if (buf_size <= s->buf_end -
s->buf_ptr)
1022 if (buf_size > INT_MAX - max_buffer_size)
1025 buf_size += max_buffer_size - 1;
1027 if (buf_size +
s->buf_ptr -
s->buffer <=
s->buffer_size ||
s->seekable || !
s->read_packet)
1031 if (buf_size <= s->buffer_size) {
1033 memmove(
s->buffer,
s->buf_ptr, filled);
1039 memcpy(
buffer,
s->buf_ptr, filled);
1042 s->buffer_size = buf_size;
1044 s->buf_ptr =
s->buffer;
1045 s->buf_end =
s->buffer + filled;
1046 s->checksum_ptr =
s->buffer;
1059 s->orig_buffer_size =
1060 s->buffer_size = buf_size;
1061 s->buf_ptr =
s->buf_ptr_max =
buffer;
1071 if (!
s->buffer_size)
1074 if (buf_size <= s->buffer_size)
1081 data_size =
s->write_flag ? (
s->buf_ptr -
s->buffer) : (
s->buf_end -
s->buf_ptr);
1083 memcpy(
buffer,
s->write_flag ?
s->buffer :
s->buf_ptr, data_size);
1086 s->orig_buffer_size = buf_size;
1087 s->buffer_size = buf_size;
1088 s->buf_ptr =
s->write_flag ? (
s->buffer + data_size) :
s->buffer;
1090 s->buf_ptr_max =
s->buffer + data_size;
1092 s->buf_end =
s->write_flag ? (
s->buffer +
s->buffer_size) : (
s->buf_ptr + data_size);
1102 s->buf_end =
s->buffer +
s->buffer_size;
1105 s->buf_end =
s->buffer;
1115 int overlap, new_size, alloc_size;
1118 if (
s->write_flag) {
1123 buffer_size =
s->buf_end -
s->buffer;
1126 if ((buffer_start =
s->pos - buffer_size) > buf_size) {
1131 overlap = buf_size - buffer_start;
1132 new_size = buf_size + buffer_size - overlap;
1134 alloc_size =
FFMAX(
s->buffer_size, new_size);
1135 if (alloc_size > buf_size)
1136 if (!(buf = (*bufp) =
av_realloc_f(buf, 1, alloc_size)))
1139 if (new_size > buf_size) {
1140 memcpy(buf + buf_size,
s->buffer + overlap, buffer_size - overlap);
1141 buf_size = new_size;
1145 s->buf_ptr =
s->buffer = buf;
1146 s->buffer_size = alloc_size;
1148 s->buf_end =
s->buf_ptr + buf_size;
1161 const char *whitelist,
const char *blacklist
1237 for(; *strings; strings++)
1238 avio_write(
s, (
const unsigned char *)*strings, strlen(*strings));
1245 return s->read_pause(
s->opaque, pause);
1254 ret =
s->read_seek(
s->opaque, stream_index, timestamp,
flags);
1257 s->buf_ptr =
s->buf_end;
1258 pos =
s->seek(
s->opaque, 0, SEEK_CUR);
1317 new_size = (unsigned)d->
pos + buf_size;
1318 if (new_size < d->
pos || new_size > INT_MAX)
1324 while (new_size > new_allocated_size)
1325 new_allocated_size += new_allocated_size / 2 + 1;
1327 new_allocated_size =
FFMIN(new_allocated_size, INT_MAX);
1336 memcpy(d->
buffer + d->
pos, buf, buf_size);
1345 unsigned char buf1[4];
1362 if (whence == SEEK_CUR)
1364 else if (whence == SEEK_END)
1377 unsigned io_buffer_size = max_packet_size ? max_packet_size : 1024;
1379 if (
sizeof(
DynBuffer) + io_buffer_size < io_buffer_size)
1392 (*s)->max_packet_size = max_packet_size;
1403 if (max_packet_size <= 0)
1418 if (!
s->error && !d->
size) {
1420 return FFMAX(
s->buf_ptr,
s->buf_ptr_max) -
s->buffer;
1433 int max_packet_size =
s->max_packet_size;
1436 s->write_packet,
s->seek);
1437 s->max_packet_size = max_packet_size;
1454 if (!
s->max_packet_size) {
1468 return size - padding;
static double val(void *priv, double ch)
simple assert() macros that are a bit more flexible than ISO C assert().
#define av_assert2(cond)
assert() equivalent, that does lie in speed critical code.
#define av_assert1(cond)
assert() equivalent, that does not lie in speed critical code.
#define av_assert0(cond)
assert() equivalent, that is always enabled.
int ffurl_handshake(URLContext *c)
Perform one step of the protocol handshake to accept a new client.
int ffurl_read(URLContext *h, unsigned char *buf, int size)
Read up to size bytes from the resource accessed by h, and store the read bytes in buf.
int ffurl_open_whitelist(URLContext **puc, const char *filename, int flags, const AVIOInterruptCB *int_cb, AVDictionary **options, const char *whitelist, const char *blacklist, URLContext *parent)
Create an URLContext for accessing to the resource indicated by url, and open it.
int ffurl_get_short_seek(URLContext *h)
Return the current short seek threshold value for this URL.
int64_t ffurl_seek(URLContext *h, int64_t pos, int whence)
Change the position that will be used by the next read/write operation on the resource accessed by h.
int ffurl_accept(URLContext *s, URLContext **c)
Accept an URLContext c on an URLContext s.
int ffurl_close(URLContext *h)
int ffurl_write(URLContext *h, const unsigned char *buf, int size)
Write size bytes from buf to the resource accessed by h.
const AVClass ffurl_context_class
#define AVIO_SEEKABLE_NORMAL
Seeking works like for a local file.
#define AVIO_FLAG_READ
read-only
#define AVSEEK_SIZE
ORing this as the "whence" parameter to a seek function causes it to return the filesize without seek...
AVIODataMarkerType
Different data types that can be returned via the AVIO write_data_type callback.
@ AVIO_DATA_MARKER_BOUNDARY_POINT
A point in the output bytestream where a demuxer can start parsing (for non self synchronizing bytest...
@ AVIO_DATA_MARKER_TRAILER
Trailer data, which doesn't contain actual content, but only for finalizing the output file.
@ AVIO_DATA_MARKER_HEADER
Header data; this needs to be present for the stream to be decodeable.
@ AVIO_DATA_MARKER_UNKNOWN
This is any, unlabelled data.
@ AVIO_DATA_MARKER_FLUSH_POINT
A point in the output bytestream where the underlying AVIOContext might flush the buffer depending on...
@ AVIO_DATA_MARKER_SYNC_POINT
A point in the output bytestream where a decoder can start decoding (i.e.
#define AVIO_FLAG_WRITE
write-only
#define AVIO_FLAG_DIRECT
Use direct mode.
#define AVIO_SEEKABLE_TIME
Seeking by timestamp with avio_seek_time() is possible.
#define AVSEEK_FORCE
Passing this flag as the "whence" parameter to a seek function causes it to seek by any means (like r...
static int read_packet(void *opaque, uint8_t *buf, int buf_size)
void avio_write_marker(AVIOContext *s, int64_t time, enum AVIODataMarkerType type)
Mark the written bytestream as a specific type.
int64_t avio_seek(AVIOContext *s, int64_t offset, int whence)
fseek() equivalent for AVIOContext.
void ffio_init_checksum(AVIOContext *s, unsigned long(*update_checksum)(unsigned long c, const uint8_t *p, unsigned int len), unsigned long checksum)
void avio_wl64(AVIOContext *s, uint64_t val)
int avio_handshake(AVIOContext *c)
Perform one step of the protocol handshake to accept a new client.
static const AVClass * ff_avio_child_class_next(const AVClass *prev)
int avio_pause(AVIOContext *s, int pause)
Pause and resume playing - only meaningful if using a network streaming protocol (e....
void ffio_free_dyn_buf(AVIOContext **s)
Free a dynamic buffer.
int ffio_read_indirect(AVIOContext *s, unsigned char *buf, int size, const unsigned char **data)
Read size bytes from AVIOContext, returning a pointer.
uint64_t avio_rb64(AVIOContext *s)
unsigned long ff_crcA001_update(unsigned long checksum, const uint8_t *buf, unsigned int len)
void avio_wl32(AVIOContext *s, unsigned int val)
void avio_wl16(AVIOContext *s, unsigned int val)
int avio_put_str(AVIOContext *s, const char *str)
Write a NULL-terminated string.
unsigned long ffio_get_checksum(AVIOContext *s)
void avio_w8(AVIOContext *s, int b)
void avio_wb32(AVIOContext *s, unsigned int val)
void avio_wb16(AVIOContext *s, unsigned int val)
static void writeout(AVIOContext *s, const uint8_t *data, int len)
static void flush_buffer(AVIOContext *s)
static int read_packet_wrapper(AVIOContext *s, uint8_t *buf, int size)
int64_t avio_size(AVIOContext *s)
Get the filesize.
unsigned int avio_rb16(AVIOContext *s)
static int dyn_buf_write(void *opaque, uint8_t *buf, int buf_size)
void ffio_reset_dyn_buf(AVIOContext *s)
Reset a dynamic buffer.
static int64_t dyn_buf_seek(void *opaque, int64_t offset, int whence)
int64_t ff_read_line_to_bprint(AVIOContext *s, AVBPrint *bp)
Read a whole line of text from AVIOContext to an AVBPrint buffer.
int avio_printf(AVIOContext *s, const char *fmt,...)
int avio_feof(AVIOContext *s)
Similar to feof() but also returns nonzero on read errors.
static const AVClass * child_class_iterate(void **iter)
void ffio_fill(AVIOContext *s, int b, int count)
static const AVOption ff_avio_options[]
void avio_context_free(AVIOContext **ps)
Free the supplied IO context and everything associated with it.
int avio_read_partial(AVIOContext *s, unsigned char *buf, int size)
Read size bytes from AVIOContext into buf.
static int null_buf_write(void *opaque, uint8_t *buf, int buf_size)
int ffio_open_whitelist(AVIOContext **s, const char *filename, int flags, const AVIOInterruptCB *int_cb, AVDictionary **options, const char *whitelist, const char *blacklist)
static void fill_buffer(AVIOContext *s)
int ffio_rewind_with_probe_data(AVIOContext *s, unsigned char **bufp, int buf_size)
Rewind the AVIOContext using the specified buffer containing the first buf_size bytes of the file.
int ffio_ensure_seekback(AVIOContext *s, int64_t buf_size)
Ensures that the requested seekback buffer size will be available.
int ffio_set_buf_size(AVIOContext *s, int buf_size)
int avio_get_str(AVIOContext *s, int maxlen, char *buf, int buflen)
Read a string from pb into buf.
#define SHORT_SEEK_THRESHOLD
Do seeks within this distance ahead of the current buffer by skipping data instead of calling the pro...
unsigned int avio_rl16(AVIOContext *s)
int64_t ff_read_line_to_bprint_overwrite(AVIOContext *s, AVBPrint *bp)
Read a whole line of text from AVIOContext to an AVBPrint buffer overwriting its contents.
int ff_get_chomp_line(AVIOContext *s, char *buf, int maxlen)
Same as ff_get_line but strip the white-space characters in the text tail.
#define GET_STR16(type, read)
int ffio_open_null_buf(AVIOContext **s)
Open a write-only fake memory stream.
URLContext * ffio_geturlcontext(AVIOContext *s)
Return the URLContext associated with the AVIOContext.
void avio_wb24(AVIOContext *s, unsigned int val)
AVIOContext * avio_alloc_context(unsigned char *buffer, int buffer_size, int write_flag, void *opaque, int(*read_packet)(void *opaque, uint8_t *buf, int buf_size), int(*write_packet)(void *opaque, uint8_t *buf, int buf_size), int64_t(*seek)(void *opaque, int64_t offset, int whence))
Allocate and initialize an AVIOContext for buffered I/O.
int avio_accept(AVIOContext *s, AVIOContext **c)
Accept and allocate a client context on a server context.
unsigned long ff_crcEDB88320_update(unsigned long checksum, const uint8_t *buf, unsigned int len)
static void update_checksum(AVIOContext *s)
int avio_close_dyn_buf(AVIOContext *s, uint8_t **pbuffer)
Return the written size and a pointer to the buffer.
int64_t avio_seek_time(AVIOContext *s, int stream_index, int64_t timestamp, int flags)
Seek to a given timestamp relative to some component stream.
uint64_t ffio_read_varlen(AVIOContext *bc)
int avio_read_to_bprint(AVIOContext *h, AVBPrint *pb, size_t max_size)
Read contents of h into print buffer, up to max_size bytes, or up to EOF.
void avio_wb64(AVIOContext *s, uint64_t val)
static void * ff_avio_child_next(void *obj, void *prev)
void avio_wl24(AVIOContext *s, unsigned int val)
int64_t avio_skip(AVIOContext *s, int64_t offset)
Skip given number of bytes forward.
int ffio_open_dyn_packet_buf(AVIOContext **s, int max_packet_size)
Open a write only packetized memory stream with a maximum packet size of 'max_packet_size'.
int ffio_realloc_buf(AVIOContext *s, int buf_size)
Reallocate a given buffer for AVIOContext.
static int url_open_dyn_buf_internal(AVIOContext **s, int max_packet_size)
int avio_open(AVIOContext **s, const char *filename, int flags)
Create and initialize a AVIOContext for accessing the resource indicated by url.
int ffio_read_size(AVIOContext *s, unsigned char *buf, int size)
Read size bytes from AVIOContext into buf.
int avio_read(AVIOContext *s, unsigned char *buf, int size)
Read size bytes from AVIOContext into buf.
unsigned int avio_rl32(AVIOContext *s)
int ffio_close_null_buf(AVIOContext *s)
Close a null buffer.
unsigned int avio_rl24(AVIOContext *s)
const AVClass ff_avio_class
void avio_write(AVIOContext *s, const unsigned char *buf, int size)
int ffio_init_context(AVIOContext *s, unsigned char *buffer, int buffer_size, int write_flag, void *opaque, int(*read_packet)(void *opaque, uint8_t *buf, int buf_size), int(*write_packet)(void *opaque, uint8_t *buf, int buf_size), int64_t(*seek)(void *opaque, int64_t offset, int whence))
int ff_get_line(AVIOContext *s, char *buf, int maxlen)
Read a whole line of text from AVIOContext.
int avio_close(AVIOContext *s)
Close the resource accessed by the AVIOContext s and free it.
void avio_flush(AVIOContext *s)
Force flushing of buffered data.
int avio_open_dyn_buf(AVIOContext **s)
Open a write only memory stream.
int avio_closep(AVIOContext **s)
Close the resource accessed by the AVIOContext *s, free it and set the pointer pointing to it to NULL...
void avio_print_string_array(AVIOContext *s, const char *strings[])
Write a NULL terminated array of strings to the context.
unsigned int avio_rb24(AVIOContext *s)
int avio_open2(AVIOContext **s, const char *filename, int flags, const AVIOInterruptCB *int_cb, AVDictionary **options)
Create and initialize a AVIOContext for accessing the resource indicated by url.
static int dyn_packet_buf_write(void *opaque, uint8_t *buf, int buf_size)
unsigned long ff_crc04C11DB7_update(unsigned long checksum, const uint8_t *buf, unsigned int len)
int ffio_fdopen(AVIOContext **s, URLContext *h)
Create and initialize a AVIOContext for accessing the resource referenced by the URLContext h.
#define PUT_STR16(type, big_endian)
unsigned int avio_rb32(AVIOContext *s)
int avio_r8(AVIOContext *s)
int avio_get_dyn_buf(AVIOContext *s, uint8_t **pbuffer)
Return the written size and a pointer to the buffer.
static int url_resetbuf(AVIOContext *s, int flags)
uint64_t avio_rl64(AVIOContext *s)
static int put_str16(AVIOContext *s, const char *str, const int be)
void av_bprint_init(AVBPrint *buf, unsigned size_init, unsigned size_max)
int av_bprint_finalize(AVBPrint *buf, char **ret_str)
Finalize a print buffer.
void av_vbprintf(AVBPrint *buf, const char *fmt, va_list vl_arg)
Append a formatted string to a print buffer.
void av_bprint_append_data(AVBPrint *buf, const char *data, unsigned size)
Append data to a print buffer.
void av_bprint_clear(AVBPrint *buf)
Reset the string to "" but keep internal allocated data.
static int av_bprint_is_complete(const AVBPrint *buf)
Test if the print buffer is complete (not truncated).
#define flags(name, subs,...)
#define GET_UTF8(val, GET_BYTE, ERROR)
Convert a UTF-8 character (up to 4 bytes) to its 32-bit UCS-4 encoded form.
#define PUT_UTF16(val, tmp, PUT_16BIT)
Convert a 32-bit Unicode character to its UTF-16 encoded form (2 or 4 bytes).
Public header for CRC hash function implementation.
const AVIOInterruptCB int_cb
static void write_packet(OutputFile *of, AVPacket *pkt, OutputStream *ost, int unqueue)
const OptionDef options[]
void av_opt_free(void *obj)
Free all allocated objects in obj.
#define AV_INPUT_BUFFER_PADDING_SIZE
Required number of additionally allocated bytes at the end of the input bitstream for decoding.
const AVCRC * av_crc_get_table(AVCRCId crc_id)
Get an initialized standard CRC table.
uint32_t av_crc(const AVCRC *ctx, uint32_t crc, const uint8_t *buffer, size_t length)
Calculate the CRC of a block.
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
#define AVERROR_EOF
End of file.
#define AV_LOG_WARNING
Something somehow does not look correct.
#define AV_LOG_VERBOSE
Detailed information.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
const char * av_default_item_name(void *ptr)
Return the context name.
void * av_mallocz(size_t size)
Allocate a memory block with alignment suitable for all memory accesses (including vectors if availab...
char * av_strdup(const char *s)
Duplicate a string.
int av_reallocp(void *ptr, size_t size)
Allocate, reallocate, or free a block of memory through a pointer to a pointer.
static av_const int av_isspace(int c)
Locale-independent conversion of ASCII isspace.
#define AV_NOPTS_VALUE
Undefined timestamp value.
#define LIBAVUTIL_VERSION_INT
common internal API header
Describe the class of an AVClass context structure.
const struct AVClass *(* child_class_iterate)(void **iter)
Iterate over the AVClasses corresponding to potential AVOptions-enabled children.
const char * class_name
The name of the class; usually it is the same name as the context structure type to which the AVClass...
int(* write_packet)(void *opaque, uint8_t *buf, int buf_size)
Callback for checking whether to abort blocking functions.
#define av_realloc_f(p, o, n)
static volatile int checksum
unbuffered private I/O API
static const uint8_t offset[127][2]