Different data types that can be returned via the AVIO write_data_type callback.
Directory entry types.
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
Allocate and initialize an AVIOContext for buffered I/O. It must be later freed with avio_context_free().
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.
Close the resource accessed by the AVIOContext s and free it. This function can only be used if s was opened by avio_open().
Close directory.
Return the written size and a pointer to the buffer. The buffer must be freed with av_free(). Padding of AV_INPUT_BUFFER_PADDING_SIZE is added to the buffer.
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().
Free the supplied IO context and everything associated with it.
Iterate through names of available protocols.
feof() equivalent for AVIOContext. @return non zero if and only if end of file
Return the name of the protocol that will handle the passed URL.
Force flushing of buffered data.
Free entry allocated by avio_read_dir().
Return the written size and a pointer to the buffer. The AVIOContext stream is left intact. The buffer must NOT be freed. No padding is added to the buffer.
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.
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)
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.
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.
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.
Open directory for reading.
Open a write only memory stream.
Pause and resume playing - only meaningful if using a network streaming protocol (e.g. MMS).
@warning Writes up to 4 KiB per call
Write a NULL-terminated string. @return number of bytes written.
Convert an UTF-8 string to UTF-16BE and write it. @param s the AVIOContext @param str NULL-terminated UTF-8 string
Convert an UTF-8 string to UTF-16LE and write it. @param s the AVIOContext @param str NULL-terminated UTF-8 string
@name Functions for reading from AVIOContext @{
Read size bytes from AVIOContext into buf. @return number of bytes read or AVERROR
Get next directory entry.
Read size bytes from AVIOContext into buf. Unlike avio_read(), this is allowed to read fewer bytes than requested. The missing bytes can be read in the next call. This always tries to read at least 1 byte. Useful to reduce latency in certain cases. @return number of bytes read or AVERROR
Read contents of h into print buffer, up to max_size bytes, or up to EOF.
fseek() equivalent for AVIOContext. @return new position or AVERROR.
Seek to a given timestamp relative to some component stream. Only meaningful if using a network streaming protocol (e.g. MMS.).
Get the filesize. @return filesize or AVERROR
Skip given number of bytes forward @return new position or AVERROR.
ftell() equivalent for AVIOContext. @return position or AVERROR.
Mark the written bytestream as a specific type.
Delete a resource.
Move or rename a resource.
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.
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.
* @name URL open modes * The flags argument to avio_open must be one of the following * constants, optionally ORed with other flags. * @{ *//**< read-only
< read-write pseudo flag
< write-only
Seeking works like for a local file.
Seeking by timestamp with avio_seek_time() is possible.
Passing this flag as 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.
ORing 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.
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*.
Describes single entry of the directory.
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.