[FFmpeg-devel] [RFC] libavformat/avio.h API cleanup

Stefano Sabatini stefano.sabatini-lala
Sun Mar 6 12:50:18 CET 2011


Hi all,

I believe that having an high level overview of the mentioned API is
useful, so people can form an opinion of the grand plan before to dig
into the details of each single change.

Current API consists of the URLProtocol and the AVIOContext
(previously AVByteIOContext) interfaces, which are somehow intermixed.

URLContext API allows to read/write/seek from a protocol context,
which is accessed through a registered URLProtocol.

AVIOContext provides unbuffered I/O operations for accessing the
resource which is accessed through a protocol.


URLContext/URLProtocol API
==========================

URLContext
URLPollEntry

URL_RDONLY
URL_WRONLY
URL_RDWR
URL_FLAG_NONBLOCK

url_open_protocol
url_alloc
url_connect
url_open
url_read
url_read_complete
url_write

AVSEEK_SIZE

url_seek
url_close
url_exist
url_filesize
url_get_file_handle
url_get_max_packet_size
url_get_filename
url_set_interrupt_cb
url_poll
av_url_read_pause
av_url_read_seek

AVSEEK_FORCE

// URLProtocol API
URLProtocol
av_protocol_next
av_register_protocol2

Bytestream IO context
=====================

AVIOContext

avio_alloc_context

avio_write
avio_w8
avio_wl64
avio_wb64
avio_wl32
avio_wb32
avio_wl24
avio_wb24
avio_wl16
avio_wb16

avio_put_str
avio_put_str16le

avio_seek
avio_tell

url_fsize
url_feof
url_ferror

av_url_read_fpause
av_url_read_fseek

url_fgetc
url_fprintf
url_fgets

put_flush_packet

avio_read
avio_r8
avio_rl16
avio_rl24
avio_rl32
avio_rl64
avio_rb16
avio_rb24
avio_rb32
avio_rb64

avio_get_str
avio_get_str16le
avio_get_str16be

ff_get_v

url_is_streamed
url_fdopen
url_setbufsize

ff_rewind_with_probe_data

avio_open
avio_close

url_fileno
url_fget_max_packet_size
url_open_buf
url_close_buf

url_open_dyn_buf
url_open_dyn_packet_buf
url_close_dyn_buf

ff_crc04C11DB7_update
get_checksum
init_checksum

...

This API is one of the last remnants of the FFmpeg dark age, and as
you can see it is desperately schizofrenic, and may benefit from a
general review/cleanup (and documentation completion while at it,
documentation helps spotting design issues).

I'll post more comments as a reply to this mail.
-- 
FFmpeg = Friendly and Fascinating Magical Portentous Empowered Gargoyle



More information about the ffmpeg-devel mailing list