There is an example in FFMPEG source code. bm_ffmpeg/doc/examples/avio_reading.c
This case makes libavformat demuxer access media content through a
custom AVIOContext read callbackinstread of file, rtsp, etc protocols defined in FFMPEG.
This is an example in middleware-soc about using avio + jpeg_bm to decode s
till jpeg picture. (bm_ffmpeg/doc/examples/avio_decode_jpeg.c)