RingBuffer Class Reference

#include <RingBuffer.h>

List of all members.


Detailed Description

Implements a file/stream reader/writer.

This class, despite its name, no-longer provides a ring buffer. It can buffer reads and provide support for streaming files. It also provides a wrapper for the ThreadedFileWriter which makes sure that the file reader does not read past where the wrapped TFW has written new data.

Definition at line 26 of file RingBuffer.h.


Public Member Functions

 RingBuffer (const QString &lfilename, bool write, bool usereadahead=true, int timeout_ms=kDefaultOpenTimeout)
 Creates a RingBuffer instance.
 ~RingBuffer ()
 Shuts down any threads and closes any files.
void SetWriteBufferSize (int newSize)
 Calls ThreadedFileWriter::SetWriteBufferSize(int).
void SetWriteBufferMinWriteSize (int newMinSize)
 Calls ThreadedFileWriter::SetWriteBufferMinWriteSize(int).
void SetOldFile (bool is_old)
 Tell RingBuffer if this is an old file or not.
void SetStreamOnly (bool stream)
void UpdateRawBitrate (uint rawbitrate)
 Set the raw bit rate, to allow RingBuffer adjust effective bitrate.
void UpdatePlaySpeed (float playspeed)
 Set the play speed, to allow RingBuffer adjust effective bitrate.
QString GetFilename (void) const
 Returns name of file used by this RingBuffer.
QString GetSubtitleFilename (void) const
bool GetStopReads (void) const
 Returns value of stopreads.
bool isPaused (void) const
 Returns false iff read-ahead is not running and read-ahead is not paused.
long long GetReadPosition (void) const
 Returns how far into the file we have read.
long long GetWritePosition (void) const
 Returns how far into a ThreadedFileWriter file we have written.
long long GetRealFileSize (void) const
 Returns the size of the file we are reading/writing, or -1 if the query fails.
bool IsOpen (void) const
 Returns true if the file is open for either reading or writing.
bool IsNearEnd (double fps, uint vvf) const
void OpenFile (const QString &lfilename, uint retry_ms=kDefaultOpenTimeout)
 Opens a file for reading.
int Read (void *buf, int count)
 This is the public method for reading from a file, it calls the appropriate read method if the file is remote or buffered, or a BD/DVD.
int Peek (void *buf, int count)
void Reset (bool full=false, bool toAdjust=false, bool resetInternal=false)
 Resets the read-ahead thread and our position in the file.
long long Seek (long long pos, int whence, bool has_lock=false)
 Seeks to a particular position in the file.
void Pause (void)
 Pauses the read-ahead thread.
void Unpause (void)
 Unpauses the read-ahead thread.
void WaitForPause (void)
 Waits for Pause(void) to take effect.
void Start (void)
 Starts the read-ahead thread.
void StopReads (void)
 ????
void StartReads (void)
 ????
bool LiveMode (void) const
 Returns true if this RingBuffer has been assigned a LiveTVChain.
void SetLiveMode (LiveTVChain *chain)
 Assigns a LiveTVChain to this RingBuffer.
void IgnoreLiveEOF (bool ignore)
 Tells RingBuffer whether to igonre the end-of-file.
int Write (const void *buf, uint count)
 Writes buffer to ThreadedFileWriter::Write(const void*,uint).
bool IsIOBound (void) const
 Returns true if a RingBuffer::Write(void*,int) is likely to block.
void WriterFlush (void)
 Calls ThreadedFileWriter::Flush(void) and ThreadedFileWriter::Sync(void).
void Sync (void)
 Calls ThreadedFileWriter::Sync(void).
long long WriterSeek (long long pos, int whence, bool has_lock=false)
 Calls ThreadedFileWriter::Seek(long long,int).
bool IsDVD (void) const
 Returns true if this is a DVD backed RingBuffer.
bool InDVDMenuOrStillFrame (void)
 Returns true if this is a DVD backed RingBuffer.
