projects
/
vuplus_dvbapp
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[browser] add exception handling.
[vuplus_dvbapp]
/
lib
/
base
/
rawfile.h
diff --git
a/lib/base/rawfile.h
b/lib/base/rawfile.h
index
859f10b
..
7b736a3
100644
(file)
--- a/
lib/base/rawfile.h
+++ b/
lib/base/rawfile.h
@@
-2,24
+2,27
@@
#define __lib_base_rawfile_h
#include <string>
#define __lib_base_rawfile_h
#include <string>
+#include <lib/base/itssource.h>
-class eRawFile
+class eRawFile
: public iTsSource
{
{
+ DECLARE_REF(eRawFile);
+ eSingleLock m_lock;
public:
eRawFile();
~eRawFile();
public:
eRawFile();
~eRawFile();
-
int open(const char *filename, int cached = 0);
void setfd(int fd);
int open(const char *filename, int cached = 0);
void setfd(int fd);
- off_t lseek(off_t offset, int whence);
int close();
int close();
- ssize_t read(void *buf, size_t count); /* NOTE: you must be able to handle short reads! */
+
+ // iTsSource
+ off_t lseek(off_t offset, int whence);
+ ssize_t read(off_t offset, void *buf, size_t count);
off_t length();
int valid();
private:
int m_fd; /* for uncached */
FILE *m_file; /* for cached */
off_t length();
int valid();
private:
int m_fd; /* for uncached */
FILE *m_file; /* for cached */
-
int m_cached;
std::string m_basename;
off_t m_splitsize, m_totallength, m_current_offset, m_base_offset, m_last_offset;
int m_cached;
std::string m_basename;
off_t m_splitsize, m_totallength, m_current_offset, m_base_offset, m_last_offset;
@@
-27,7
+30,10
@@
private:
void scan();
int m_current_file;
int switchOffset(off_t off);
void scan();
int m_current_file;
int switchOffset(off_t off);
- int openFile(int nr);
+
+ off_t lseek_internal(off_t offset, int whence);
+ FILE *openFileCached(int nr);
+ int openFileUncached(int nr);
};
#endif
};
#endif