33 lines
No EOL
956 B
C++
33 lines
No EOL
956 B
C++
#ifndef MKVP_IMKVREADER_HPP
|
|
#define MKVP_IMKVREADER_HPP
|
|
|
|
#include <cstring>
|
|
|
|
namespace mkvparser
|
|
{
|
|
|
|
const int E_FILE_FORMAT_INVALID = -2;
|
|
const int E_BUFFER_NOT_FULL = -3;
|
|
|
|
class IMkvReader
|
|
{
|
|
public:
|
|
// standard read, the result of the read is copied the given buffer (_buf)
|
|
virtual int Read(long long _pos, long _len, unsigned char* _buf) = 0;
|
|
virtual int Length(long long* _total, long long* _available) = 0;
|
|
|
|
// lock read - used for copyless reads (Frame data for example)
|
|
// begin/end must be done in pairs
|
|
// Begin - returns a buffer which contains data of length _len at file position _pos
|
|
virtual int BeginLockRead(long long _pos, long _len, const unsigned char*& _buf) = 0;
|
|
// _buf value must be the value returned by Begin (for error detection purposes)
|
|
virtual int EndLockRead(const unsigned char* _buf) = 0;
|
|
|
|
protected:
|
|
virtual ~IMkvReader() {}
|
|
};
|
|
|
|
|
|
} // namespace mkvparser
|
|
|
|
#endif // MKVP_IMKVREADER_HPP
|