#include "libavutil/bprint.h"
#include "libavutil/crc.h"
#include "libavutil/dict.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/log.h"
#include "libavutil/mem.h"
#include "libavutil/opt.h"
#include "libavutil/avassert.h"
#include "libavcodec/defs.h"
#include "avio.h"
#include "avio_internal.h"
#include "internal.h"
#include <stdarg.h>
#define IO_BUFFER_SIZE …
#define SHORT_SEEK_THRESHOLD …
static void fill_buffer(AVIOContext *s);
static int url_resetbuf(AVIOContext *s, int flags);
static int set_buf_size(AVIOContext *s, int buf_size);
void ffio_init_context(FFIOContext *ctx,
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, const uint8_t *buf, int buf_size),
int64_t (*seek)(void *opaque, int64_t offset, int whence))
{ … }
void ffio_init_read_context(FFIOContext *s, const uint8_t *buffer, int buffer_size)
{ … }
void ffio_init_write_context(FFIOContext *s, uint8_t *buffer, int buffer_size)
{ … }
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, const uint8_t *buf, int buf_size),
int64_t (*seek)(void *opaque, int64_t offset, int whence))
{ … }
void avio_context_free(AVIOContext **ps)
{ … }
static void writeout(AVIOContext *s, const uint8_t *data, int len)
{ … }
static void flush_buffer(AVIOContext *s)
{ … }
void avio_w8(AVIOContext *s, int b)
{ … }
void ffio_fill(AVIOContext *s, int b, int64_t count)
{ … }
void avio_write(AVIOContext *s, const unsigned char *buf, int size)
{ … }
void avio_flush(AVIOContext *s)
{ … }
int64_t avio_seek(AVIOContext *s, int64_t offset, int whence)
{ … }
int64_t avio_skip(AVIOContext *s, int64_t offset)
{ … }
int64_t avio_size(AVIOContext *s)
{ … }
int avio_feof(AVIOContext *s)
{ … }
void avio_wl32(AVIOContext *s, unsigned int val)
{ … }
void avio_wb32(AVIOContext *s, unsigned int val)
{ … }
int avio_put_str(AVIOContext *s, const char *str)
{ … }
static inline int put_str16(AVIOContext *s, const char *str, const int be)
{ … }
#define PUT_STR16 …
PUT_STR16(le, 0)
PUT_STR16(be, 1)
#undef PUT_STR16
void avio_wl64(AVIOContext *s, uint64_t val)
{ … }
void avio_wb64(AVIOContext *s, uint64_t val)
{ … }
void avio_wl16(AVIOContext *s, unsigned int val)
{ … }
void avio_wb16(AVIOContext *s, unsigned int val)
{ … }
void avio_wl24(AVIOContext *s, unsigned int val)
{ … }
void avio_wb24(AVIOContext *s, unsigned int val)
{ … }
void avio_write_marker(AVIOContext *s, int64_t time, enum AVIODataMarkerType type)
{ … }
static int read_packet_wrapper(AVIOContext *s, uint8_t *buf, int size)
{ … }
static void fill_buffer(AVIOContext *s)
{ … }
unsigned long ff_crc04C11DB7_update(unsigned long checksum, const uint8_t *buf,
unsigned int len)
{ … }
unsigned long ff_crcEDB88320_update(unsigned long checksum, const uint8_t *buf,
unsigned int len)
{ … }
unsigned long ff_crcA001_update(unsigned long checksum, const uint8_t *buf,
unsigned int len)
{ … }
unsigned long ffio_get_checksum(AVIOContext *s)
{ … }
void ffio_init_checksum(AVIOContext *s,
unsigned long (*update_checksum)(unsigned long c, const uint8_t *p, unsigned int len),
unsigned long checksum)
{ … }
int avio_r8(AVIOContext *s)
{ … }
int avio_read(AVIOContext *s, unsigned char *buf, int size)
{ … }
int ffio_read_size(AVIOContext *s, unsigned char *buf, int size)
{ … }
int ffio_read_indirect(AVIOContext *s, unsigned char *buf, int size, const unsigned char **data)
{ … }
int avio_read_partial(AVIOContext *s, unsigned char *buf, int size)
{ … }
unsigned int avio_rl16(AVIOContext *s)
{ … }
unsigned int avio_rl24(AVIOContext *s)
{ … }
unsigned int avio_rl32(AVIOContext *s)
{ … }
uint64_t avio_rl64(AVIOContext *s)
{ … }
unsigned int avio_rb16(AVIOContext *s)
{ … }
unsigned int avio_rb24(AVIOContext *s)
{ … }
unsigned int avio_rb32(AVIOContext *s)
{ … }
int ff_get_line(AVIOContext *s, char *buf, int maxlen)
{ … }
int ff_get_chomp_line(AVIOContext *s, char *buf, int maxlen)
{ … }
FFBPrintReadStringMode;
static int64_t read_string_to_bprint(AVIOContext *s, AVBPrint *bp,
FFBPrintReadStringMode mode,
int64_t max_len)
{ … }
static int64_t read_string_to_bprint_overwrite(AVIOContext *s, AVBPrint *bp,
FFBPrintReadStringMode mode,
int64_t max_len)
{ … }
int64_t ff_read_line_to_bprint_overwrite(AVIOContext *s, AVBPrint *bp)
{ … }
int64_t ff_read_string_to_bprint_overwrite(AVIOContext *s, AVBPrint *bp,
int64_t max_len)
{ … }
int avio_get_str(AVIOContext *s, int maxlen, char *buf, int buflen)
{ … }
#define GET_STR16 …\
GET_STR16(le, avio_rl16)
GET_STR16(be, avio_rb16)
#undef GET_STR16
uint64_t avio_rb64(AVIOContext *s)
{ … }
uint64_t ffio_read_varlen(AVIOContext *bc){ … }
unsigned int ffio_read_leb(AVIOContext *s) { … }
void ffio_write_leb(AVIOContext *s, unsigned val)
{ … }
void ffio_write_lines(AVIOContext *s, const unsigned char *buf, int size,
const unsigned char *ending)
{ … }
int ffio_copy_url_options(AVIOContext* pb, AVDictionary** avio_opts)
{ … }
static void update_checksum(AVIOContext *s)
{ … }
int ffio_ensure_seekback(AVIOContext *s, int64_t buf_size)
{ … }
int ffio_limit(AVIOContext *s, int size)
{ … }
static int set_buf_size(AVIOContext *s, int buf_size)
{ … }
int ffio_realloc_buf(AVIOContext *s, int buf_size)
{ … }
static int url_resetbuf(AVIOContext *s, int flags)
{ … }
int ffio_rewind_with_probe_data(AVIOContext *s, unsigned char **bufp, int buf_size)
{ … }
int avio_vprintf(AVIOContext *s, const char *fmt, va_list ap)
{ … }
int avio_printf(AVIOContext *s, const char *fmt, ...)
{ … }
void avio_print_string_array(AVIOContext *s, const char *const strings[])
{ … }
int avio_pause(AVIOContext *s, int pause)
{ … }
int64_t avio_seek_time(AVIOContext *s, int stream_index,
int64_t timestamp, int flags)
{ … }
int avio_read_to_bprint(AVIOContext *h, AVBPrint *pb, size_t max_size)
{ … }
DynBuffer;
static int dyn_buf_write(void *opaque, const uint8_t *buf, int buf_size)
{ … }
static int dyn_packet_buf_write(void *opaque, const uint8_t *buf, int buf_size)
{ … }
static int64_t dyn_buf_seek(void *opaque, int64_t offset, int whence)
{ … }
static int url_open_dyn_buf_internal(AVIOContext **s, int max_packet_size)
{ … }
int avio_open_dyn_buf(AVIOContext **s)
{ … }
int ffio_open_dyn_packet_buf(AVIOContext **s, int max_packet_size)
{ … }
int avio_get_dyn_buf(AVIOContext *s, uint8_t **pbuffer)
{ … }
void ffio_reset_dyn_buf(AVIOContext *s)
{ … }
int avio_close_dyn_buf(AVIOContext *s, uint8_t **pbuffer)
{ … }
void ffio_free_dyn_buf(AVIOContext **s)
{ … }
static int null_buf_write(void *opaque, const uint8_t *buf, int buf_size)
{ … }
int ffio_open_null_buf(AVIOContext **s)
{ … }
int ffio_close_null_buf(AVIOContext *s)
{ … }