|
|
|
@ -122,6 +122,53 @@ typedef struct AVIOContext { |
|
|
|
|
* to any av_opt_* functions in that case. |
|
|
|
|
*/ |
|
|
|
|
const AVClass *av_class; |
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* The following shows the relationship between buffer, buf_ptr, buf_end, buf_size, |
|
|
|
|
* and pos, when reading and when writing (since AVIOContext is used for both): |
|
|
|
|
* |
|
|
|
|
********************************************************************************** |
|
|
|
|
* READING |
|
|
|
|
********************************************************************************** |
|
|
|
|
* |
|
|
|
|
* | buffer_size | |
|
|
|
|
* |---------------------------------------| |
|
|
|
|
* | | |
|
|
|
|
* |
|
|
|
|
* buffer buf_ptr buf_end |
|
|
|
|
* +---------------+-----------------------+ |
|
|
|
|
* |/ / / / / / / /|/ / / / / / /| | |
|
|
|
|
* read buffer: |/ / consumed / | to be read /| | |
|
|
|
|
* |/ / / / / / / /|/ / / / / / /| | |
|
|
|
|
* +---------------+-----------------------+ |
|
|
|
|
* |
|
|
|
|
* pos |
|
|
|
|
* +-------------------------------------------+-----------------+ |
|
|
|
|
* input file: | | | |
|
|
|
|
* +-------------------------------------------+-----------------+ |
|
|
|
|
* |
|
|
|
|
* |
|
|
|
|
********************************************************************************** |
|
|
|
|
* WRITING |
|
|
|
|
********************************************************************************** |
|
|
|
|
* |
|
|
|
|
* | buffer_size | |
|
|
|
|
* |-------------------------------| |
|
|
|
|
* | | |
|
|
|
|
* |
|
|
|
|
* buffer buf_ptr buf_end |
|
|
|
|
* +-------------------+-----------+ |
|
|
|
|
* |/ / / / / / / / / /| | |
|
|
|
|
* write buffer: | / to be flushed / | | |
|
|
|
|
* |/ / / / / / / / / /| | |
|
|
|
|
* +-------------------+-----------+ |
|
|
|
|
* |
|
|
|
|
* pos |
|
|
|
|
* +--------------------------+-----------------------------------+ |
|
|
|
|
* output file: | | | |
|
|
|
|
* +--------------------------+-----------------------------------+ |
|
|
|
|
* |
|
|
|
|
*/ |
|
|
|
|
unsigned char *buffer; /**< Start of the buffer. */ |
|
|
|
|
int buffer_size; /**< Maximum buffer size */ |
|
|
|
|
unsigned char *buf_ptr; /**< Current position in the buffer */ |
|
|
|
|