• Main Page
  • Related Pages
  • Modules
  • Data Structures
  • Files
  • File List
  • Globals

libavutil/fifo.h

Go to the documentation of this file.
00001 /*
00002  * This file is part of FFmpeg.
00003  *
00004  * FFmpeg is free software; you can redistribute it and/or
00005  * modify it under the terms of the GNU Lesser General Public
00006  * License as published by the Free Software Foundation; either
00007  * version 2.1 of the License, or (at your option) any later version.
00008  *
00009  * FFmpeg is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012  * Lesser General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU Lesser General Public
00015  * License along with FFmpeg; if not, write to the Free Software
00016  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
00017  */
00018 
00024 #ifndef AVUTIL_FIFO_H
00025 #define AVUTIL_FIFO_H
00026 
00027 #include <stdint.h>
00028 #include "avutil.h"
00029 #include "common.h"
00030 
00031 typedef struct AVFifoBuffer {
00032     uint8_t *buffer;
00033     uint8_t *rptr, *wptr, *end;
00034 } AVFifoBuffer;
00035 
00042 int av_fifo_init(AVFifoBuffer *f, unsigned int size);
00043 
00048 void av_fifo_free(AVFifoBuffer *f);
00049 
00056 int av_fifo_size(AVFifoBuffer *f);
00057 
00064 int av_fifo_read(AVFifoBuffer *f, uint8_t *buf, int buf_size);
00065 
00073 int av_fifo_generic_read(AVFifoBuffer *f, int buf_size, void (*func)(void*, void*, int), void* dest);
00074 
00075 #if LIBAVUTIL_VERSION_MAJOR < 50
00076 
00082 attribute_deprecated void av_fifo_write(AVFifoBuffer *f, const uint8_t *buf, int size);
00083 #endif
00084 
00097 int av_fifo_generic_write(AVFifoBuffer *f, void *src, int size, int (*func)(void*, void*, int));
00098 
00099 #if LIBAVUTIL_VERSION_MAJOR < 50
00100 
00106 attribute_deprecated void av_fifo_realloc(AVFifoBuffer *f, unsigned int size);
00107 #endif
00108 
00115 int av_fifo_realloc2(AVFifoBuffer *f, unsigned int size);
00116 
00122 void av_fifo_drain(AVFifoBuffer *f, int size);
00123 
00124 static inline uint8_t av_fifo_peek(AVFifoBuffer *f, int offs)
00125 {
00126     uint8_t *ptr = f->rptr + offs;
00127     if (ptr >= f->end)
00128         ptr -= f->end - f->buffer;
00129     return *ptr;
00130 }
00131 #endif /* AVUTIL_FIFO_H */

Generated on Sat Feb 16 2013 09:23:15 for ffmpeg by  doxygen 1.7.1