Revision f5a478f6 libavformat/avformat.h

View differences:

libavformat/avformat.h
441 441

  
442 442
void av_register_all(void);
443 443

  
444
typedef struct FifoBuffer {
445
    uint8_t *buffer;
446
    uint8_t *rptr, *wptr, *end;
447
} FifoBuffer;
448

  
449
int fifo_init(FifoBuffer *f, int size);
450
void fifo_free(FifoBuffer *f);
451
int fifo_size(FifoBuffer *f, uint8_t *rptr);
452
int fifo_read(FifoBuffer *f, uint8_t *buf, int buf_size, uint8_t **rptr_ptr);
453
void fifo_write(FifoBuffer *f, const uint8_t *buf, int size, uint8_t **wptr_ptr);
454
int put_fifo(ByteIOContext *pb, FifoBuffer *f, int buf_size, uint8_t **rptr_ptr);
455
void fifo_realloc(FifoBuffer *f, unsigned int size);
456
static inline uint8_t fifo_peek(FifoBuffer *f, int offs)
457
{
458
    return f->buffer[(f->rptr - f->buffer + offs) % (f->end - f->buffer)];
459
}
460
static inline void fifo_drain(FifoBuffer *f, int size)
461
{
462
    f->rptr += size;
463
    if (f->rptr >= f->end)
464
        f->rptr = f->buffer + (f->rptr - f->end);
465
}
466

  
467 444
/* media file input */
468 445
AVInputFormat *av_find_input_format(const char *short_name);
469 446
AVInputFormat *av_probe_input_format(AVProbeData *pd, int is_opened);

Also available in: Unified diff