MythTV  master
mythstreamingbuffer.h
Go to the documentation of this file.
1 #ifndef STREAMINGRINGBUFFER_H
2 #define STREAMINGRINGBUFFER_H
3 
4 // MythTV
5 #include "io/mythmediabuffer.h"
6 
7 // FFmpeg
8 extern "C" {
9 #include "libavformat/avformat.h"
10 #include "libavformat/url.h"
11 }
12 
14 {
15  public:
16  explicit MythStreamingBuffer(const QString &Filename);
17  ~MythStreamingBuffer() override;
18 
19  bool IsOpen (void) const override;
20  long long GetReadPosition (void) const override;
21  bool OpenFile (const QString &Filename, std::chrono::milliseconds Retry = kDefaultOpenTimeout) override;
22  bool IsStreamed (void) override { return m_streamed; }
23  bool IsSeekingAllowed (void) override { return m_allowSeeks; }
24  bool IsBookmarkAllowed (void) override { return false; }
25 
26  protected:
27  int SafeRead (void *Buffer, uint Size) override;
28  long long GetRealFileSizeInternal(void) const override;
29  long long SeekInternal (long long Position, int Whence) override;
30 
31  private:
32  URLContext *m_context { nullptr };
33  bool m_streamed { true };
34  bool m_allowSeeks { false };
35 };
36 
37 #endif // STREAMINGRINGBUFFER_H
MythStreamingBuffer::GetRealFileSizeInternal
long long GetRealFileSizeInternal(void) const override
Definition: mythstreamingbuffer.cpp:128
MythStreamingBuffer::IsOpen
bool IsOpen(void) const override
Definition: mythstreamingbuffer.cpp:28
MythStreamingBuffer::m_allowSeeks
bool m_allowSeeks
Definition: mythstreamingbuffer.h:34
MythMediaBuffer
Definition: mythmediabuffer.h:50
MythStreamingBuffer::m_streamed
bool m_streamed
Definition: mythstreamingbuffer.h:33
MythStreamingBuffer::m_context
URLContext * m_context
Definition: mythstreamingbuffer.h:32
MythStreamingBuffer::SafeRead
int SafeRead(void *Buffer, uint Size) override
Definition: mythstreamingbuffer.cpp:103
MythStreamingBuffer::GetReadPosition
long long GetReadPosition(void) const override
Definition: mythstreamingbuffer.cpp:36
MythStreamingBuffer::~MythStreamingBuffer
~MythStreamingBuffer() override
Definition: mythstreamingbuffer.cpp:18
uint
unsigned int uint
Definition: compat.h:140
MythStreamingBuffer::OpenFile
bool OpenFile(const QString &Filename, std::chrono::milliseconds Retry=kDefaultOpenTimeout) override
Definition: mythstreamingbuffer.cpp:49
mythmediabuffer.h
Buffer
Definition: MythExternControl.h:36
MythStreamingBuffer
Definition: mythstreamingbuffer.h:13
MythStreamingBuffer::SeekInternal
long long SeekInternal(long long Position, int Whence) override
Definition: mythstreamingbuffer.cpp:86
MythStreamingBuffer::IsBookmarkAllowed
bool IsBookmarkAllowed(void) override
Definition: mythstreamingbuffer.h:24
MythStreamingBuffer::MythStreamingBuffer
MythStreamingBuffer(const QString &Filename)
Definition: mythstreamingbuffer.cpp:11
MythMediaBuffer::kDefaultOpenTimeout
static constexpr std::chrono::milliseconds kDefaultOpenTimeout
Definition: mythmediabuffer.h:62
MythStreamingBuffer::IsStreamed
bool IsStreamed(void) override
Definition: mythstreamingbuffer.h:22
MythStreamingBuffer::IsSeekingAllowed
bool IsSeekingAllowed(void) override
Definition: mythstreamingbuffer.h:23