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/base/synchronization/waitable_event.h"
13 #include "packager/media/file/file.h"
14 #include "packager/media/file/file_closer.h"
15 #include "packager/media/file/io_cache.h"
17 namespace edash_packager {
32 uint64_t io_cache_size,
33 uint64_t io_block_size);
37 bool Close()
override;
38 int64_t
Read(
void* buffer, uint64_t length)
override;
39 int64_t
Write(
const void* buffer, uint64_t length)
override;
40 int64_t
Size()
override;
41 bool Flush()
override;
42 bool Seek(uint64_t position)
override;
43 bool Tell(uint64_t* position)
override;
51 void RunInInputMode();
52 void RunInOutputMode();
55 scoped_ptr<File, FileCloser> internal_file_;
58 std::vector<uint8_t> io_buffer_;
59 scoped_ptr<ClosureThread> thread_;
63 base::WaitableEvent flush_complete_event_;
64 int64_t internal_file_error_;
72 #endif // PACKAGER_FILE_THREADED_IO_FILE_H