00001 /* 00002 * Copyright (C) 2000 Rich Wareham <richwareham@users.sourceforge.net> 00003 * 00004 * This file is part of libdvdnav, a DVD navigation library. 00005 * 00006 * libdvdnav is free software; you can redistribute it and/or modify 00007 * it under the terms of the GNU General Public License as published by 00008 * the Free Software Foundation; either version 2 of the License, or 00009 * (at your option) any later version. 00010 * 00011 * libdvdnav is distributed in the hope that it will be useful, 00012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 * GNU General Public License for more details. 00015 * 00016 * You should have received a copy of the GNU General Public License 00017 * along with this program; if not, write to the Free Software 00018 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA 00019 * 00020 * $Id: read_cache.h,v 1.1 2002/08/08 17:49:21 richwareham Exp $ 00021 * 00022 */ 00023 00024 #ifndef __DVDNAV_READ_CACHE_H 00025 #define __DVDNAV_READ_CACHE_H 00026 00027 #include "dvdnav_internal.h" 00028 00029 /* Opaque cache type -- defined in dvdnav_internal.h */ 00030 /* typedef struct read_cache_s read_cache_t; */ 00031 00032 /* EXPERIMENTAL: Setting the following to 1 will use an experimental multi-threaded 00033 * read-ahead cache. 00034 */ 00035 #define _MULTITHREAD_ 0 00036 00037 /* Constructor/destructors */ 00038 read_cache_t *dvdnav_read_cache_new(dvdnav_t* dvd_self); 00039 void dvdnav_read_cache_free(read_cache_t* self); 00040 00041 /* This function MUST be called whenever self->file changes. */ 00042 void dvdnav_read_cache_clear(read_cache_t *self); 00043 /* This function is called just after reading the NAV packet. */ 00044 void dvdnav_pre_cache_blocks(read_cache_t *self, int sector, size_t block_count); 00045 /* This function will do the cache read. 00046 * The buffer handed in must be malloced to take one dvd block. 00047 * On a cache hit, a different buffer will be returned though. 00048 * Those buffers must _never_ be freed. */ 00049 int dvdnav_read_cache_block(read_cache_t *self, int sector, size_t block_count, uint8_t **buf); 00050 00051 #endif /* __DVDNAV_READ_CACHE_H */
1.5.5