bool IsBD (void) const
 Returns true if this is a Blu-ray backed RingBuffer.
long long SetAdjustFilesize (void)
void SetTimeout (bool is_old) MDEPRECATED
 Calls SetOldFile(), do not use.
bool isDVD (void) const MDEPRECATED
 Calls IsDVD(), do not use.
bool isBD (void) const MDEPRECATED
 Calls IsBD(), do not use.
DVDRingBufferPrivDVD () MDEPRECATED
 Illicitly manipulating privates is ill advised! DO NOT USE.
BDRingBufferPrivBD () MDEPRECATED
 Illicitly manipulating privates is ill advised! DO NOT USE.

Static Public Attributes

static const int kDefaultOpenTimeout = 2000
static QMutex subExtLock
static QStringList subExt
static QStringList subExtNoCheck
static const uint kBufferSize = 4 * 1024 * 1024
static const uint kReadTestSize = PNG_MIN_SIZE

Protected Member Functions

void run (void)
void CalcReadAheadThresh (void)
 Calculates fill_min, fill_threshold, and readblocksize from the estimated effective bitrate of the stream.
bool PauseAndWait (void)
int safe_read_bd (void *data, uint sz)
int safe_read_dvd (void *data, uint sz)
int safe_read (int fd, void *data, uint sz)
 Reads data from the file-descriptor.
int safe_read (RemoteFile *rf, void *data, uint sz)
 Reads data from the RemoteFile.
int ReadPriv (void *buf, int count, bool peek)
 When possible reads from the read-ahead buffer, otherwise reads directly from the device.
int ReadDirect (void *buf, int count, bool peek)
bool WaitForReadsAllowed (void)
bool WaitForAvail (int count)
int ReadBufFree (void) const
 Returns number of bytes available for reading into buffer.
int ReadBufAvail (void) const
 Returns number of bytes available for reading from buffer.
void ResetReadAhead (long long newinternal)
 Restart the read-ahead thread at the 'newinternal' position.
void KillReadAheadThread (void)
 Stops the read-ahead thread, and waits for it to stop.

Private Attributes

QReadWriteLock poslock
long long readpos
long long writepos
long long internalreadpos
long long ignorereadpos
QReadWriteLock rbrlock
int rbrpos
QReadWriteLock rbwlock
int rbwpos
volatile bool stopreads
QReadWriteLock rwlock
QString filename
QString subtitlefilename
ThreadedFileWritertfw
int fd2
bool writemode
RemoteFileremotefile
bool startreadahead
char * readAheadBuffer
bool readaheadrunning
bool reallyrunning
bool request_pause
bool paused
bool ateof
bool readsallowed
bool setswitchtonext
bool streamOnly
bool ignorereadahead
uint rawbitrate
float playspeed
int fill_threshold
int fill_min
int readblocksize
int wanttoread
int numfailures
bool commserror
DVDRingBufferPrivdvdPriv
BDRingBufferPrivbdPriv
bool oldfile
LiveTVChainlivetvchain
bool ignoreliveeof
long long readAdjust
QWaitCondition generalWait
 Condition to signal that the read ahead thread is running.

Constructor & Destructor Documentation

RingBuffer::RingBuffer ( const QString &  lfilename,
bool  write,
bool  readahead = true,
int  timeout_ms = kDefaultOpenTimeout 
)

Creates a RingBuffer instance.

You can explicitly disable the readahead thread by setting readahead to false, or by just not calling Start(void).

Parameters:
lfilename Name of file to read or write.
write If true an encapsulated writer is created
readahead If false a call to Start(void) will not a pre-buffering thread, otherwise Start(void) will start a pre-buffering thread.
timeout_ms if < 0, then we will not open the file. Otherwise it's how long to try opening the file after the first failure in milliseconds before giving up.

Definition at line 117 of file RingBuffer.cpp.

RingBuffer::~RingBuffer ( void   ) 

Shuts down any threads and closes any files.

