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  int Peek (std::vector<char>& Buffer);
96  void Reset (bool Full = false, bool ToAdjust = false, bool ResetInternal = false);
97  void Pause (void);
98  void Unpause (void);
99  void WaitForPause (void);
100  void Start (void);
101  void StopReads (void);
102  void StartReads (void);
103  long long Seek (long long Position, int Whence, bool HasLock = false);
104  long long SetAdjustFilesize (void);
105 
106  // LiveTV used utilities
107  int GetReadBufAvail (void) const;
108  bool SetReadInternalMode (bool Mode);
109  bool IsReadInternalMode (void) const;
110  bool LiveMode (void) const;
111  void SetLiveMode (LiveTVChain *Chain);
112  void IgnoreLiveEOF (bool Ignore);
113 
114  // ThreadedFileWriter proxies
115  int Write (const void *Buffer, uint Count);
116  bool IsIOBound (void) const;
117  void WriterFlush (void);
118  void Sync (void);
119  long long WriterSeek (long long Position, int Whence, bool HasLock = false);
120  bool WriterSetBlocking (bool Lock = true);
121 
122  virtual long long GetReadPosition (void) const = 0;
123  virtual bool IsOpen (void) const = 0;
124  virtual bool IsStreamed (void) { return LiveMode(); }
125  virtual bool IsSeekingAllowed (void) { return true; }
126  virtual bool IsBookmarkAllowed (void) { return true; }
127  virtual int BestBufferSize (void) { return DEFAULT_CHUNK_SIZE; }
128  virtual bool StartFromBeginning(void) { return true; }
129  virtual void IgnoreWaitStates (bool /*Ignore*/) { }
130  virtual bool IsInMenu (void) const { return false; }
131  virtual bool IsInStillFrame (void) const { return false; }
132  virtual bool IsInDiscMenuOrStillFrame(void) const { return IsInMenu() || IsInStillFrame(); }
133  virtual bool HandleAction (const QStringList &/*Action*/, int64_t /*Frame*/) { return false; }
134  virtual bool OpenFile (const QString &Filename, uint Retry = static_cast<uint>(kDefaultOpenTimeout)) = 0;
135  virtual bool ReOpen (const QString& /*Filename*/ = "") { return false; }
136 
137  protected:
138  explicit MythMediaBuffer(MythBufferType Type);
139 
140  void run(void) override;
141  void CreateReadAheadBuffer (void);
142  void CalcReadAheadThresh (void);
143  bool PauseAndWait (void);
144  int ReadPriv (void *Buffer, int Count, bool Peek);
145  int ReadDirect (void *Buffer, int Count, bool Peek);
146  bool WaitForReadsAllowed (void);
147  int WaitForAvail (int Count, int Timeout);
148  int ReadBufFree (void) const;
149  int ReadBufAvail (void) const;
150  void ResetReadAhead (long long NewInternal);
151  void KillReadAheadThread (void);
152  uint64_t UpdateDecoderRate (uint64_t Latest = 0);
153  uint64_t UpdateStorageRate (uint64_t Latest = 0);
154 
155  virtual int SafeRead (void *Buffer, uint Size) = 0;
156  virtual long long GetRealFileSizeInternal(void) const { return -1; }
157  virtual long long SeekInternal (long long Position, int Whence) = 0;
158 
159 
160  protected:
162 
163  mutable QReadWriteLock m_posLock;
164  long long m_readPos { 0 };
165  long long m_writePos { 0 };
166  long long m_internalReadPos { 0 };
167  long long m_ignoreReadPos { -1 };
168 
169  mutable QReadWriteLock m_rbrLock;
170  int m_rbrPos { 0 };
171 
172  mutable QReadWriteLock m_rbwLock;
173  int m_rbwPos { 0 };
174 
175  // note should not go under rwLock..
176  // this is used to break out of read_safe where rwLock is held
177  volatile bool m_stopReads {false};
178 
179  // unprotected (for debugging)
180  QString m_safeFilename;
181 
182  mutable QReadWriteLock m_rwLock;
183  QString m_filename;
185  QString m_lastError;
186  ThreadedFileWriter *m_tfw { nullptr };
187  int m_fd2 { -1 };
188  bool m_writeMode { false };
189  RemoteFile *m_remotefile { nullptr };
191  bool m_lowBuffers { false };
192  bool m_fileIsMatroska { false };
193  bool m_unknownBitrate { false };
194  bool m_startReadAhead { false };
195  char *m_readAheadBuffer { nullptr };
196  bool m_readAheadRunning { false };
197  bool m_reallyRunning { false };
198  bool m_requestPause { false };
199  bool m_paused { false };
200  bool m_ateof { false };
201  bool m_waitForWrite { false };
202  bool m_beingWritten { false };
203  bool m_readsAllowed { false };
204  bool m_readsDesired { false };
205  volatile bool m_recentSeek { true }; // not protected by rwLock
206  bool m_setSwitchToNext { false };
207  uint m_rawBitrate { 8000 };
208  float m_playSpeed { 1.0F };
209  int m_fillThreshold { 65536 };
210  int m_fillMin { -1 };
212  int m_wantToRead { 0 };
213  int m_numFailures { 0 }; // (see note 1)
214  bool m_commsError { false };
215  bool m_oldfile { false };
217  bool m_ignoreLiveEOF { false };
218  long long m_readAdjust { 0 };
219  int m_readOffset { 0 };
220  bool m_readInternalMode { false };
221  // End of section protected by rwLock
222 
223  bool m_bitrateMonitorEnabled { false };
225  QMap<qint64, uint64_t> m_decoderReads;
227  QMap<qint64, uint64_t> m_storageReads;
228 
229  // note 1: numfailures is modified with only a read lock in the
230  // read ahead thread, but this is safe since all other places
231  // that use it are protected by a write lock. But this is a
232  // fragile state of affairs and care must be taken when modifying
233  // code or locking around this variable.
234 
236  QWaitCondition m_generalWait; // protected by rwLock
237 
238  private:
239  bool m_bitrateInitialized { false };
240 };
241 #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:1838
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:127
MythMediaBuffer::m_tfw
ThreadedFileWriter * m_tfw
Definition: mythmediabuffer.h:186
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:331
MythMediaBuffer::PauseAndWait
bool PauseAndWait(void)
Definition: mythmediabuffer.cpp:729
MythMediaBuffer::m_rbrPos
int m_rbrPos
Definition: mythmediabuffer.h:170
MythMediaBuffer::m_readAdjust
long long m_readAdjust
Definition: mythmediabuffer.h:218
MythMediaBuffer::ReOpen
virtual bool ReOpen(const QString &="")
Definition: mythmediabuffer.h:135
MythMediaBuffer::m_startReadAhead
bool m_startReadAhead
Definition: mythmediabuffer.h:194
MythMediaBuffer::Seek
long long Seek(long long Position, int Whence, bool HasLock=false)
Definition: mythmediabuffer.cpp:475
MythMediaBuffer::StopReads
void StopReads(void)
Definition: mythmediabuffer.cpp:665
MythMediaBuffer::UpdatePlaySpeed
void UpdatePlaySpeed(float PlaySpeed)
Set the play speed, to allow RingBuffer adjust effective bitrate.
Definition: mythmediabuffer.cpp:308
MythMediaBuffer::m_commsError
bool m_commsError
Definition: mythmediabuffer.h:214
MythMediaBuffer::m_oldfile
bool m_oldfile
Definition: mythmediabuffer.h:215
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:100
MythMediaBuffer::EnableBitrateMonitor
void EnableBitrateMonitor(bool Enable)
Definition: mythmediabuffer.cpp:316
kMythBufferDVD
@ kMythBufferDVD
Definition: mythmediabuffer.h:42
MythMediaBuffer::WriterSetBlocking
bool WriterSetBlocking(bool Lock=true)
Calls ThreadedFileWriter::SetBlocking(bool)
Definition: mythmediabuffer.cpp:1701
mythtvexp.h
MythMediaBuffer::GetWritePosition
long long GetWritePosition(void) const
Returns how far into a ThreadedFileWriter file we have written.
Definition: mythmediabuffer.cpp:1779
MythMediaBuffer::m_storageReads
QMap< qint64, uint64_t > m_storageReads
Definition: mythmediabuffer.h:227
MythMediaBuffer::m_fd2
int m_fd2
Definition: mythmediabuffer.h:187
MythMediaBuffer::m_safeFilename
QString m_safeFilename
Definition: mythmediabuffer.h:180
MythMediaBuffer::GetDecoderRate
QString GetDecoderRate(void)
Definition: mythmediabuffer.cpp:1526
MythMediaBuffer::CalcReadAheadThresh
void CalcReadAheadThresh(void)
Calculates m_fillMin, m_fillThreshold, and m_readBlockSize from the estimated effective bitrate of th...
Definition: mythmediabuffer.cpp:347
MythMediaBuffer::m_type
MythBufferType m_type
Definition: mythmediabuffer.h:161
kMythBufferBD
@ kMythBufferBD
Definition: mythmediabuffer.h:43
MythMediaBuffer::ReadDirect
int ReadDirect(void *Buffer, int Count, bool Peek)
Definition: mythmediabuffer.cpp:1249
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:1617
MythMediaBuffer::m_readOffset
int m_readOffset
Definition: mythmediabuffer.h:219
MythMediaBuffer
Definition: mythmediabuffer.h:50
MythMediaBuffer::IgnoreWaitStates
virtual void IgnoreWaitStates(bool)
Definition: mythmediabuffer.h:129
MythMediaBuffer::IsDVD
bool IsDVD(void) const
Definition: mythmediabuffer.cpp:1823
MythMediaBuffer::Unpause
void Unpause(void)
Unpauses the read-ahead thread.
Definition: mythmediabuffer.cpp:700
MythMediaBuffer::GetSafeFilename
QString GetSafeFilename(void)
Definition: mythmediabuffer.cpp:1740
MythMediaBuffer::GetReadBufAvail
int GetReadBufAvail(void) const
Returns number of bytes available for reading from buffer.
Definition: mythmediabuffer.cpp:458
MythMediaBuffer::m_lastError
QString m_lastError
Definition: mythmediabuffer.h:185
MythMediaBuffer::m_generalWait
QWaitCondition m_generalWait
Condition to signal that the read ahead thread is running.
Definition: mythmediabuffer.h:236
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:447
MythMediaBuffer::IsBD
bool IsBD(void) const
Definition: mythmediabuffer.cpp:1828
MythMediaBuffer::SetAdjustFilesize
long long SetAdjustFilesize(void)
Definition: mythmediabuffer.cpp:1158
MythMediaBuffer::IsInMenu
virtual bool IsInMenu(void) const
Definition: mythmediabuffer.h:130
MythBufferType
MythBufferType
Definition: mythmediabuffer.h:39
MythMediaBuffer::WaitForReadsAllowed
bool WaitForReadsAllowed(void)
Definition: mythmediabuffer.cpp:1186
MythMediaBuffer::UpdateRawBitrate
void UpdateRawBitrate(uint RawBitrate)
Set the raw bit rate, to allow RingBuffer adjust effective bitrate.
Definition: mythmediabuffer.cpp:280
kMythBufferHLS
@ kMythBufferHLS
Definition: mythmediabuffer.h:45
MythMediaBuffer::StartFromBeginning
virtual bool StartFromBeginning(void)
Definition: mythmediabuffer.h:128
MythMediaBuffer::BitrateToString
static QString BitrateToString(uint64_t Rate, bool Hz=false)
Definition: mythmediabuffer.cpp:1493
MythMediaBuffer::m_paused
bool m_paused
Definition: mythmediabuffer.h:199
MythMediaBuffer::m_decoderReadLock
QMutex m_decoderReadLock
Definition: mythmediabuffer.h:224
MythMediaBuffer::m_readsAllowed
bool m_readsAllowed
Definition: mythmediabuffer.h:203
MythMediaBuffer::GetStopReads
bool GetStopReads(void) const
Definition: mythmediabuffer.cpp:1771
MythMediaBuffer::GetBufferSize
uint GetBufferSize(void) const
Definition: mythmediabuffer.cpp:1546
MythMediaBuffer::m_rawBitrate
uint m_rawBitrate
Definition: mythmediabuffer.h:207
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:1324
MythMediaBuffer::m_liveTVChain
LiveTVChain * m_liveTVChain
Definition: mythmediabuffer.h:216
MythMediaBuffer::GetFilename
QString GetFilename(void) const
Definition: mythmediabuffer.cpp:1732
MythMediaBuffer::GetRealFileSize
long long GetRealFileSize(void) const
Definition: mythmediabuffer.cpp:464
MythMediaBuffer::SetOldFile
void SetOldFile(bool Old)
Tell RingBuffer if this is an old file or not.
Definition: mythmediabuffer.cpp:1724
MythMediaBuffer::m_readPos
long long m_readPos
Definition: mythmediabuffer.h:164
MythMediaBuffer::m_beingWritten
bool m_beingWritten
Definition: mythmediabuffer.h:202
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:714
MythMediaBuffer::IsInDiscMenuOrStillFrame
virtual bool IsInDiscMenuOrStillFrame(void) const
Definition: mythmediabuffer.h:132
MythMediaBuffer::WriterSeek
long long WriterSeek(long long Position, int Whence, bool HasLock=false)
Calls ThreadedFileWriter::Seek(long long,int).
Definition: mythmediabuffer.cpp:1664
MythMediaBuffer::m_requestPause
bool m_requestPause
Definition: mythmediabuffer.h:198
MythMediaBuffer::m_readInternalMode
bool m_readInternalMode
Definition: mythmediabuffer.h:220
MythMediaBuffer::~MythMediaBuffer
~MythMediaBuffer() override=0
Deletes.
Definition: mythmediabuffer.cpp:220
MythMediaBuffer::GetSubtitleFilename
QString GetSubtitleFilename(void) const
Definition: mythmediabuffer.cpp:1745
MythMediaBuffer::m_remotefile
RemoteFile * m_remotefile
Definition: mythmediabuffer.h:189
MythMediaBuffer::UpdateStorageRate
uint64_t UpdateStorageRate(uint64_t Latest=0)
Definition: mythmediabuffer.cpp:1582
MythMediaBuffer::ResetCommsError
void ResetCommsError(void)
Definition: mythmediabuffer.cpp:1766
MythMediaBuffer::IsIOBound
bool IsIOBound(void) const
MythMediaBuffer::m_writePos
long long m_writePos
Definition: mythmediabuffer.h:165
MythMediaBuffer::m_readBlockSize
int m_readBlockSize
Definition: mythmediabuffer.h:211
MythMediaBuffer::m_rbwLock
QReadWriteLock m_rbwLock
Definition: mythmediabuffer.h:172
MythMediaBuffer::GetCommsError
bool GetCommsError(void) const
Definition: mythmediabuffer.cpp:1761
MythMediaBuffer::m_waitForWrite
bool m_waitForWrite
Definition: mythmediabuffer.h:201
MythBDBuffer
A class to allow a MythMediaBuffer to read from BDs.
Definition: mythbdbuffer.h:21
MythMediaBuffer::m_setSwitchToNext
bool m_setSwitchToNext
Definition: mythmediabuffer.h:206
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:195
kMythBufferMHEG
@ kMythBufferMHEG
Definition: mythmediabuffer.h:46
MythMediaBuffer::m_numFailures
int m_numFailures
Definition: mythmediabuffer.h:213
MythMediaBuffer::m_bufferSize
uint m_bufferSize
Definition: mythmediabuffer.h:190
MythMediaBuffer::LiveMode
bool LiveMode(void) const
Returns true if this RingBuffer has been assigned a LiveTVChain.
Definition: mythmediabuffer.cpp:1791
MythMediaBuffer::m_lowBuffers
bool m_lowBuffers
Definition: mythmediabuffer.h:191
MythMediaBuffer::m_fillThreshold
int m_fillThreshold
Definition: mythmediabuffer.h:209
uint
unsigned int uint
Definition: compat.h:140
MythMediaBuffer::m_filename
QString m_filename
Definition: mythmediabuffer.h:183
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:312
MythMediaBuffer::CreateReadAheadBuffer
void CreateReadAheadBuffer(void)
Definition: mythmediabuffer.cpp:772
MythMediaBuffer::IgnoreLiveEOF
void IgnoreLiveEOF(bool Ignore)
Tells RingBuffer whether to ignore the end-of-file.
Definition: mythmediabuffer.cpp:1811
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:1479
ThreadedFileWriter
This class supports the writing of recordings to disk.
Definition: threadedfilewriter.h:43
MTV_PUBLIC
#define MTV_PUBLIC
Definition: mythtvexp.h:15
MythMediaBuffer::IsReadInternalMode
bool IsReadInternalMode(void) const
Definition: mythmediabuffer.cpp:544
MythMediaBuffer::m_rbrLock
QReadWriteLock m_rbrLock
Definition: mythmediabuffer.h:169
MythMediaBuffer::m_readsDesired
bool m_readsDesired
Definition: mythmediabuffer.h:204
MythMediaBuffer::WriterFlush
void WriterFlush(void)
Calls ThreadedFileWriter::Flush(void)
Definition: mythmediabuffer.cpp:1690
MythMediaBuffer::KillReadAheadThread
void KillReadAheadThread(void)
Stops the read-ahead thread, and waits for it to stop.
Definition: mythmediabuffer.cpp:649
MythMediaBuffer::AVFormatInitNetwork
static void AVFormatInitNetwork(void)
Definition: mythmediabuffer.cpp:1853
MythMediaBuffer::IsBookmarkAllowed
virtual bool IsBookmarkAllowed(void)
Definition: mythmediabuffer.h:126
MythMediaBuffer::m_playSpeed
float m_playSpeed
Definition: mythmediabuffer.h:208
Buffer
Definition: MythExternControl.h:37
MythMediaBuffer::m_recentSeek
volatile bool m_recentSeek
Definition: mythmediabuffer.h:205
MythMediaBuffer::m_ignoreLiveEOF
bool m_ignoreLiveEOF
Definition: mythmediabuffer.h:217
MythMediaBuffer::m_storageReadLock
QMutex m_storageReadLock
Definition: mythmediabuffer.h:226
MythMediaBuffer::m_unknownBitrate
bool m_unknownBitrate
Definition: mythmediabuffer.h:193
MythMediaBuffer::HandleAction
virtual bool HandleAction(const QStringList &, int64_t)
Definition: mythmediabuffer.h:133
MythMediaBuffer::ResetReadAhead
void ResetReadAhead(long long NewInternal)
Restart the read-ahead thread at the 'newinternal' position.
Definition: mythmediabuffer.cpp:571
MythMediaBuffer::IsInStillFrame
virtual bool IsInStillFrame(void) const
Definition: mythmediabuffer.h:131
MythMediaBuffer::MythMediaBuffer
MythMediaBuffer(MythBufferType Type)
Definition: mythmediabuffer.cpp:199
MythMediaBuffer::SetReadInternalMode
bool SetReadInternalMode(bool Mode)
Definition: mythmediabuffer.cpp:519
MythMediaBuffer::m_fileIsMatroska
bool m_fileIsMatroska
Definition: mythmediabuffer.h:192
MythMediaBuffer::m_wantToRead
int m_wantToRead
Definition: mythmediabuffer.h:212
MythMediaBuffer::GetRealFileSizeInternal
virtual long long GetRealFileSizeInternal(void) const
Definition: mythmediabuffer.h:156
MythMediaBuffer::IsDisc
bool IsDisc(void) const
Definition: mythmediabuffer.cpp:1818
MythMediaBuffer::GetReadPosition
virtual long long GetReadPosition(void) const =0
MythMediaBuffer::Start
void Start(void)
Starts the read-ahead thread.
Definition: mythmediabuffer.cpp:613
MThread
This is a wrapper around QThread that does several additional things.
Definition: mthread.h:49
MythMediaBuffer::GetAvailableBuffer
QString GetAvailableBuffer(void)
Definition: mythmediabuffer.cpp:1536
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:551
MythMediaBuffer::m_bitrateInitialized
bool m_bitrateInitialized
Definition: mythmediabuffer.h:239
MythMediaBuffer::GetLastError
QString GetLastError(void) const
Definition: mythmediabuffer.cpp:1753
kMythBufferFile
@ kMythBufferFile
Definition: mythmediabuffer.h:41
MythMediaBuffer::m_decoderReads
QMap< qint64, uint64_t > m_decoderReads
Definition: mythmediabuffer.h:225
MythMediaBuffer::m_reallyRunning
bool m_reallyRunning
Definition: mythmediabuffer.h:197
MythMediaBuffer::SetLiveMode
void SetLiveMode(LiveTVChain *Chain)
Assigns a LiveTVChain to this RingBuffer.
Definition: mythmediabuffer.cpp:1803
MythMediaBuffer::m_subtitleFilename
QString m_subtitleFilename
Definition: mythmediabuffer.h:184
MythMediaBuffer::m_writeMode
bool m_writeMode
Definition: mythmediabuffer.h:188
MythMediaBuffer::DVD
const MythDVDBuffer * DVD(void) const
Definition: mythmediabuffer.cpp:1833
MythMediaBuffer::m_posLock
QReadWriteLock m_posLock
Definition: mythmediabuffer.h:163
MythMediaBuffer::m_bitrateMonitorEnabled
bool m_bitrateMonitorEnabled
Definition: mythmediabuffer.h:223
MythMediaBuffer::Peek
int Peek(void *Buffer, int Count)
Definition: mythmediabuffer.cpp:1170
MythMediaBuffer::m_stopReads
volatile bool m_stopReads
Definition: mythmediabuffer.h:177
MythMediaBuffer::IsNearEnd
bool IsNearEnd(double Framerate, uint Frames) const
Definition: mythmediabuffer.cpp:408
MythMediaBuffer::IsStreamed
virtual bool IsStreamed(void)
Definition: mythmediabuffer.h:124
MythMediaBuffer::m_rwLock
QReadWriteLock m_rwLock
Definition: mythmediabuffer.h:182
MythMediaBuffer::StartReads
void StartReads(void)
Definition: mythmediabuffer.cpp:675
MythDVDBuffer
Definition: mythdvdbuffer.h:36
MythMediaBuffer::m_ateof
bool m_ateof
Definition: mythmediabuffer.h:200
MythMediaBuffer::IsSeekingAllowed
virtual bool IsSeekingAllowed(void)
Definition: mythmediabuffer.h:125
MythMediaBuffer::GetStorageRate
QString GetStorageRate(void)
Definition: mythmediabuffer.cpp:1531
MythMediaBuffer::UpdateDecoderRate
uint64_t UpdateDecoderRate(uint64_t Latest=0)
Definition: mythmediabuffer.cpp:1551
MythMediaBuffer::m_internalReadPos
long long m_internalReadPos
Definition: mythmediabuffer.h:166
MythMediaBuffer::WaitForAvail
int WaitForAvail(int Count, int Timeout)
Definition: mythmediabuffer.cpp:1214
MythMediaBuffer::Pause
void Pause(void)
Pauses the read-ahead thread.
Definition: mythmediabuffer.cpp:686
MythMediaBuffer::Sync
void Sync(void)
Calls ThreadedFileWriter::Sync(void)
Definition: mythmediabuffer.cpp:1654
MythMediaBuffer::m_rbwPos
int m_rbwPos
Definition: mythmediabuffer.h:173
MythMediaBuffer::m_ignoreReadPos
long long m_ignoreReadPos
Definition: mythmediabuffer.h:167
MythMediaBuffer::m_readAheadRunning
bool m_readAheadRunning
Definition: mythmediabuffer.h:196
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:239
MythMediaBuffer::IsOpen
virtual bool IsOpen(void) const =0
MythMediaBuffer::GetType
MythBufferType GetType() const
Definition: mythmediabuffer.cpp:205
MythMediaBuffer::m_fillMin
int m_fillMin
Definition: mythmediabuffer.h:210
LiveTVChain
Keeps track of recordings in a current LiveTV instance.
Definition: livetvchain.h:32
MythMediaBuffer::SetWaitForWrite
void SetWaitForWrite(void)
Definition: mythmediabuffer.cpp:321