/
icringbuffer.h
40 lines (31 loc) · 1.08 KB
/
icringbuffer.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#ifndef ICRINGBUFFER_H
#define ICRINGBUFFER_H
#include "ringbuffer.h"
class NetStream;
class ICRingBuffer : public RingBuffer
{
public:
static enum RingBufferType const kRingBufferType = kRingBuffer_MHEG;
ICRingBuffer(const QString &url, RingBuffer *parent = 0);
virtual ~ICRingBuffer();
// RingBuffer implementation
virtual bool IsOpen(void) const;
virtual long long GetReadPosition(void) const;
virtual bool OpenFile(const QString &url,
uint retry_ms = kDefaultOpenTimeout);
virtual long long Seek(long long pos, int whence, bool has_lock);
virtual long long GetRealFileSize(void) const;
virtual bool IsStreamed(void) { return false; }
virtual bool IsSeekingAllowed(void) { return true; }
virtual bool IsBookmarkAllowed(void) { return false; }
protected:
virtual int safe_read(void *data, uint sz);
// Operations
public:
// Take ownership of parent RingBuffer
RingBuffer *Take();
private:
NetStream *m_stream;
RingBuffer *m_parent; // parent RingBuffer
};
#endif // ICRINGBUFFER_H