Definition at line 566 of file RingBuffer.cpp.


Member Function Documentation

void RingBuffer::SetWriteBufferSize ( int  newSize  ) 

Calls ThreadedFileWriter::SetWriteBufferSize(int).

Definition at line 2101 of file RingBuffer.cpp.

Referenced by TVRec::SetupRecorder().

void RingBuffer::SetWriteBufferMinWriteSize ( int  newMinSize  ) 

Calls ThreadedFileWriter::SetWriteBufferMinWriteSize(int).

Definition at line 2112 of file RingBuffer.cpp.

void RingBuffer::SetOldFile ( bool  is_old  ) 

Tell RingBuffer if this is an old file or not.

Normally the RingBuffer determines that the file is old if it has not been modified in the last minute. This allows one to override that determination externally.

If for instance you are slowly writing to the file you could call this with the value of false. If you just finished writing the file you could call it with the value true. Knowing that the file is old allows MythTV to determine that a read at the end of the file is really an end-of-file condition more quickly. But if the file is growing it can also cause the RingBuffer to report an end-of-file condition prematurely.

Definition at line 2135 of file RingBuffer.cpp.

void RingBuffer::SetStreamOnly ( bool  stream  ) 

Definition at line 2146 of file RingBuffer.cpp.

Referenced by mythfile_open().

void RingBuffer::UpdateRawBitrate ( uint  rawbitrate  ) 

Set the raw bit rate, to allow RingBuffer adjust effective bitrate.

Parameters:
raw_bitrate Streams average number of kilobits per second when playspeed is 1.0

Definition at line 758 of file RingBuffer.cpp.

Referenced by NuppelDecoder::GetFrame(), MythPlayer::JumpToProgram(), NuppelDecoder::OpenFile(), AvFormatDecoder::ScanStreams(), and MythPlayer::SwitchToProgram().

void RingBuffer::UpdatePlaySpeed ( float  playspeed  ) 

Set the play speed, to allow RingBuffer adjust effective bitrate.

Parameters:
play_speed Speed to set. (1.0 for normal speed)

Definition at line 780 of file RingBuffer.cpp.

QString RingBuffer::GetFilename ( void   )  const

QString RingBuffer::GetSubtitleFilename ( void   )  const

Definition at line 2163 of file RingBuffer.cpp.

Referenced by PlayerContext::CreatePlayer().

bool RingBuffer::GetStopReads ( void   )  const [inline]

Returns value of stopreads.

See also:
StartReads(void), StopReads(void)

Definition at line 47 of file RingBuffer.h.

Referenced by FileTransfer::RequestBlock().

bool RingBuffer::isPaused ( void   )  const

Returns false iff read-ahead is not running and read-ahead is not paused.

Definition at line 1034 of file RingBuffer.cpp.

long long RingBuffer::GetReadPosition ( void   )  const

Returns how far into the file we have read.

Definition at line 2175 of file RingBuffer.cpp.

Referenced by MythDVDPlayer::calcSliderPos(), NuppelDecoder::GetFrame(), NuppelDecoder::OpenFile(), FileTransfer::Seek(), and AvFormatDecoder::SeekReset().

long long RingBuffer::GetWritePosition ( void   )  const

long long RingBuffer::GetRealFileSize ( void   )  const

bool RingBuffer::IsOpen ( void   )  const

bool RingBuffer::IsNearEnd ( double  fps,
uint  vvf 
) const

Definition at line 834 of file RingBuffer.cpp.

Referenced by MythPlayer::IsReallyNearEnd().

void RingBuffer::OpenFile ( const QString &  lfilename,
uint  retry_ms = kDefaultOpenTimeout 
)

Opens a file for reading.

Parameters:
lfilename Name of file to read
retry_ms How many ms to retry reading the file after the first try before giving up.

Definition at line 276 of file RingBuffer.cpp.

Referenced by MythPlayer::JumpToProgram(), mythfile_open(), RingBuffer(), and MythPlayer::SwitchToProgram().

