00001 #ifndef STREAMINGRINGBUFFER_H 00002 #define STREAMINGRINGBUFFER_H 00003 00004 #include "ringbuffer.h" 00005 00006 extern "C" { 00007 #include "libavformat/avformat.h" 00008 #include "libavformat/url.h" 00009 } 00010 00011 class StreamingRingBuffer : public RingBuffer 00012 { 00013 public: 00014 StreamingRingBuffer(const QString &lfilename); 00015 virtual ~StreamingRingBuffer(); 00016 00017 virtual bool IsOpen(void) const; 00018 virtual long long GetReadPosition(void) const; 00019 virtual bool OpenFile(const QString &lfilename, 00020 uint retry_ms = kDefaultOpenTimeout); 00021 virtual long long Seek(long long pos, int whence, bool has_lock); 00022 virtual long long GetRealFileSize(void) const; 00023 virtual bool IsStreamed(void) { return m_streamed; } 00024 virtual bool IsSeekingAllowed(void) { return m_allowSeeks; } 00025 virtual bool IsBookmarkAllowed(void) { return false; } 00026 00027 protected: 00028 virtual int safe_read(void *data, uint sz); 00029 00030 private: 00031 URLContext *m_context; 00032 bool m_streamed; 00033 bool m_allowSeeks; 00034 }; 00035 00036 #endif // STREAMINGRINGBUFFER_H
1.6.3