19#ifndef AVFORMAT_AVIO_INTERNAL_H
20#define AVFORMAT_AVIO_INTERNAL_H
93 int (*
read_packet)(
void *opaque, uint8_t *buf,
int buf_size),
94 int (*
write_packet)(
void *opaque,
const uint8_t *buf,
int buf_size),
166 const unsigned char *ending);
199 unsigned long checksum);
258 const char *whitelist,
const char *blacklist);
267 const char *whitelist,
const char *blacklist,
static double val(void *priv, double ch)
static AVFormatContext * ctx
const AVClass ff_avio_class
void avio_wl32(AVIOContext *s, unsigned int val)
AVIODataMarkerType
Different data types that can be returned via the AVIO write_data_type callback.
void ffio_init_checksum(AVIOContext *s, unsigned long(*update_checksum)(unsigned long c, const uint8_t *p, unsigned int len), unsigned long checksum)
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.
unsigned long ff_crcA001_update(unsigned long checksum, const uint8_t *buf, unsigned int len)
static av_always_inline FFIOContext * ffiocontext(AVIOContext *ctx)
unsigned long ffio_get_checksum(AVIOContext *s)
int ffio_open_whitelist2(AVIOContext **s, const char *url, int flags, const AVIOInterruptCB *int_cb, AVDictionary **options, const char *whitelist, const char *blacklist, AVFormatContext *avfc)
Like ffio_open_whitelist(), but additionally records avfc on the underlying URLContext before it is c...
static av_always_inline void ffio_wfourcc(AVIOContext *pb, const uint8_t *s)
void ffio_reset_dyn_buf(AVIOContext *s)
Reset a dynamic buffer.
struct URLContext * ffio_geturlcontext(AVIOContext *s)
Return the URLContext associated with the AVIOContext.
void ffio_write_leb(AVIOContext *s, unsigned val)
int ffio_open_whitelist(AVIOContext **s, const char *url, int flags, const AVIOInterruptCB *int_cb, AVDictionary **options, const char *whitelist, const char *blacklist)
int ffio_ensure_seekback(AVIOContext *s, int64_t buf_size)
Ensures that the requested seekback buffer size will be available.
int64_t ff_read_string_to_bprint_overwrite(AVIOContext *s, struct AVBPrint *bp, int64_t max_len)
Read a whole null-terminated string of text from AVIOContext to an AVBPrint buffer overwriting its co...
void ffio_init_write_context(FFIOContext *s, uint8_t *buffer, int buffer_size)
Wrap a buffer in an AVIOContext for writing.
int ffio_open_null_buf(AVIOContext **s)
Open a write-only fake memory stream.
void ffio_fill(AVIOContext *s, int b, int64_t count)
unsigned long ff_crcEDB88320_update(unsigned long checksum, const uint8_t *buf, unsigned int len)
uint64_t ffio_read_varlen(AVIOContext *bc)
void ffio_init_context(FFIOContext *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, const uint8_t *buf, int buf_size), int64_t(*seek)(void *opaque, int64_t offset, int whence))
int ffio_fdopen(AVIOContext **s, struct URLContext *h)
Create and initialize a AVIOContext for accessing the resource referenced by the URLContext h.
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.
void ffio_init_read_context(FFIOContext *s, const uint8_t *buffer, int buffer_size)
Wrap a buffer in an AVIOContext for reading.
int ffio_read_size(AVIOContext *s, unsigned char *buf, int size)
Read size bytes from AVIOContext into buf.
unsigned int ffio_read_leb(AVIOContext *s)
Read a unsigned integer coded as a variable number of up to eight little-endian bytes,...
int ffio_close_null_buf(AVIOContext *s)
Close a null buffer.
int ffio_limit(AVIOContext *s, int size)
int ffio_rewind_with_probe_data(AVIOContext *s, unsigned char **buf, int buf_size)
Rewind the AVIOContext using the specified buffer containing the first buf_size bytes of the file.
unsigned long ff_crc04C11DB7_update(unsigned long checksum, const uint8_t *buf, unsigned int len)
int ffio_copy_url_options(AVIOContext *pb, AVDictionary **avio_opts)
Read url related dictionary options from the AVIOContext and write to the given dictionary.
int64_t ff_read_line_to_bprint_overwrite(AVIOContext *s, struct AVBPrint *bp)
Read a whole line of text from AVIOContext to an AVBPrint buffer overwriting its contents.
void ffio_write_lines(AVIOContext *s, const unsigned char *buf, int size, const unsigned char *ending)
Write a sequence of text lines, converting line endings.
static int read_packet(void *opaque, uint8_t *buf, int buf_size)
static void update_checksum(AVIOContext *s)
static void BS_FUNC seek(BSCTX *bc, unsigned pos)
Seek to the given bit position.
#define flags(name, subs,...)
const AVIOInterruptCB int_cb
static int write_packet(Muxer *mux, OutputStream *ost, AVPacket *pkt)
#define MKTAG(a, b, c, d)
Describe the class of an AVClass context structure.
Callback for checking whether to abort blocking functions.
int short_seek_threshold
Threshold to favor readahead over seek.
int64_t bytes_written
Bytes written statistic.
int64_t maxsize
max filesize, used to limit allocations
int(* short_seek_get)(void *opaque)
A callback that is used instead of short_seek_threshold.
int writeout_count
writeout statistic
int seek_count
seek statistic
enum AVIODataMarkerType current_type
int64_t written_output_size
Written output size is updated each time a successful writeout ends up further position-wise.
int64_t bytes_read
Bytes read statistic.
int orig_buffer_size
Original buffer size used after probing to ensure seekback and to reset the buffer size.
struct AVFormatContext * avfc
the AVFormatContext that opened this URLContext, or NULL for standalone use