int RingBuffer::Read ( void *  buf,
int  count 
)

This is the public method for reading from a file, it calls the appropriate read method if the file is remote or buffered, or a BD/DVD.

Parameters:
buf Pointer to where data will be written
count Number of bytes to read
Returns:
Returns number of bytes read

Definition at line 1680 of file RingBuffer.cpp.

Referenced by AVF_Read(), NuppelDecoder::GetFrame(), NuppelDecoder::OpenFile(), read_line_from_input(), NuppelDecoder::ReadFileheader(), NuppelDecoder::ReadFrameheader(), and FileTransfer::RequestBlock().

int RingBuffer::Peek ( void *  buf,
int  count 
)

Definition at line 1364 of file RingBuffer.cpp.

Referenced by MythPlayer::OpenFile().

void RingBuffer::Reset ( bool  full = false,
bool  toAdjust = false,
bool  resetInternal = false 
)

Resets the read-ahead thread and our position in the file.

Definition at line 613 of file RingBuffer.cpp.

Referenced by MythPlayer::FileChangedCallback(), MythPlayer::JumpToProgram(), and MythPlayer::SwitchToProgram().

long long RingBuffer::Seek ( long long  pos,
int  whence,
bool  has_lock = false 
)

void RingBuffer::Pause ( void   ) 

Pauses the read-ahead thread.

Calls StopReads(void).

See also:
Unpause(void), WaitForPause(void)

Definition at line 1010 of file RingBuffer.cpp.

Referenced by MythPlayer::PauseBuffer(), PlayerContext::PIPTeardown(), TV::StopStuff(), and TV::SwitchCards().

void RingBuffer::Unpause ( void   ) 

Unpauses the read-ahead thread.

Calls StartReads(void).

See also:
Pause(void)

Definition at line 1023 of file RingBuffer.cpp.

Referenced by TV::CreatePBP(), TV::RestartAllPlayers(), MythPlayer::SwitchToProgram(), and MythPlayer::UnpauseBuffer().

void RingBuffer::WaitForPause ( void   ) 

void RingBuffer::Start ( void   ) 

Starts the read-ahead thread.

If the RingBuffer constructor was not called with a usereadahead of true of if this was reset to false because we're dealing with a DVD the read ahead thread will not be started.

If this RingBuffer is in write-mode a warning will be printed and the read ahead thread will not be started.

If the read ahead thread is already running a warning will be printed and the read ahead thread will not be started.

Definition at line 932 of file RingBuffer.cpp.

Referenced by mythfile_open(), and MythPlayer::OpenFile().

void RingBuffer::StopReads ( void   ) 

void RingBuffer::StartReads ( void   ) 

????

See also:
StopReads(void), Unpause(void)

Definition at line 1000 of file RingBuffer.cpp.

Referenced by TV::PauseLiveTV(), Seek(), Start(), Unpause(), and FileTransfer::Unpause().

bool RingBuffer::LiveMode ( void   )  const

Returns true if this RingBuffer has been assigned a LiveTVChain.

See also:
SetLiveMode(LiveTVChain*)

Definition at line 2222 of file RingBuffer.cpp.

Referenced by NuppelDecoder::GetFrame(), AvFormatDecoder::InitByteContext(), and NuppelVideoRecorder::Initialize().

void RingBuffer::SetLiveMode ( LiveTVChain chain  ) 

Assigns a LiveTVChain to this RingBuffer.

See also:
LiveMode(void)

Definition at line 2234 of file RingBuffer.cpp.

Referenced by TV::HandleStateChange(), and TV::SwitchCards().

void RingBuffer::IgnoreLiveEOF ( bool  ignore  ) 

Tells RingBuffer whether to igonre the end-of-file.

Definition at line 2242 of file RingBuffer.cpp.

Referenced by MythPlayer::JumpToProgram(), TV::PauseLiveTV(), TV::SwitchCards(), and TV::UnpauseLiveTV().

