MythTV  master
mythmediabuffer.h
Go to the documentation of this file.
1 #ifndef MYTHMEDIABUFFER_H
2 #define MYTHMEDIABUFFER_H
3 
4 // Qt
5 #include <QReadWriteLock>
6 #include <QWaitCondition>
7 #include <QString>
8 #include <QMutex>
9 #include <QMap>
10 
11 // MythTV
12 #include "mythtvexp.h"
13 #include "mythconfig.h"
14 #include "mthread.h"
15 
16 // FFmpeg
17 extern "C" {
18 #include "libavcodec/avcodec.h"
19 }
20 
21 // Size of PNG header plus one empty chunk
22 #define kReadTestSize 20
23 
24 // about one second at 35Mb
25 #define BUFFER_SIZE_MINIMUM (4 * 1024 * 1024)
26 #define BUFFER_FACTOR_NETWORK 2
27 #define BUFFER_FACTOR_BITRATE 2
28 #define BUFFER_FACTOR_MATROSKA 2
29 
30 #define DEFAULT_CHUNK_SIZE 32768
31 
32 class ThreadedFileWriter;
33 class MythDVDBuffer;
34 class MythBDBuffer;
35 class LiveTVChain;
36 class RemoteFile;
37 
39 {
47 };
48 
50 {
51  friend class MythInteractiveBuffer;
52 
53  public:
54  static MythMediaBuffer *Create(const QString &Filename, bool Write,
55  bool UseReadAhead = true,
56  int Timeout = kDefaultOpenTimeout,
57  bool StreamOnly = false);
58  ~MythMediaBuffer() override = 0;
59  MythBufferType GetType() const;
60 
61  static const int kDefaultOpenTimeout;
62  static const int kLiveTVOpenTimeout;
63  static QString BitrateToString (uint64_t Rate, bool Hz = false);
64  static void AVFormatInitNetwork (void);
65 
66  void SetOldFile (bool Old);
67  void UpdateRawBitrate (uint RawBitrate);
68  void UpdatePlaySpeed (float PlaySpeed);
69  void EnableBitrateMonitor (bool Enable);
70  void SetBufferSizeFactors (bool EstBitrate, bool Matroska);
71  void SetWaitForWrite (void);
72  QString GetSafeFilename (void);
73  QString GetFilename (void) const;
74  QString GetSubtitleFilename (void) const;
75  QString GetLastError (void) const;
76  bool GetCommsError (void) const;
77  void ResetCommsError (void);
78  bool GetStopReads (void) const;
79  QString GetDecoderRate (void);
80  QString GetStorageRate (void);
81  QString GetAvailableBuffer (void);
82  uint GetBufferSize (void) const;
83  bool IsNearEnd (double Framerate, uint Frames) const;
84  long long GetWritePosition (void) const;
85  long long GetRealFileSize (void) const;
86  bool IsDisc (void) const;
87  bool IsDVD (void) const;
88  bool IsBD (void) const;
89  const MythDVDBuffer *DVD (void) const;
90  MythDVDBuffer *DVD (void);
91  const MythBDBuffer *BD (void) const;
92  MythBDBuffer *BD (void);
93  int Read (void *Buffer, int Count);
94  int Peek (void *Buffer, int Count);
95  void Reset (bool Full = false, bool ToAdjust = false, bool ResetInternal = false);
96  void Pause (void);
97  void Unpause (void);
98  void WaitForPause (void);
99  void Start (void);
100  void StopReads (void);
101  void StartReads (void);
102  long long Seek (long long Position, int Whence, bool HasLock = false);
103  long long SetAdjustFilesize (void);
104 
105  // LiveTV used utilities
106  int GetReadBufAvail (void) const;
107  bool SetReadInternalMode (bool Mode);
108  bool IsReadInternalMode (void) const;
109  bool LiveMode (void) const;
110  void SetLiveMode (LiveTVChain *Chain);
111  void IgnoreLiveEOF (bool Ignore);
112 
113  // ThreadedFileWriter proxies
114  int Write (const void *Buffer, uint Count);
115  bool IsIOBound (void) const;
116  void WriterFlush (void);
117  void Sync (void);
118  long long WriterSeek (long long Position, int Whence, bool HasLock = false);
119  bool WriterSetBlocking (bool Lock = true);
120 
121  virtual long long GetReadPosition (void) const = 0;
122  virtual bool IsOpen (void) const = 0;
123  virtual bool IsStreamed (void) { return LiveMode(); }
124  virtual bool IsSeekingAllowed (void) { return true; }
125  virtual bool IsBookmarkAllowed (void) { return true; }
126  virtual int BestBufferSize (void) { return DEFAULT_CHUNK_SIZE; }
127  virtual bool StartFromBeginning(void) { return true; }
128  virtual void IgnoreWaitStates (bool /*Ignore*/) { }
129  virtual bool IsInMenu (void) const { return false; }
130  virtual bool IsInStillFrame (void) const { return false; }
131  virtual bool IsInDiscMenuOrStillFrame(void) const { return IsInMenu() || IsInStillFrame(); }
132  virtual bool HandleAction (const QStringList &/*Action*/, int64_t /*Frame*/) { return false; }
133  virtual bool OpenFile (const QString &Filename, uint Retry = static_cast<uint>(kDefaultOpenTimeout)) = 0;
134  virtual bool ReOpen (const QString& /*Filename*/ = "") { return false; }
135 
136  protected:
137  explicit MythMediaBuffer(MythBufferType Type);
138 
139  void run(void) override;
140  void CreateReadAheadBuffer (void);
141  void CalcReadAheadThresh (void);
142  bool PauseAndWait (void);
143  int ReadPriv (void *Buffer, int Count, bool Peek);
144  int ReadDirect (void *Buffer, int Count, bool Peek);
145  bool WaitForReadsAllowed (void);
146  int WaitForAvail (int Count, int Timeout);
147  int ReadBufFree (void) const;
148  int ReadBufAvail (void) const;
149  void ResetReadAhead (long long NewInternal);
150  void KillReadAheadThread (void);
151  uint64_t UpdateDecoderRate (uint64_t Latest = 0);
152  uint64_t UpdateStorageRate (uint64_t Latest = 0);
153 
154  virtual int SafeRead (void *Buffer, uint Size) = 0;
155  virtual long long GetRealFileSizeInternal(void) const { return -1; }
156  virtual long long SeekInternal (long long Position, int Whence) = 0;
157 
158 
159  protected:
161 
162  mutable QReadWriteLock m_posLock;
163  long long m_readPos { 0 };
164  long long m_writePos { 0 };
165  long long m_internalReadPos { 0 };
166  long long m_ignoreReadPos { -1 };
167 
168  mutable QReadWriteLock m_rbrLock;
169  int m_rbrPos { 0 };
170 
171  mutable QReadWriteLock m_rbwLock;
172  int m_rbwPos { 0 };
173 
174  // note should not go under rwLock..
175  // this is used to break out of read_safe where rwLock is held
176  volatile bool m_stopReads {false};
177 
178  // unprotected (for debugging)
179  QString m_safeFilename;
180 
181  mutable QReadWriteLock m_rwLock;
182  QString m_filename;
184  QString m_lastError;
185  ThreadedFileWriter *m_tfw { nullptr };
186  int m_fd2 { -1 };
187  bool m_writeMode { false };
188  RemoteFile *m_remotefile { nullptr };
190  bool m_lowBuffers { false };
191  bool m_fileIsMatroska { false };
192  bool m_unknownBitrate { false };
193  bool m_startReadAhead { false };
194  char *m_readAheadBuffer { nullptr };
195  bool m_readAheadRunning { false };
196  bool m_reallyRunning { false };
197  bool m_requestPause { false };
198  bool m_paused { false };
199  bool m_ateof { false };
200  bool m_waitForWrite { false };
201  bool m_beingWritten { false };
202  bool m_readsAllowed { false };
203  bool m_readsDesired { false };
204  volatile bool m_recentSeek { true }; // not protected by rwLock
205  bool m_setSwitchToNext { false };
206  uint m_rawBitrate { 8000 };
207  float m_playSpeed { 1.0F };
208  int m_fillThreshold { 65536 };
209  int m_fillMin { -1 };
211  int m_wantToRead { 0 };
212  int m_numFailures { 0 }; // (see note 1)
213  bool m_commsError { false };
214  bool m_oldfile { false };
216  bool m_ignoreLiveEOF { false };
217  long long m_readAdjust { 0 };
218  int m_readOffset { 0 };
219  bool m_readInternalMode { false };
220  // End of section protected by rwLock
221 
222  bool m_bitrateMonitorEnabled { false };
224  QMap<qint64, uint64_t> m_decoderReads;
226  QMap<qint64, uint64_t> m_storageReads;
227 
228  // note 1: numfailures is modified with only a read lock in the
229  // read ahead thread, but this is safe since all other places
230  // that use it are protected by a write lock. But this is a
231  // fragile state of affairs and care must be taken when modifying
232  // code or locking around this variable.
233 
235  QWaitCondition m_generalWait; // protected by rwLock
236 
237  public:
238  static QMutex s_subExtLock;
239  static QStringList s_subExt;
240  static QStringList s_subExtNoCheck;
241 
242  private:
243  bool m_bitrateInitialized { false };
244 };
245 #endif
MythMediaBuffer::OpenFile
virtual bool OpenFile(const QString &Filename, uint Retry=static_cast< uint >(kDefaultOpenTimeout))=0
MythMediaBuffer::BD
const MythBDBuffer * BD(void) const
Definition: mythmediabuffer.cpp:1854
BUFFER_SIZE_MINIMUM
#define BUFFER_SIZE_MINIMUM
Definition: mythmediabuffer.h:25
MythMediaBuffer::SafeRead
virtual int SafeRead(void *Buffer, uint Size)=0
MythMediaBuffer::BestBufferSize
virtual int BestBufferSize(void)
Definition: mythmediabuffer.h:126
MythMediaBuffer::m_tfw
ThreadedFileWriter * m_tfw
Definition: mythmediabuffer.h:185
MythMediaBuffer::SetBufferSizeFactors
void SetBufferSizeFactors(bool EstBitrate, bool Matroska)
Tells RingBuffer that the raw bitrate may be inaccurate and the underlying container is matroska,...
Definition: mythmediabuffer.cpp:352
MythMediaBuffer::PauseAndWait
bool PauseAndWait(void)
Definition: mythmediabuffer.cpp:750
GetBufferSize
static size_t GetBufferSize(VideoFrameType Type, int Width, int Height, int Aligned=MYTH_WIDTH_ALIGNMENT)
Definition: mythframe.h:658
MythMediaBuffer::m_rbrPos
int m_rbrPos
Definition: mythmediabuffer.h:169
MythMediaBuffer::m_readAdjust
long long m_readAdjust
Definition: mythmediabuffer.h:217
MythMediaBuffer::ReOpen
virtual bool ReOpen(const QString &="")
Definition: mythmediabuffer.h:134
MythMediaBuffer::m_startReadAhead
bool m_startReadAhead
Definition: mythmediabuffer.h:193
MythMediaBuffer::Seek
long long Seek(long long Position, int Whence, bool HasLock=false)
Definition: mythmediabuffer.cpp:496
MythMediaBuffer::StopReads
void StopReads(void)
Definition: mythmediabuffer.cpp:686
MythMediaBuffer::UpdatePlaySpeed
void UpdatePlaySpeed(float PlaySpeed)
Set the play speed, to allow RingBuffer adjust effective bitrate.
Definition: mythmediabuffer.cpp:329
MythMediaBuffer::s_subExtNoCheck
static QStringList s_subExtNoCheck
Definition: mythmediabuffer.h:240
MythMediaBuffer::m_commsError
bool m_commsError
Definition: mythmediabuffer.h:213
MythMediaBuffer::m_oldfile
bool m_oldfile
Definition: mythmediabuffer.h:214
MythMediaBuffer::Create
static MythMediaBuffer * Create(const QString &Filename, bool Write, bool UseReadAhead=true, int Timeout=kDefaultOpenTimeout, bool StreamOnly=false)
Creates a RingBuffer instance.
Definition: mythmediabuffer.cpp:104
MythMediaBuffer::EnableBitrateMonitor
void EnableBitrateMonitor(bool Enable)
Definition: mythmediabuffer.cpp:337
kMythBufferDVD
@ kMythBufferDVD
Definition: mythmediabuffer.h:42
MythMediaBuffer::WriterSetBlocking
bool WriterSetBlocking(bool Lock=true)
Calls ThreadedFileWriter::SetBlocking(bool)
Definition: mythmediabuffer.cpp:1717
mythtvexp.h
MythMediaBuffer::GetWritePosition
long long GetWritePosition(void) const
Returns how far into a ThreadedFileWriter file we have written.
Definition: mythmediabuffer.cpp:1795
MythMediaBuffer::m_storageReads
QMap< qint64, uint64_t > m_storageReads
Definition: mythmediabuffer.h:226
MythMediaBuffer::m_fd2
int m_fd2
Definition: mythmediabuffer.h:186
MythMediaBuffer::m_safeFilename
QString m_safeFilename
Definition: mythmediabuffer.h:179
MythMediaBuffer::GetDecoderRate
QString GetDecoderRate(void)
Definition: mythmediabuffer.cpp:1542
MythMediaBuffer::CalcReadAheadThresh
void CalcReadAheadThresh(void)
Calculates m_fillMin, m_fillThreshold, and m_readBlockSize from the estimated effective bitrate of th...
Definition: mythmediabuffer.cpp:368
MythMediaBuffer::m_type
MythBufferType m_type
Definition: mythmediabuffer.h:160
kMythBufferBD
@ kMythBufferBD
Definition: mythmediabuffer.h:43
MythMediaBuffer::ReadDirect
int ReadDirect(void *Buffer, int Count, bool Peek)
Definition: mythmediabuffer.cpp:1265
RemoteFile
Definition: remotefile.h:18
MythMediaBuffer::Write
int Write(const void *Buffer, uint Count)
Writes buffer to ThreadedFileWriter::Write(const void*,uint)
Definition: mythmediabuffer.cpp:1633
MythMediaBuffer::m_readOffset
int m_readOffset
Definition: mythmediabuffer.h:218
MythMediaBuffer
Definition: mythmediabuffer.h:50
MythMediaBuffer::IgnoreWaitStates
virtual void IgnoreWaitStates(bool)
Definition: mythmediabuffer.h:128
MythMediaBuffer::IsDVD
bool IsDVD(void) const
Definition: mythmediabuffer.cpp:1839
MythMediaBuffer::Unpause
void Unpause(void)
Unpauses the read-ahead thread. Calls StartReads(void).
Definition: mythmediabuffer.cpp:721
MythMediaBuffer::GetSafeFilename
QString GetSafeFilename(void)
Definition: mythmediabuffer.cpp:1756
MythMediaBuffer::GetReadBufAvail
int GetReadBufAvail(void) const
Returns number of bytes available for reading from buffer.
Definition: mythmediabuffer.cpp:479
MythMediaBuffer::m_lastError
QString m_lastError
Definition: mythmediabuffer.h:184
MythMediaBuffer::m_generalWait
QWaitCondition m_generalWait
Condition to signal that the read ahead thread is running.
Definition: mythmediabuffer.h:235
MythMediaBuffer::kDefaultOpenTimeout
static const int kDefaultOpenTimeout
Definition: mythmediabuffer.h:61
MythMediaBuffer::ReadBufFree
int ReadBufFree(void) const
Returns number of bytes available for reading into buffer.
Definition: mythmediabuffer.cpp:468
MythMediaBuffer::IsBD
bool IsBD(void) const
Definition: mythmediabuffer.cpp:1844
MythMediaBuffer::SetAdjustFilesize
long long SetAdjustFilesize(void)
Definition: mythmediabuffer.cpp:1179
MythMediaBuffer::IsInMenu
virtual bool IsInMenu(void) const
Definition: mythmediabuffer.h:129
MythBufferType
MythBufferType
Definition: mythmediabuffer.h:39
MythMediaBuffer::WaitForReadsAllowed
bool WaitForReadsAllowed(void)
Definition: mythmediabuffer.cpp:1202
MythMediaBuffer::UpdateRawBitrate
void UpdateRawBitrate(uint RawBitrate)
Set the raw bit rate, to allow RingBuffer adjust effective bitrate.
Definition: mythmediabuffer.cpp:301
kMythBufferHLS
@ kMythBufferHLS
Definition: mythmediabuffer.h:45
MythMediaBuffer::StartFromBeginning
virtual bool StartFromBeginning(void)
Definition: mythmediabuffer.h:127
MythMediaBuffer::BitrateToString
static QString BitrateToString(uint64_t Rate, bool Hz=false)
Definition: mythmediabuffer.cpp:1509
MythMediaBuffer::m_paused
bool m_paused
Definition: mythmediabuffer.h:198
MythMediaBuffer::m_decoderReadLock
QMutex m_decoderReadLock
Definition: mythmediabuffer.h:223
MythMediaBuffer::m_readsAllowed
bool m_readsAllowed
Definition: mythmediabuffer.h:202
MythMediaBuffer::GetStopReads
bool GetStopReads(void) const
Definition: mythmediabuffer.cpp:1787
MythMediaBuffer::s_subExtLock
static QMutex s_subExtLock
Definition: mythmediabuffer.h:238
MythMediaBuffer::m_rawBitrate
uint m_rawBitrate
Definition: mythmediabuffer.h:206
MythMediaBuffer::ReadPriv
int ReadPriv(void *Buffer, int Count, bool Peek)
When possible reads from the read-ahead buffer, otherwise reads directly from the device.
Definition: mythmediabuffer.cpp:1340
MythMediaBuffer::m_liveTVChain
LiveTVChain * m_liveTVChain
Definition: mythmediabuffer.h:215
MythMediaBuffer::GetFilename
QString GetFilename(void) const
Definition: mythmediabuffer.cpp:1748
MythMediaBuffer::GetRealFileSize
long long GetRealFileSize(void) const
Definition: mythmediabuffer.cpp:485
MythMediaBuffer::SetOldFile
void SetOldFile(bool Old)
Tell RingBuffer if this is an old file or not.
Definition: mythmediabuffer.cpp:1740
MythMediaBuffer::m_readPos
long long m_readPos
Definition: mythmediabuffer.h:163
MythMediaBuffer::m_beingWritten
bool m_beingWritten
Definition: mythmediabuffer.h:201
kMythBufferUnknown
@ kMythBufferUnknown
Definition: mythmediabuffer.h:40
MythMediaBuffer::SeekInternal
virtual long long SeekInternal(long long Position, int Whence)=0
MythMediaBuffer::WaitForPause
void WaitForPause(void)
Waits for Pause(void) to take effect.
Definition: mythmediabuffer.cpp:735
MythMediaBuffer::IsInDiscMenuOrStillFrame
virtual bool IsInDiscMenuOrStillFrame(void) const
Definition: mythmediabuffer.h:131
MythMediaBuffer::WriterSeek
long long WriterSeek(long long Position, int Whence, bool HasLock=false)
Calls ThreadedFileWriter::Seek(long long,int).
Definition: mythmediabuffer.cpp:1680
MythMediaBuffer::m_requestPause
bool m_requestPause
Definition: mythmediabuffer.h:197
MythMediaBuffer::m_readInternalMode
bool m_readInternalMode
Definition: mythmediabuffer.h:219
MythMediaBuffer::~MythMediaBuffer
~MythMediaBuffer() override=0
Deletes.
Definition: mythmediabuffer.cpp:241
MythMediaBuffer::GetSubtitleFilename
QString GetSubtitleFilename(void) const
Definition: mythmediabuffer.cpp:1761
MythMediaBuffer::m_remotefile
RemoteFile * m_remotefile
Definition: mythmediabuffer.h:188
MythMediaBuffer::UpdateStorageRate
uint64_t UpdateStorageRate(uint64_t Latest=0)
Definition: mythmediabuffer.cpp:1598
MythMediaBuffer::ResetCommsError
void ResetCommsError(void)
Definition: mythmediabuffer.cpp:1782
MythMediaBuffer::IsIOBound
bool IsIOBound(void) const
MythMediaBuffer::m_writePos
long long m_writePos
Definition: mythmediabuffer.h:164
MythMediaBuffer::m_readBlockSize
int m_readBlockSize
Definition: mythmediabuffer.h:210
MythMediaBuffer::m_rbwLock
QReadWriteLock m_rbwLock
Definition: mythmediabuffer.h:171
MythMediaBuffer::GetCommsError
bool GetCommsError(void) const
Definition: mythmediabuffer.cpp:1777
MythMediaBuffer::m_waitForWrite
bool m_waitForWrite
Definition: mythmediabuffer.h:200
MythBDBuffer
Definition: mythbdbuffer.h:21
MythMediaBuffer::m_setSwitchToNext
bool m_setSwitchToNext
Definition: mythmediabuffer.h:205
DEFAULT_CHUNK_SIZE
#define DEFAULT_CHUNK_SIZE
Definition: mythmediabuffer.h:30
kMythBufferHTTP
@ kMythBufferHTTP
Definition: mythmediabuffer.h:44
MythMediaBuffer::m_readAheadBuffer
char * m_readAheadBuffer
Definition: mythmediabuffer.h:194
kMythBufferMHEG
@ kMythBufferMHEG
Definition: mythmediabuffer.h:46
MythMediaBuffer::m_numFailures
int m_numFailures
Definition: mythmediabuffer.h:212
MythMediaBuffer::m_bufferSize
uint m_bufferSize
Definition: mythmediabuffer.h:189
MythMediaBuffer::LiveMode
bool LiveMode(void) const
Returns true if this RingBuffer has been assigned a LiveTVChain.
Definition: mythmediabuffer.cpp:1807
MythMediaBuffer::m_lowBuffers
bool m_lowBuffers
Definition: mythmediabuffer.h:190
MythMediaBuffer::m_fillThreshold
int m_fillThreshold
Definition: mythmediabuffer.h:208
uint
unsigned int uint
Definition: compat.h:140
MythMediaBuffer::m_filename
QString m_filename
Definition: mythmediabuffer.h:182
MThread::run
virtual void run(void)
Runs the Qt event loop unless we have a QRunnable, in which case we run the runnable run instead.
Definition: mthread.cpp:316
MythMediaBuffer::CreateReadAheadBuffer
void CreateReadAheadBuffer(void)
Definition: mythmediabuffer.cpp:793
MythMediaBuffer::IgnoreLiveEOF
void IgnoreLiveEOF(bool Ignore)
Tells RingBuffer whether to ignore the end-of-file.
Definition: mythmediabuffer.cpp:1827
MythMediaBuffer::Read
int Read(void *Buffer, int Count)
This is the public method for reading from a file, it calls the appropriate read method if the file i...
Definition: mythmediabuffer.cpp:1495
ThreadedFileWriter
This class supports the writing of recordings to disk.
Definition: threadedfilewriter.h:44
MTV_PUBLIC
#define MTV_PUBLIC
Definition: mythtvexp.h:15
MythMediaBuffer::IsReadInternalMode
bool IsReadInternalMode(void) const
Definition: mythmediabuffer.cpp:565
MythMediaBuffer::m_rbrLock
QReadWriteLock m_rbrLock
Definition: mythmediabuffer.h:168
MythMediaBuffer::m_readsDesired
bool m_readsDesired
Definition: mythmediabuffer.h:203
MythMediaBuffer::WriterFlush
void WriterFlush(void)
Calls ThreadedFileWriter::Flush(void)
Definition: mythmediabuffer.cpp:1706
MythMediaBuffer::KillReadAheadThread
void KillReadAheadThread(void)
Stops the read-ahead thread, and waits for it to stop.
Definition: mythmediabuffer.cpp:670
MythMediaBuffer::AVFormatInitNetwork
static void AVFormatInitNetwork(void)
Definition: mythmediabuffer.cpp:1869
MythMediaBuffer::s_subExt
static QStringList s_subExt
Definition: mythmediabuffer.h:239
MythMediaBuffer::IsBookmarkAllowed
virtual bool IsBookmarkAllowed(void)
Definition: mythmediabuffer.h:125
MythMediaBuffer::m_playSpeed
float m_playSpeed
Definition: mythmediabuffer.h:207
Buffer
Definition: MythExternControl.h:37
MythMediaBuffer::m_recentSeek
volatile bool m_recentSeek
Definition: mythmediabuffer.h:204
MythMediaBuffer::m_ignoreLiveEOF
bool m_ignoreLiveEOF
Definition: mythmediabuffer.h:216
MythMediaBuffer::m_storageReadLock
QMutex m_storageReadLock
Definition: mythmediabuffer.h:225
MythMediaBuffer::m_unknownBitrate
bool m_unknownBitrate
Definition: mythmediabuffer.h:192
MythMediaBuffer::HandleAction
virtual bool HandleAction(const QStringList &, int64_t)
Definition: mythmediabuffer.h:132
MythMediaBuffer::ResetReadAhead
void ResetReadAhead(long long NewInternal)
Restart the read-ahead thread at the 'newinternal' position.
Definition: mythmediabuffer.cpp:592
MythMediaBuffer::IsInStillFrame
virtual bool IsInStillFrame(void) const
Definition: mythmediabuffer.h:130
MythMediaBuffer::MythMediaBuffer
MythMediaBuffer(MythBufferType Type)
Definition: mythmediabuffer.cpp:203
MythMediaBuffer::SetReadInternalMode
bool SetReadInternalMode(bool Mode)
Definition: mythmediabuffer.cpp:540
MythMediaBuffer::m_fileIsMatroska
bool m_fileIsMatroska
Definition: mythmediabuffer.h:191
MythMediaBuffer::m_wantToRead
int m_wantToRead
Definition: mythmediabuffer.h:211
MythMediaBuffer::GetRealFileSizeInternal
virtual long long GetRealFileSizeInternal(void) const
Definition: mythmediabuffer.h:155
MythMediaBuffer::IsDisc
bool IsDisc(void) const
Definition: mythmediabuffer.cpp:1834
MythMediaBuffer::GetReadPosition
virtual long long GetReadPosition(void) const =0
MythMediaBuffer::Start
void Start(void)
Starts the read-ahead thread.
Definition: mythmediabuffer.cpp:634
MThread
This is a wrapper around QThread that does several additional things.
Definition: mthread.h:49
MythMediaBuffer::GetAvailableBuffer
QString GetAvailableBuffer(void)
Definition: mythmediabuffer.cpp:1552
mthread.h
MythMediaBuffer::kLiveTVOpenTimeout
static const int kLiveTVOpenTimeout
Definition: mythmediabuffer.h:62
MythInteractiveBuffer
Definition: mythinteractivebuffer.h:10
MythMediaBuffer::ReadBufAvail
int ReadBufAvail(void) const
Returns number of bytes available for reading from buffer.
Definition: mythmediabuffer.cpp:572
MythMediaBuffer::m_bitrateInitialized
bool m_bitrateInitialized
Definition: mythmediabuffer.h:243
MythMediaBuffer::GetLastError
QString GetLastError(void) const
Definition: mythmediabuffer.cpp:1769
kMythBufferFile
@ kMythBufferFile
Definition: mythmediabuffer.h:41
MythMediaBuffer::m_decoderReads
QMap< qint64, uint64_t > m_decoderReads
Definition: mythmediabuffer.h:224
MythMediaBuffer::m_reallyRunning
bool m_reallyRunning
Definition: mythmediabuffer.h:196
MythMediaBuffer::SetLiveMode
void SetLiveMode(LiveTVChain *Chain)
Assigns a LiveTVChain to this RingBuffer.
Definition: mythmediabuffer.cpp:1819
MythMediaBuffer::m_subtitleFilename
QString m_subtitleFilename
Definition: mythmediabuffer.h:183
MythMediaBuffer::m_writeMode
bool m_writeMode
Definition: mythmediabuffer.h:187
MythMediaBuffer::DVD
const MythDVDBuffer * DVD(void) const
Definition: mythmediabuffer.cpp:1849
MythMediaBuffer::m_posLock
QReadWriteLock m_posLock
Definition: mythmediabuffer.h:162
MythMediaBuffer::m_bitrateMonitorEnabled
bool m_bitrateMonitorEnabled
Definition: mythmediabuffer.h:222
MythMediaBuffer::Peek
int Peek(void *Buffer, int Count)
Definition: mythmediabuffer.cpp:1191
MythMediaBuffer::m_stopReads
volatile bool m_stopReads
Definition: mythmediabuffer.h:176
MythMediaBuffer::IsNearEnd
bool IsNearEnd(double Framerate, uint Frames) const
Definition: mythmediabuffer.cpp:429
MythMediaBuffer::IsStreamed
virtual bool IsStreamed(void)
Definition: mythmediabuffer.h:123
MythMediaBuffer::m_rwLock
QReadWriteLock m_rwLock
Definition: mythmediabuffer.h:181
MythMediaBuffer::StartReads
void StartReads(void)
Definition: mythmediabuffer.cpp:696
MythDVDBuffer
Definition: mythdvdbuffer.h:29
MythMediaBuffer::m_ateof
bool m_ateof
Definition: mythmediabuffer.h:199
MythMediaBuffer::IsSeekingAllowed
virtual bool IsSeekingAllowed(void)
Definition: mythmediabuffer.h:124
MythMediaBuffer::GetStorageRate
QString GetStorageRate(void)
Definition: mythmediabuffer.cpp:1547
MythMediaBuffer::UpdateDecoderRate
uint64_t UpdateDecoderRate(uint64_t Latest=0)
Definition: mythmediabuffer.cpp:1567
MythMediaBuffer::m_internalReadPos
long long m_internalReadPos
Definition: mythmediabuffer.h:165
MythMediaBuffer::WaitForAvail
int WaitForAvail(int Count, int Timeout)
Definition: mythmediabuffer.cpp:1230
MythMediaBuffer::Pause
void Pause(void)
Pauses the read-ahead thread. Calls StopReads(void).
Definition: mythmediabuffer.cpp:707
MythMediaBuffer::Sync
void Sync(void)
Calls ThreadedFileWriter::Sync(void)
Definition: mythmediabuffer.cpp:1670
MythMediaBuffer::m_rbwPos
int m_rbwPos
Definition: mythmediabuffer.h:172
MythMediaBuffer::m_ignoreReadPos
long long m_ignoreReadPos
Definition: mythmediabuffer.h:166
MythMediaBuffer::m_readAheadRunning
bool m_readAheadRunning
Definition: mythmediabuffer.h:195
MythMediaBuffer::Reset
void Reset(bool Full=false, bool ToAdjust=false, bool ResetInternal=false)
Resets the read-ahead thread and our position in the file.
Definition: mythmediabuffer.cpp:260
MythMediaBuffer::IsOpen
virtual bool IsOpen(void) const =0
MythMediaBuffer::GetType
MythBufferType GetType() const
Definition: mythmediabuffer.cpp:226
MythMediaBuffer::m_fillMin
int m_fillMin
Definition: mythmediabuffer.h:209
LiveTVChain
Keeps track of recordings in a current LiveTV instance.
Definition: livetvchain.h:32
MythMediaBuffer::SetWaitForWrite
void SetWaitForWrite(void)
Definition: mythmediabuffer.cpp:342