Revision 82ffe191 libavutil/fifo.h

View differences:

libavutil/fifo.h
30 30
} AVFifoBuffer;
31 31

  
32 32
/**
33
 * Initializes a FIFO *.
34
 * @param *f FIFO buffer
33
 * Initializes an AVFifoBuffer.
34
 * @param *f AVFifoBuffer to initialize
35 35
 * @param size of FIFO
36 36
 * @return <0 for failure >=0 otherwise
37 37
 */
38 38
int av_fifo_init(AVFifoBuffer *f, int size);
39 39

  
40 40
/**
41
 * Frees a FIFO *.
42
 * @param *f FIFO buffer
41
 * Frees an AVFifoBuffer.
42
 * @param *f AVFifoBuffer to free
43 43
 */
44 44
void av_fifo_free(AVFifoBuffer *f);
45 45

  
46 46
/**
47
 * Returns the size of a FIFO *.
48
 * @param *f FIFO buffer
47
 * Returns the amount of data in bytes in the AVFifoBuffer, that is the
48
 * amount of data you can read from it.
49
 * @param *f AVFifoBuffer to read from
49 50
 * @return size
50 51
 */
51 52
int av_fifo_size(AVFifoBuffer *f);
52 53

  
53 54
/**
54
 * Reads the data from the FIFO *.
55
 * @param *f FIFO buffer
55
 * Reads data from an AVFifoBuffer.
56
 * @param *f AVFifoBuffer to read from
56 57
 * @param *buf data destination
57
 * @param buf_size data size
58
 * @return -1 if not enough data
58
 * @param buf_size number of bytes to read
59 59
 */
60 60
int av_fifo_read(AVFifoBuffer *f, uint8_t *buf, int buf_size);
61 61

  
62 62
/**
63
 * Reads the data from the FIFO *.
64
 * @param *f FIFO buffer
65
 * @param buf_size data size
63
 * Feeds data from an AVFifoBuffer to a user supplied callback.
64
 * @param *f AVFifoBuffer to read from
65
 * @param buf_size number of bytes to read
66 66
 * @param *func generic read function
67 67
 * @param *dest data destination
68
 * @return -1 if not enough data
69 68
 */
70 69
int av_fifo_generic_read(AVFifoBuffer *f, int buf_size, void (*func)(void*, void*, int), void* dest);
71 70

  
72 71
/**
73
 * Writes the data in the FIFO *.
74
 * @param *f FIFO buffer
72
 * Writes data into an AVFifoBuffer.
73
 * @param *f AVFifoBuffer to write to
75 74
 * @param *buf data source
76 75
 * @param size data size
77 76
 */
78 77
void av_fifo_write(AVFifoBuffer *f, const uint8_t *buf, int size);
79 78

  
80 79
/**
81
 * Resizes the FIFO *.
82
 * @param *f FIFO buffer
83
 * @param size data size
80
 * Resizes an AVFifoBuffer.
81
 * @param *f AVFifoBuffer to resize
82
 * @param size new AVFifoBuffer size in bytes
84 83
 */
85 84
void av_fifo_realloc(AVFifoBuffer *f, unsigned int size);
86 85

  
87 86
/**
88
 * Discards the data from the FIFO *.
89
 * @param *f FIFO buffer
90
 * @param size data size
87
 * Reads and discards the specified amount of data from an AVFifoBuffer.
88
 * @param *f AVFifoBuffer to read from
89
 * @param size amount of data to read in bytes
91 90
 */
92 91
void av_fifo_drain(AVFifoBuffer *f, int size);
93 92

  
94
/**
95
 * Returns a pointer with circular offset from FIFO's read pointer.
96
 * @param *f FIFO buffer
97
 * @param offs offset
98
 * @return ptr=rptr+offs if rptr+offs<end else rptr+offs -(end-begin)
99
 */
100 93
static inline uint8_t av_fifo_peek(AVFifoBuffer *f, int offs)
101 94
{
102 95
    uint8_t *ptr = f->rptr + offs;

Also available in: Unified diff