int RingBuffer::Write ( const void *  buf,
uint  count 
)

bool RingBuffer::IsIOBound ( void   )  const

Returns true if a RingBuffer::Write(void*,int) is likely to block.

Definition at line 1695 of file RingBuffer.cpp.

Referenced by NuppelVideoRecorder::WriteVideo().

void RingBuffer::WriterFlush ( void   ) 

void RingBuffer::Sync ( void   ) 

Calls ThreadedFileWriter::Sync(void).

Definition at line 1758 of file RingBuffer.cpp.

long long RingBuffer::WriterSeek ( long long  pos,
int  whence,
bool  has_lock = false 
)

bool RingBuffer::IsDVD ( void   )  const

Returns true if this is a DVD backed RingBuffer.

NOTE: This is not locked because ReadDirect calls DVD safe_read which sleeps with a write lock on rwlock in the DVDNAV_WAIT condition.

Due to the lack of locking is only safe to call once OpenFile() has completed.

Definition at line 2258 of file RingBuffer.cpp.

bool RingBuffer::InDVDMenuOrStillFrame ( void   ) 

bool RingBuffer::IsBD ( void   )  const

Returns true if this is a Blu-ray backed RingBuffer.

Definition at line 2288 of file RingBuffer.cpp.

long long RingBuffer::SetAdjustFilesize ( void   ) 

Definition at line 1353 of file RingBuffer.cpp.

Referenced by MythPlayer::SwitchToProgram().

void RingBuffer::SetTimeout ( bool  is_old  )  [inline]

Calls SetOldFile(), do not use.

Definition at line 100 of file RingBuffer.h.

Referenced by FileTransfer::SetTimeout().

bool RingBuffer::isDVD ( void   )  const [inline]

Calls IsDVD(), do not use.

Definition at line 102 of file RingBuffer.h.

Referenced by MythDVDPlayer::CalcMaxFFTime(), MythDVDPlayer::calcSliderPos(), DecoderBase::ChangeDVDTrack(), MythDVDPlayer::ChangeSpeed(), MythDVDPlayer::DecoderGetFrameREW(), MythDVDPlayer::DisableCaptions(), MythDVDPlayer::DisplayDVDButton(), MythDVDPlayer::DisplayNormalFrame(), MythDVDPlayer::DisplayPauseFrame(), DecoderBase::DoFastForward(), DecoderBase::DoFastForwardSeek(), DecoderBase::DoRewind(), DecoderBase::DoRewindSeek(), DecoderBase::DVDFindPosition(), TV::DVDJumpBack(), TV::DVDJumpForward(), MythDVDPlayer::EnableCaptions(), MythDVDPlayer::GetBookmark(), AvFormatDecoder::GetFrame(), DecoderBase::GetKey(), AvFormatDecoder::GetTrackDesc(), MythDVDPlayer::GoToDVDMenu(), MythDVDPlayer::GoToDVDProgram(), TV::HandleLCDTimerEvent(), TV::HandleStateChange(), AvFormatDecoder::InitByteContext(), AvFormatDecoder::InitVideoCodec(), internal_play_media(), TV::IsBookmarkAllowed(), AvFormatDecoder::MpegPreProcessPkt(), MythDVDPlayer::OpenFile(), AvFormatDecoder::OpenFile(), DecoderBase::PosMapFromDb(), DecoderBase::PosMapFromEnc(), MythDVDPlayer::PrepareAudioSample(), AvFormatDecoder::PreProcessVideoPacket(), TV::ProcessKeypress(), TV::ProcessNetworkControlCommand(), AvFormatDecoder::ProcessSubtitlePacket(), AvFormatDecoder::ProcessVideoPacket(), AvFormatDecoder::Reset(), AvFormatDecoder::ScanStreams(), MythDVDPlayer::SeekForScreenGrab(), AvFormatDecoder::SeekReset(), MythDVDPlayer::SetDVDBookmark(), TV::ShowLCDDVDInfo(), TV::ShowOSDStopWatchingRecording(), TV::StopStuff(), DecoderBase::SyncPositionMap(), and DecoderBase::UpdateDVDFramesPlayed().

