annotate fifo.h @ 263:4a904af6d8f4 libavutil

Add missing license headers.
author diego
date Tue, 27 Feb 2007 16:05:19 +0000
parents 813b7366ac3f
children 73376a65f2e1
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
263
4a904af6d8f4 Add missing license headers.
diego
parents: 110
diff changeset
1 /*
4a904af6d8f4 Add missing license headers.
diego
parents: 110
diff changeset
2 * This file is part of FFmpeg.
4a904af6d8f4 Add missing license headers.
diego
parents: 110
diff changeset
3 *
4a904af6d8f4 Add missing license headers.
diego
parents: 110
diff changeset
4 * FFmpeg is free software; you can redistribute it and/or
4a904af6d8f4 Add missing license headers.
diego
parents: 110
diff changeset
5 * modify it under the terms of the GNU Lesser General Public
4a904af6d8f4 Add missing license headers.
diego
parents: 110
diff changeset
6 * License as published by the Free Software Foundation; either
4a904af6d8f4 Add missing license headers.
diego
parents: 110
diff changeset
7 * version 2.1 of the License, or (at your option) any later version.
4a904af6d8f4 Add missing license headers.
diego
parents: 110
diff changeset
8 *
4a904af6d8f4 Add missing license headers.
diego
parents: 110
diff changeset
9 * FFmpeg is distributed in the hope that it will be useful,
4a904af6d8f4 Add missing license headers.
diego
parents: 110
diff changeset
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
4a904af6d8f4 Add missing license headers.
diego
parents: 110
diff changeset
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
4a904af6d8f4 Add missing license headers.
diego
parents: 110
diff changeset
12 * Lesser General Public License for more details.
4a904af6d8f4 Add missing license headers.
diego
parents: 110
diff changeset
13 *
4a904af6d8f4 Add missing license headers.
diego
parents: 110
diff changeset
14 * You should have received a copy of the GNU Lesser General Public
4a904af6d8f4 Add missing license headers.
diego
parents: 110
diff changeset
15 * License along with FFmpeg; if not, write to the Free Software
4a904af6d8f4 Add missing license headers.
diego
parents: 110
diff changeset
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
4a904af6d8f4 Add missing license headers.
diego
parents: 110
diff changeset
17 */
4a904af6d8f4 Add missing license headers.
diego
parents: 110
diff changeset
18
110
813b7366ac3f * Moving FifoBuffer out of libavformat/avformat.h and
romansh
parents:
diff changeset
19 #ifndef FIFO_H
813b7366ac3f * Moving FifoBuffer out of libavformat/avformat.h and
romansh
parents:
diff changeset
20 #define FIFO_H
813b7366ac3f * Moving FifoBuffer out of libavformat/avformat.h and
romansh
parents:
diff changeset
21
813b7366ac3f * Moving FifoBuffer out of libavformat/avformat.h and
romansh
parents:
diff changeset
22 typedef struct AVFifoBuffer {
813b7366ac3f * Moving FifoBuffer out of libavformat/avformat.h and
romansh
parents:
diff changeset
23 uint8_t *buffer;
813b7366ac3f * Moving FifoBuffer out of libavformat/avformat.h and
romansh
parents:
diff changeset
24 uint8_t *rptr, *wptr, *end;
813b7366ac3f * Moving FifoBuffer out of libavformat/avformat.h and
romansh
parents:
diff changeset
25 } AVFifoBuffer;
813b7366ac3f * Moving FifoBuffer out of libavformat/avformat.h and
romansh
parents:
diff changeset
26
813b7366ac3f * Moving FifoBuffer out of libavformat/avformat.h and
romansh
parents:
diff changeset
27 int av_fifo_init(AVFifoBuffer *f, int size);
813b7366ac3f * Moving FifoBuffer out of libavformat/avformat.h and
romansh
parents:
diff changeset
28 void av_fifo_free(AVFifoBuffer *f);
813b7366ac3f * Moving FifoBuffer out of libavformat/avformat.h and
romansh
parents:
diff changeset
29 int av_fifo_size(AVFifoBuffer *f);
813b7366ac3f * Moving FifoBuffer out of libavformat/avformat.h and
romansh
parents:
diff changeset
30 int av_fifo_read(AVFifoBuffer *f, uint8_t *buf, int buf_size);
813b7366ac3f * Moving FifoBuffer out of libavformat/avformat.h and
romansh
parents:
diff changeset
31 int av_fifo_generic_read(AVFifoBuffer *f, int buf_size, void (*func)(void*, void*, int), void* dest);
813b7366ac3f * Moving FifoBuffer out of libavformat/avformat.h and
romansh
parents:
diff changeset
32 void av_fifo_write(AVFifoBuffer *f, const uint8_t *buf, int size);
813b7366ac3f * Moving FifoBuffer out of libavformat/avformat.h and
romansh
parents:
diff changeset
33 void av_fifo_realloc(AVFifoBuffer *f, unsigned int size);
813b7366ac3f * Moving FifoBuffer out of libavformat/avformat.h and
romansh
parents:
diff changeset
34 void av_fifo_drain(AVFifoBuffer *f, int size);
813b7366ac3f * Moving FifoBuffer out of libavformat/avformat.h and
romansh
parents:
diff changeset
35
813b7366ac3f * Moving FifoBuffer out of libavformat/avformat.h and
romansh
parents:
diff changeset
36 static inline uint8_t av_fifo_peek(AVFifoBuffer *f, int offs)
813b7366ac3f * Moving FifoBuffer out of libavformat/avformat.h and
romansh
parents:
diff changeset
37 {
813b7366ac3f * Moving FifoBuffer out of libavformat/avformat.h and
romansh
parents:
diff changeset
38 uint8_t *ptr = f->rptr + offs;
813b7366ac3f * Moving FifoBuffer out of libavformat/avformat.h and
romansh
parents:
diff changeset
39 if (ptr >= f->end)
813b7366ac3f * Moving FifoBuffer out of libavformat/avformat.h and
romansh
parents:
diff changeset
40 ptr -= f->end - f->buffer;
813b7366ac3f * Moving FifoBuffer out of libavformat/avformat.h and
romansh
parents:
diff changeset
41 return *ptr;
813b7366ac3f * Moving FifoBuffer out of libavformat/avformat.h and
romansh
parents:
diff changeset
42 }
813b7366ac3f * Moving FifoBuffer out of libavformat/avformat.h and
romansh
parents:
diff changeset
43 #endif /* FIFO_H */