FFmpeg 5.1.6
Data Fields
AVIOContext Struct Reference

Bytestream IO Context. More...

#include <libavformat/avio.h>

Data Fields

const AVClassav_class
 A class for private options. More...
 
unsigned char * buffer
 Start of the buffer. More...
 
int buffer_size
 Maximum buffer size. More...
 
unsigned char * buf_ptr
 Current position in the buffer. More...
 
unsigned char * buf_end
 End of the data, may be less than buffer+buffer_size if the read function returned less data than requested, e.g. More...
 
void * opaque
 A private pointer, passed to the read/write/seek/... functions. More...
 
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)
 
int64_t pos
 position in the file of the current buffer More...
 
int eof_reached
 true if was unable to read due to error or eof More...
 
int error
 contains the error code or 0 if no error happened More...
 
int write_flag
 true if open for writing More...
 
int max_packet_size
 
int min_packet_size
 Try to buffer at least this amount of data before flushing it. More...
 
unsigned long checksum
 
unsigned char * checksum_ptr
 
unsigned long(* update_checksum )(unsigned long checksum, const uint8_t *buf, unsigned int size)
 
int(* read_pause )(void *opaque, int pause)
 Pause or resume playback for network streaming protocols - e.g. More...
 
int64_t(* read_seek )(void *opaque, int stream_index, int64_t timestamp, int flags)
 Seek to a given timestamp in stream with the specified stream_index. More...
 
int seekable
 A combination of AVIO_SEEKABLE_ flags or 0 when the stream is not seekable. More...
 
int direct
 avio_read and avio_write should if possible be satisfied directly instead of going through a buffer, and avio_seek will always call the underlying seek function directly. More...
 
const char * protocol_whitelist
 ',' separated list of allowed protocols. More...
 
const char * protocol_blacklist
 ',' separated list of disallowed protocols. More...
 
int(* write_data_type )(void *opaque, uint8_t *buf, int buf_size, enum AVIODataMarkerType type, int64_t time)
 A callback that is used instead of write_packet. More...
 
int ignore_boundary_point
 If set, don't call write_data_type separately for AVIO_DATA_MARKER_BOUNDARY_POINT, but ignore them and treat them as AVIO_DATA_MARKER_UNKNOWN (to avoid needlessly small chunks of data returned from the callback). More...
 
unsigned char * buf_ptr_max
 Maximum reached position before a backward seek in the write buffer, used keeping track of already written data for a later flush. More...
 
int64_t bytes_read
 Read-only statistic of bytes read for this AVIOContext. More...
 
int64_t bytes_written
 Read-only statistic of bytes written for this AVIOContext. More...
 

Detailed Description

Bytestream IO Context.

New public fields can be added with minor version bumps. Removal, reordering and changes to existing public fields require a major version bump. sizeof(AVIOContext) must not be used outside libav*.

Note
None of the function pointers in AVIOContext should be called directly, they should only be set by the client application when implementing custom I/O. Normally these are set to the function pointers specified in avio_alloc_context()
Examples
avio_reading.c, http_multiclient.c, qsvdec.c, and transcode_aac.c.

Definition at line 162 of file avio.h.

Field Documentation

◆ av_class

const AVClass* AVIOContext::av_class

A class for private options.

If this AVIOContext is created by avio_open2(), av_class is set and passes the options down to protocols.

If this AVIOContext is manually allocated, then av_class may be set by the caller.

warning – this field can be NULL, be sure to not pass this AVIOContext to any av_opt_* functions in that case.

Definition at line 175 of file avio.h.

◆ buffer

unsigned char* AVIOContext::buffer

Start of the buffer.

Examples
avio_reading.c.

Definition at line 227 of file avio.h.

Referenced by main().

◆ buffer_size

int AVIOContext::buffer_size

Maximum buffer size.

Definition at line 228 of file avio.h.

◆ buf_ptr

unsigned char* AVIOContext::buf_ptr

Current position in the buffer.

Definition at line 229 of file avio.h.

◆ buf_end

unsigned char* AVIOContext::buf_end

End of the data, may be less than buffer+buffer_size if the read function returned less data than requested, e.g.

for streams where no more data has been received yet.