bool RingBuffer::isBD ( void   )  const [inline]

DVDRingBufferPriv* RingBuffer::DVD (  )  [inline]

BDRingBufferPriv* RingBuffer::BD (  )  [inline]

void RingBuffer::run ( void   )  [protected]

Definition at line 1107 of file RingBuffer.cpp.

void RingBuffer::CalcReadAheadThresh ( void   )  [protected]

Calculates fill_min, fill_threshold, and readblocksize from the estimated effective bitrate of the stream.

WARNING: Must be called with rwlock in write lock state.

Definition at line 795 of file RingBuffer.cpp.

Referenced by OpenFile(), ResetReadAhead(), UpdatePlaySpeed(), and UpdateRawBitrate().

bool RingBuffer::PauseAndWait ( void   )  [protected]

Definition at line 1064 of file RingBuffer.cpp.

Referenced by run().

int RingBuffer::safe_read_bd ( void *  data,
uint  sz 
) [protected]

int RingBuffer::safe_read_dvd ( void *  data,
uint  sz 
) [protected]

int RingBuffer::safe_read ( int  fd,
void *  data,
uint  sz 
) [protected]

Reads data from the file-descriptor.

This will re-read the file forever until the end-of-file is reached or the buffer is full.

Parameters:
fd File descriptor to read from
data Pointer to where data will be written
sz Number of bytes to read
Returns:
Returns number of bytes read

Definition at line 660 of file RingBuffer.cpp.

Referenced by ReadDirect(), and run().

int RingBuffer::safe_read ( RemoteFile rf,
void *  data,
uint  sz 
) [protected]

Reads data from the RemoteFile.

Parameters:
rf RemoteFile to read from
data Pointer to where data will be written
sz Number of bytes to read
Returns:
Returns number of bytes read

Definition at line 731 of file RingBuffer.cpp.

int RingBuffer::ReadPriv ( void *  buf,
int  count,
bool  peek 
) [protected]

When possible reads from the read-ahead buffer, otherwise reads directly from the device.

Parameters:
buf Pointer to where data will be written
count Number of bytes to read
peek If true, don't increment read count
Returns:
Returns number of bytes read

Definition at line 1554 of file RingBuffer.cpp.

Referenced by Peek(), and Read().

int RingBuffer::ReadDirect ( void *  buf,
int  count,
bool  peek 
) [protected]

Definition at line 1467 of file RingBuffer.cpp.

Referenced by ReadPriv().

bool RingBuffer::WaitForReadsAllowed ( void   )  [protected]

Definition at line 1376 of file RingBuffer.cpp.

Referenced by ReadPriv().

bool RingBuffer::WaitForAvail ( int  count  )  [protected]

Definition at line 1402 of file RingBuffer.cpp.

Referenced by ReadPriv().

int RingBuffer::ReadBufFree ( void   )  const [protected]

Returns number of bytes available for reading into buffer.

WARNING: Must be called with rwlock in locked state.

Definition at line 864 of file RingBuffer.cpp.

Referenced by run().

int RingBuffer::ReadBufAvail ( void   )  const [protected]

Returns number of bytes available for reading from buffer.

WARNING: Must be called with rwlock in locked state.

Definition at line 876 of file RingBuffer.cpp.

Referenced by IsNearEnd(), ReadPriv(), and WaitForAvail().

void RingBuffer::ResetReadAhead ( long long  newinternal  )  [protected]

Restart the read-ahead thread at the 'newinternal' position.

This is called after a Seek(long long, int) so that the read-ahead buffer doesn't contain any stale data, and so that it will read any new data from the new position in the file.

WARNING: Must be called with rwlock and poslock in write lock state.

Parameters:
newinternal Position in file to start reading data from

Definition at line 897 of file RingBuffer.cpp.

