diff read_cache.h @ 34:1f29402ef2ef src

'Objectified' the read-ahead cache in preparation to implement a 'proper' threaded cache a-la that recommended in the DVD Demystified book.
author richwareham
date Thu, 30 May 2002 09:52:29 +0000
parents 3ddf0eaece51
children 50e0855a2017
line wrap: on
line diff
--- a/read_cache.h	Thu May 09 11:57:24 2002 +0000
+++ b/read_cache.h	Thu May 30 09:52:29 2002 +0000
@@ -26,11 +26,23 @@
 
 #include "dvdnav_internal.h"
 
+/* Opaque cache type -- defined in dvdnav_internal.h */
+/* typedef struct read_cache_s read_cache_t; */
+
+/* EXPERIMENTAL: Setting the following to 1 will use an experimental multi-threaded
+ *               read-ahead cache. 
+ */
+#define _MULTITHREAD_ 0
+
+/* Constructor/destructors */
+read_cache_t *dvdnav_read_cache_new(dvdnav_t* dvd_self);
+void dvdnav_read_cache_free(read_cache_t* self);
+
 /* This function MUST be called whenever self->file changes. */
-void dvdnav_read_cache_clear(dvdnav_t *self);
+void dvdnav_read_cache_clear(read_cache_t *self);
 /* This function is called just after reading the NAV packet. */
-void dvdnav_pre_cache_blocks(dvdnav_t *self, int sector, size_t block_count);
+void dvdnav_pre_cache_blocks(read_cache_t *self, int sector, size_t block_count);
 /* This function will do the cache read */
-int dvdnav_read_cache_block(dvdnav_t *self, int sector, size_t block_count, uint8_t *buf);
+int dvdnav_read_cache_block(read_cache_t *self, int sector, size_t block_count, uint8_t *buf);
 
 #endif /* __DVDNAV_READ_CACHE_H */