Definition at line 230 of file avio.h.

◆ opaque

void* AVIOContext::opaque

A private pointer, passed to the read/write/seek/... functions.

Definition at line 234 of file avio.h.

◆ read_packet

int(* AVIOContext::read_packet) (void *opaque, uint8_t *buf, int buf_size)

Definition at line 236 of file avio.h.

◆ write_packet

int(* AVIOContext::write_packet) (void *opaque, uint8_t *buf, int buf_size)

Definition at line 237 of file avio.h.

◆ seek

int64_t(* AVIOContext::seek) (void *opaque, int64_t offset, int whence)

Definition at line 238 of file avio.h.

◆ pos

int64_t AVIOContext::pos

position in the file of the current buffer

Definition at line 239 of file avio.h.

◆ eof_reached

int AVIOContext::eof_reached

true if was unable to read due to error or eof

Definition at line 240 of file avio.h.

◆ error

int AVIOContext::error

contains the error code or 0 if no error happened

Definition at line 241 of file avio.h.

◆ write_flag

int AVIOContext::write_flag

true if open for writing

Definition at line 242 of file avio.h.

◆ max_packet_size

int AVIOContext::max_packet_size

Definition at line 243 of file avio.h.

◆ min_packet_size

int AVIOContext::min_packet_size

Try to buffer at least this amount of data before flushing it.

Definition at line 244 of file avio.h.

◆ checksum

unsigned long AVIOContext::checksum

Definition at line 246 of file avio.h.

◆ checksum_ptr

unsigned char* AVIOContext::checksum_ptr

Definition at line 247 of file avio.h.

◆ update_checksum

unsigned long(* AVIOContext::update_checksum) (unsigned long checksum, const uint8_t *buf, unsigned int size)

Definition at line 248 of file avio.h.

◆ read_pause

int(* AVIOContext::read_pause) (void *opaque, int pause)

Pause or resume playback for network streaming protocols - e.g.

MMS.

Definition at line 252 of file avio.h.

◆ read_seek

int64_t(* AVIOContext::read_seek) (void *opaque, int stream_index, int64_t timestamp, int flags)

Seek to a given timestamp in stream with the specified stream_index.

Needed for some network streaming protocols which don't support seeking to byte position.

Definition at line 258 of file avio.h.

◆ seekable

int AVIOContext::seekable

A combination of AVIO_SEEKABLE_ flags or 0 when the stream is not seekable.

Definition at line 263 of file avio.h.

◆ direct

int AVIOContext::direct

avio_read and avio_write should if possible be satisfied directly instead of going through a buffer, and avio_seek will always call the underlying seek function directly.

Definition at line 270 of file avio.h.

◆ protocol_whitelist

const char* AVIOContext::protocol_whitelist

',' separated list of allowed protocols.

Definition at line 275 of file avio.h.

◆ protocol_blacklist

const char* AVIOContext::protocol_blacklist

',' separated list of disallowed protocols.

Definition at line 280 of file avio.h.

◆ write_data_type

int(* AVIOContext::write_data_type) (void *opaque, uint8_t *buf, int buf_size, enum AVIODataMarkerType type, int64_t time)

A callback that is used instead of write_packet.

Definition at line 285 of file avio.h.

◆ ignore_boundary_point

int AVIOContext::ignore_boundary_point

If set, don't call write_data_type separately for AVIO_DATA_MARKER_BOUNDARY_POINT, but ignore them and treat them as AVIO_DATA_MARKER_UNKNOWN (to avoid needlessly small chunks of data returned from the callback).

Definition at line 292 of file avio.h.

◆ buf_ptr_max

unsigned char* AVIOContext::buf_ptr_max

Maximum reached position before a backward seek in the write buffer, used keeping track of already written data for a later flush.

Definition at line 308 of file avio.h.

◆ bytes_read

int64_t AVIOContext::bytes_read

Read-only statistic of bytes read for this AVIOContext.

Definition at line 313 of file avio.h.

◆ bytes_written

int64_t AVIOContext::bytes_written

Read-only statistic of bytes written for this AVIOContext.

Definition at line 318 of file avio.h.


The documentation for this struct was generated from the following file: