7 #ifndef PACKAGER_FILE_THREADED_IO_FILE_H_
8 #define PACKAGER_FILE_THREADED_IO_FILE_H_
10 #include "packager/base/memory/scoped_ptr.h"
11 #include "packager/base/synchronization/lock.h"
12 #include "packager/media/file/file.h"
13 #include "packager/media/file/file_closer.h"
14 #include "packager/media/file/io_cache.h"
16 namespace edash_packager {
31 uint64_t io_cache_size,
32 uint64_t io_block_size);
36 bool Close()
override;
37 int64_t
Read(
void* buffer, uint64_t length)
override;
38 int64_t
Write(
const void* buffer, uint64_t length)
override;
39 int64_t
Size()
override;
40 bool Flush()
override;
41 bool Seek(uint64_t position)
override;
42 bool Tell(uint64_t* position)
override;
50 void RunInInputMode();
51 void RunInOutputMode();
54 scoped_ptr<File, FileCloser> internal_file_;
57 std::vector<uint8_t> io_buffer_;
58 scoped_ptr<ClosureThread> thread_;
61 int64_t internal_file_error_;
69 #endif // PACKAGER_FILE_THREADED_IO_FILE_H