ffmpeg.libavformat.avio

Undocumented in source.

Members

Enums

AVIODirEntryType
enum AVIODirEntryType

Directory entry types.

Functions

avio_accept
int avio_accept(AVIOContext* s, AVIOContext** c)

Accept and allocate a client context on a server context. @param s the server context @param c the client context, must be unallocated @return >= 0 on success or a negative value corresponding to an AVERROR on failure

avio_alloc_context
AVIOContext* avio_alloc_context(ubyte* buffer, int buffer_size, int write_flag, void* opaque, int function(void* opaque, uint8_t* buf, int buf_size) read_packet, int function(void* opaque, uint8_t* buf, int buf_size) write_packet, int64_t function(void* opaque, int64_t offset, int whence) seek)

Allocate and initialize an AVIOContext for buffered I/O. It must be later freed with av_free().

avio_check
int avio_check(char* url, int flags)

Return AVIO_FLAG_* access flags corresponding to the access permissions of the resource in url, or a negative value corresponding to an AVERROR code in case of failure. The returned access flags are masked by the value in flags.

avio_close
int avio_close(AVIOContext* s)

Close the resource accessed by the AVIOContext s and free it. This function can only be used if s was opened by avio_open().

avio_close_dir
int avio_close_dir(AVIODirContext** s)

Close directory.

avio_close_dyn_buf
int avio_close_dyn_buf(AVIOContext* s, uint8_t** pbuffer)

Return the written size and a pointer to the buffer. The buffer must be freed with av_free(). Padding of FF_INPUT_BUFFER_PADDING_SIZE is added to the buffer.

avio_closep
int avio_closep(AVIOContext** s)

Close the resource accessed by the AVIOContext *s, free it and set the pointer pointing to it to NULL. This function can only be used if s was opened by avio_open().

avio_enum_protocols
char* avio_enum_protocols(void** opaque, int output)

Iterate through names of available protocols.

avio_feof
int avio_feof(AVIOContext* s)

feof() equivalent for AVIOContext. @return non zero if and only if end of file

avio_find_protocol_name
char* avio_find_protocol_name(char* url)

Return the name of the protocol that will handle the passed URL.

avio_flush
void avio_flush(AVIOContext* s)

Force flushing of buffered data to the output s.

avio_free_directory_entry
void avio_free_directory_entry(AVIODirEntry** entry)

Free entry allocated by avio_read_dir().

avio_get_str
int avio_get_str(AVIOContext* pb, int maxlen, char* buf, int buflen)

Read a string from pb into buf. The reading will terminate when either a NULL character was encountered, maxlen bytes have been read, or nothing more can be read from pb. The result is guaranteed to be NULL-terminated, it will be truncated if buf is too small. Note that the string is not interpreted or validated in any way, it might get truncated in the middle of a sequence for multi-byte encodings.

avio_get_str16be
int avio_get_str16be(AVIOContext* pb, int maxlen, char* buf, int buflen)
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
avio_get_str16le
int avio_get_str16le(AVIOContext* pb, int maxlen, char* buf, int buflen)

Read a UTF-16 string from pb and convert it to UTF-8. The reading will terminate when either a null or invalid character was encountered or maxlen bytes have been read. @return number of bytes read (is always <= maxlen)

avio_handshake
int avio_handshake(AVIOContext* c)

Perform one step of the protocol handshake to accept a new client. This function must be called on a client returned by avio_accept() before using it as a read/write context. It is separate from avio_accept() because it may block. A step of the handshake is defined by places where the application may decide to change the proceedings. For example, on a protocol with a request header and a reply header, each one can constitute a step because the application may use the parameters from the request to change parameters in the reply; or each individual chunk of the request can constitute a step. If the handshake is already finished, avio_handshake() does nothing and returns 0 immediately.

avio_open
int avio_open(AVIOContext** s, char* url, int flags)

Create and initialize a AVIOContext for accessing the resource indicated by url. @note When the resource indicated by url has been opened in read+write mode, the AVIOContext can be used only for writing.

avio_open2
int avio_open2(AVIOContext** s, char* url, int flags, AVIOInterruptCB* int_cb, AVDictionary** options)

Create and initialize a AVIOContext for accessing the resource indicated by url. @note When the resource indicated by url has been opened in read+write mode, the AVIOContext can be used only for writing.

avio_open_dir
int avio_open_dir(AVIODirContext** s, char* url, AVDictionary** options)

Open directory for reading.

avio_open_dyn_buf
int avio_open_dyn_buf(AVIOContext** s)

Open a write only memory stream.

avio_pause
int avio_pause(AVIOContext* h, int pause)

Pause and resume playing - only meaningful if using a network streaming protocol (e.g. MMS).

avio_printf
int avio_printf(AVIOContext* s, char* fmt, ...)

@warning currently size is limited

avio_put_str
int avio_put_str(AVIOContext* s, char* str)

Write a NULL-terminated string. @return number of bytes written.

avio_put_str16be
int avio_put_str16be(AVIOContext* s, char* str)

Convert an UTF-8 string to UTF-16BE and write it. @param s the AVIOContext @param str NULL-terminated UTF-8 string

avio_put_str16le
int avio_put_str16le(AVIOContext* s, char* str)

