00001 /***************************************************************************** 00002 * mpegdemux * 00003 *****************************************************************************/ 00004 00005 /***************************************************************************** 00006 * File name: buffer.h * 00007 * Created: 2003-04-08 by Hampa Hug <hampa@hampa.ch> * 00008 * Last modified: 2003-04-08 by Hampa Hug <hampa@hampa.ch> * 00009 * Copyright: (C) 2003 by Hampa Hug <hampa@hampa.ch> * 00010 *****************************************************************************/ 00011 00012 /***************************************************************************** 00013 * This program is free software. You can redistribute it and / or modify it * 00014 * under the terms of the GNU General Public License version 2 as published * 00015 * by the Free Software Foundation. * 00016 * * 00017 * This program is distributed in the hope that it will be useful, but * 00018 * WITHOUT ANY WARRANTY, without even the implied warranty of * 00019 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General * 00020 * Public License for more details. * 00021 *****************************************************************************/ 00022 00023 /* $Id: buffer.h 67 2004-01-02 18:20:15Z hampa $ */ 00024 00025 // The code has been modified to use file descriptors instead of FILE streams. 00026 // Only functionality needed in MediaTomb remains, all extra features are 00027 // stripped out. 00028 00029 #ifndef MPEGDEMUX_BUFFER_H 00030 #define MPEGDEMUX_BUFFER_H 1 00031 00032 00033 #include "mpeg_parse.h" 00034 00035 00036 typedef struct { 00037 unsigned char *buf; 00038 unsigned cnt; 00039 unsigned max; 00040 } mpeg_buffer_t; 00041 00042 00043 00044 void mpeg_buf_init (mpeg_buffer_t *buf); 00045 void mpeg_buf_free (mpeg_buffer_t *buf); 00046 void mpeg_buf_clear (mpeg_buffer_t *buf); 00047 int mpeg_buf_set_max (mpeg_buffer_t *buf, unsigned max); 00048 int mpeg_buf_set_cnt (mpeg_buffer_t *buf, unsigned cnt); 00049 int mpeg_buf_read (mpeg_buffer_t *buf, mpeg_demux_t *mpeg, unsigned cnt); 00050 int mpeg_buf_write (mpeg_buffer_t *buf, int fd); 00051 int mpeg_buf_write_clear (mpeg_buffer_t *buf, int fd); 00052 00053 00054 #endif
1.6.1