Referenced by Reset(), run(), and Seek().

void RingBuffer::KillReadAheadThread ( void   )  [protected]

Stops the read-ahead thread, and waits for it to stop.

Definition at line 973 of file RingBuffer.cpp.

Referenced by ~RingBuffer().


Member Data Documentation

const int RingBuffer::kDefaultOpenTimeout = 2000 [static]

Definition at line 118 of file RingBuffer.h.

Referenced by MythPlayer::JumpToProgram(), and MythPlayer::SwitchToProgram().

QReadWriteLock RingBuffer::poslock [mutable, private]

long long RingBuffer::readpos [private]

Definition at line 142 of file RingBuffer.h.

Referenced by GetReadPosition(), Read(), ReadDirect(), Reset(), run(), and Seek().

long long RingBuffer::writepos [private]

Definition at line 143 of file RingBuffer.h.

Referenced by GetWritePosition(), Reset(), Write(), and WriterSeek().

long long RingBuffer::internalreadpos [private]

Definition at line 144 of file RingBuffer.h.

Referenced by Reset(), ResetReadAhead(), run(), safe_read(), Seek(), and SetAdjustFilesize().

long long RingBuffer::ignorereadpos [private]

Definition at line 145 of file RingBuffer.h.

Referenced by ReadDirect(), ReadPriv(), run(), and Seek().

QReadWriteLock RingBuffer::rbrlock [mutable, private]

Definition at line 146 of file RingBuffer.h.

Referenced by ReadBufAvail(), ReadBufFree(), ReadPriv(), ResetReadAhead(), run(), and Seek().

int RingBuffer::rbrpos [private]

Definition at line 147 of file RingBuffer.h.

Referenced by ReadBufAvail(), ReadBufFree(), ReadPriv(), ResetReadAhead(), run(), and Seek().

QReadWriteLock RingBuffer::rbwlock [mutable, private]

Definition at line 148 of file RingBuffer.h.

Referenced by ReadBufAvail(), ReadBufFree(), ResetReadAhead(), run(), and Seek().

int RingBuffer::rbwpos [private]

Definition at line 149 of file RingBuffer.h.

Referenced by ReadBufAvail(), ReadBufFree(), ResetReadAhead(), run(), and Seek().

volatile bool RingBuffer::stopreads [private]

QReadWriteLock RingBuffer::rwlock [mutable, private]

QString RingBuffer::filename [private]

Definition at line 157 of file RingBuffer.h.

Referenced by GetFilename(), GetRealFileSize(), OpenFile(), RingBuffer(), and Seek().

QString RingBuffer::subtitlefilename [private]

Definition at line 158 of file RingBuffer.h.

Referenced by GetSubtitleFilename(), and OpenFile().

int RingBuffer::fd2 [private]

Definition at line 161 of file RingBuffer.h.

Referenced by IsOpen(), OpenFile(), ReadDirect(), run(), safe_read(), Seek(), and ~RingBuffer().

Definition at line 163 of file RingBuffer.h.

Referenced by ReadPriv(), RingBuffer(), Seek(), Start(), and Write().

Definition at line 167 of file RingBuffer.h.

Referenced by OpenFile(), and Start().

char* RingBuffer::readAheadBuffer [private]

Definition at line 168 of file RingBuffer.h.

Referenced by ReadPriv(), run(), and ~RingBuffer().

Definition at line 170 of file RingBuffer.h.

Referenced by run(), and Start().

Definition at line 172 of file RingBuffer.h.

Referenced by isPaused(), PauseAndWait(), and WaitForPause().

Definition at line 173 of file RingBuffer.h.

Referenced by OpenFile(), ReadPriv(), ResetReadAhead(), run(), Seek(), and WaitForAvail().

Definition at line 174 of file RingBuffer.h.

Referenced by CalcReadAheadThresh(), ResetReadAhead(), run(), Seek(), and WaitForReadsAllowed().