Convert an UTF-8 string to UTF-16LE and write it. @return number of bytes written.

avio_r8
int avio_r8(AVIOContext* s)

@name Functions for reading from AVIOContext @{

avio_rb16
uint avio_rb16(AVIOContext* s)
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
avio_rb24
uint avio_rb24(AVIOContext* s)
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
avio_rb32
uint avio_rb32(AVIOContext* s)
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
avio_rb64
uint64_t avio_rb64(AVIOContext* s)
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
avio_read
int avio_read(AVIOContext* s, ubyte* buf, int size)

Read size bytes from AVIOContext into buf. @return number of bytes read or AVERROR

avio_read_dir
int avio_read_dir(AVIODirContext* s, AVIODirEntry** next)

Get next directory entry.

avio_read_to_bprint
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.

avio_rl16
uint avio_rl16(AVIOContext* s)
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
avio_rl24
uint avio_rl24(AVIOContext* s)
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
avio_rl32
uint avio_rl32(AVIOContext* s)
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
avio_rl64
uint64_t avio_rl64(AVIOContext* s)
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
avio_seek
int64_t avio_seek(AVIOContext* s, int64_t offset, int whence)

fseek() equivalent for AVIOContext. @return new position or AVERROR.

avio_seek_time
int64_t avio_seek_time(AVIOContext* h, int stream_index, int64_t timestamp, int flags)

Seek to a given timestamp relative to some component stream. Only meaningful if using a network streaming protocol (e.g. MMS.).

avio_size
int64_t avio_size(AVIOContext* s)

Get the filesize. @return filesize or AVERROR

avio_skip
int64_t avio_skip(AVIOContext* s, int64_t offset)

Skip given number of bytes forward @return new position or AVERROR.

avio_w8
void avio_w8(AVIOContext* s, int b)
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
avio_wb16
void avio_wb16(AVIOContext* s, uint val)
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
avio_wb24
void avio_wb24(AVIOContext* s, uint val)
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
avio_wb32
void avio_wb32(AVIOContext* s, uint val)
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
avio_wb64
void avio_wb64(AVIOContext* s, uint64_t val)
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
avio_wl16
void avio_wl16(AVIOContext* s, uint val)
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
avio_wl24
void avio_wl24(AVIOContext* s, uint val)
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
avio_wl32
void avio_wl32(AVIOContext* s, uint val)
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
avio_wl64
void avio_wl64(AVIOContext* s, uint64_t val)
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
avio_write
void avio_write(AVIOContext* s, ubyte* buf, int size)
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
avpriv_io_delete
int avpriv_io_delete(char* url)

Delete a resource.

avpriv_io_move
int avpriv_io_move(char* url_src, char* url_dst)

Move or rename a resource.

url_feof
deprecated int url_feof(AVIOContext* s)

@deprecated use avio_feof()

Manifest constants

AVIO_FLAG_DIRECT
enum AVIO_FLAG_DIRECT;

Use direct mode. 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.

AVIO_FLAG_NONBLOCK
enum AVIO_FLAG_NONBLOCK;

Use non-blocking mode. If this flag is set, operations on the context will return AVERROR(EAGAIN) if they can not be performed immediately. If this flag is not set, operations on the context will never return AVERROR(EAGAIN). Note that this flag does not affect the opening/connecting of the context. Connecting a protocol will always block if necessary (e.g. on network protocols) but never hang (e.g. on busy devices). Warning: non-blocking protocols is work-in-progress; this flag may be silently ignored.

AVIO_FLAG_READ
enum AVIO_FLAG_READ;

* @name URL open modes * The flags argument to avio_open must be one of the following * constants, optionally ORed with other flags. * @{ *//**< read-only

AVIO_FLAG_READ_WRITE
enum AVIO_FLAG_READ_WRITE;

< read-write pseudo flag

AVIO_FLAG_WRITE
enum AVIO_FLAG_WRITE;

< write-only

AVSEEK_FORCE
enum AVSEEK_FORCE;

Oring this flag as into the "whence" parameter to a seek function causes it to seek by any means (like reopening and linear reading) or other normally unreasonable means that can be extremely slow. This may be ignored by the seek code.

AVSEEK_SIZE
enum AVSEEK_SIZE;

Passing this as the "whence" parameter to a seek function causes it to return the filesize without seeking anywhere. Supporting this is optional. If it is not supported then the seek function will return <0.

Static functions

avio_tell
int64_t avio_tell(AVIOContext* s)

ftell() equivalent for AVIOContext. @return position or AVERROR.

Structs

AVBPrint
struct AVBPrint
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
AVIOContext
struct AVIOContext

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

AVIODirContext
struct AVIODirContext
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
AVIODirEntry
struct AVIODirEntry

Describes single entry of the directory.

AVIOInterruptCB
struct AVIOInterruptCB

Callback for checking whether to abort blocking functions. AVERROR_EXIT is returned in this case by the interrupted function. During blocking operations, callback is called with opaque as parameter. If the callback returns 1, the blocking operation will be aborted.

Variables

AVIO_SEEKABLE_NORMAL
int AVIO_SEEKABLE_NORMAL;

* @file * @ingroup lavf_io * Buffered I/O operations *//**< Seeking works like for a local file

Meta