Definition at line 175 of file RingBuffer.h.

Referenced by OpenFile(), Reset(), ResetReadAhead(), run(), and WaitForAvail().

Definition at line 176 of file RingBuffer.h.

Referenced by OpenFile(), and SetStreamOnly().

Definition at line 177 of file RingBuffer.h.

Definition at line 178 of file RingBuffer.h.

Referenced by CalcReadAheadThresh(), IsNearEnd(), OpenFile(), and UpdateRawBitrate().

float RingBuffer::playspeed [private]

Definition at line 179 of file RingBuffer.h.

Referenced by CalcReadAheadThresh(), IsNearEnd(), and UpdatePlaySpeed().

Definition at line 180 of file RingBuffer.h.

Referenced by CalcReadAheadThresh(), and run().

int RingBuffer::fill_min [private]

Definition at line 181 of file RingBuffer.h.

Referenced by CalcReadAheadThresh(), run(), and Seek().

Definition at line 182 of file RingBuffer.h.

Referenced by CalcReadAheadThresh(), IsNearEnd(), OpenFile(), run(), and Seek().

int RingBuffer::wanttoread [private]

Definition at line 183 of file RingBuffer.h.

Referenced by ReadPriv(), and WaitForAvail().

int RingBuffer::numfailures [private]

Definition at line 184 of file RingBuffer.h.

Referenced by OpenFile(), Reset(), run(), and safe_read().

Definition at line 185 of file RingBuffer.h.

Referenced by OpenFile(), ReadPriv(), Reset(), run(), WaitForAvail(), and WaitForReadsAllowed().

Definition at line 190 of file RingBuffer.h.

Referenced by GetReadPosition(), IsBD(), IsOpen(), OpenFile(), ReadDirect(), run(), Seek(), and ~RingBuffer().

Definition at line 192 of file RingBuffer.h.

Referenced by OpenFile(), safe_read(), and SetOldFile().

Definition at line 194 of file RingBuffer.h.

Referenced by LiveMode(), run(), safe_read(), SetLiveMode(), and WaitForAvail().

Definition at line 195 of file RingBuffer.h.

Referenced by IgnoreLiveEOF(), and run().

long long RingBuffer::readAdjust [private]

Definition at line 197 of file RingBuffer.h.

Referenced by Reset(), safe_read(), Seek(), and SetAdjustFilesize().

QWaitCondition RingBuffer::generalWait [private]

Condition to signal that the read ahead thread is running.

Definition at line 206 of file RingBuffer.h.

Referenced by KillReadAheadThread(), PauseAndWait(), ReadPriv(), Reset(), ResetReadAhead(), run(), Seek(), Start(), StartReads(), StopReads(), Unpause(), WaitForAvail(), WaitForPause(), and WaitForReadsAllowed().

QMutex RingBuffer::subExtLock [static]

Definition at line 209 of file RingBuffer.h.

Referenced by is_subtitle_possible(), local_sub_filename(), OpenFile(), and RingBuffer().

QStringList RingBuffer::subExt [static]

Definition at line 210 of file RingBuffer.h.

Referenced by local_sub_filename(), OpenFile(), and RingBuffer().

QStringList RingBuffer::subExtNoCheck [static]

Definition at line 211 of file RingBuffer.h.

Referenced by is_subtitle_possible(), and RingBuffer().

const uint RingBuffer::kBufferSize = 4 * 1024 * 1024 [static]

Definition at line 215 of file RingBuffer.h.

Referenced by CalcReadAheadThresh(), ReadBufAvail(), ReadBufFree(), ReadPriv(), run(), and Seek().

const uint RingBuffer::kReadTestSize = PNG_MIN_SIZE [static]

Definition at line 216 of file RingBuffer.h.

Referenced by MainServer::HandleAnnounce(), local_sub_filename(), and OpenFile().


The documentation for this class was generated from the following files:

Generated on Thu Sep 9 06:39:49 2010 for MythTV by  doxygen 1.5.5