Skip to content

Commit

Permalink
libmythtv: Rename FileRingBuffer -> MythFileBuffer
Browse files Browse the repository at this point in the history
  • Loading branch information
mark-kendall committed Apr 12, 2020
1 parent 4b67829 commit e1966fe
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 16 deletions.
22 changes: 11 additions & 11 deletions mythtv/libs/libmythtv/io/fileringbuffer.cpp
Expand Up @@ -43,7 +43,7 @@ static int posix_fadvise(int, off_t, off_t, int) { return 0; }

#define LOC QString("FileRingBuf(%1): ").arg(m_filename)

FileRingBuffer::FileRingBuffer(const QString &Filename, bool Write, bool UseReadAhead, int Timeout)
MythFileBuffer::MythFileBuffer(const QString &Filename, bool Write, bool UseReadAhead, int Timeout)
: MythMediaBuffer(kRingBuffer_File)
{
m_startReadAhead = UseReadAhead;
Expand Down Expand Up @@ -86,7 +86,7 @@ FileRingBuffer::FileRingBuffer(const QString &Filename, bool Write, bool UseRead
}
}

FileRingBuffer::~FileRingBuffer()
MythFileBuffer::~MythFileBuffer()
{
KillReadAheadThread();

Expand Down Expand Up @@ -174,7 +174,7 @@ static QString LocalSubtitleFilename(QFileInfo &FileInfo)
return QString();
}

bool FileRingBuffer::OpenFile(const QString &Filename, uint Retry)
bool MythFileBuffer::OpenFile(const QString &Filename, uint Retry)
{
LOG(VB_PLAYBACK, LOG_INFO, LOC + QString("OpenFile(%1, %2 ms)")
.arg(Filename).arg(Retry));
Expand Down Expand Up @@ -366,7 +366,7 @@ bool FileRingBuffer::OpenFile(const QString &Filename, uint Retry)
return ok;
}

bool FileRingBuffer::ReOpen(const QString& Filename)
bool MythFileBuffer::ReOpen(const QString& Filename)
{
if (!m_writeMode)
{
Expand All @@ -393,15 +393,15 @@ bool FileRingBuffer::ReOpen(const QString& Filename)
return result;
}

bool FileRingBuffer::IsOpen(void) const
bool MythFileBuffer::IsOpen(void) const
{
m_rwLock.lockForRead();
bool ret = m_tfw || (m_fd2 > -1) || m_remotefile;
m_rwLock.unlock();
return ret;
}

int FileRingBuffer::SafeRead(void *Buffer, uint Size)
int MythFileBuffer::SafeRead(void *Buffer, uint Size)
{
if (m_remotefile)
return SafeRead(m_remotefile, Buffer, Size);
Expand All @@ -423,7 +423,7 @@ int FileRingBuffer::SafeRead(void *Buffer, uint Size)
* \param sz Number of bytes to read
* \return Returns number of bytes read
*/
int FileRingBuffer::SafeRead(int /*fd*/, void *Buffer, uint Size)
int MythFileBuffer::SafeRead(int /*fd*/, void *Buffer, uint Size)
{
uint tot = 0;
uint errcnt = 0;
Expand Down Expand Up @@ -533,7 +533,7 @@ int FileRingBuffer::SafeRead(int /*fd*/, void *Buffer, uint Size)
* \param sz Number of bytes to read
* \return Returns number of bytes read
*/
int FileRingBuffer::SafeRead(RemoteFile *Remote, void *Buffer, uint Size)
int MythFileBuffer::SafeRead(RemoteFile *Remote, void *Buffer, uint Size)
{
int ret = Remote->Read(Buffer, static_cast<int>(Size));
if (ret < 0)
Expand All @@ -552,15 +552,15 @@ int FileRingBuffer::SafeRead(RemoteFile *Remote, void *Buffer, uint Size)
return ret;
}

long long FileRingBuffer::GetReadPosition(void) const
long long MythFileBuffer::GetReadPosition(void) const
{
m_posLock.lockForRead();
long long ret = m_readPos;
m_posLock.unlock();
return ret;
}

long long FileRingBuffer::GetRealFileSizeInternal(void) const
long long MythFileBuffer::GetRealFileSizeInternal(void) const
{
m_rwLock.lockForRead();
long long result = -1;
Expand All @@ -587,7 +587,7 @@ long long FileRingBuffer::GetRealFileSizeInternal(void) const
return result;
}

long long FileRingBuffer::SeekInternal(long long Position, int Whence)
long long MythFileBuffer::SeekInternal(long long Position, int Whence)
{
long long ret = -1;

Expand Down
6 changes: 3 additions & 3 deletions mythtv/libs/libmythtv/io/fileringbuffer.h
Expand Up @@ -4,22 +4,22 @@
// MythTV
#include "ringbuffer.h"

class MTV_PUBLIC FileRingBuffer : public MythMediaBuffer
class MTV_PUBLIC MythFileBuffer : public MythMediaBuffer
{
Q_DECLARE_TR_FUNCTIONS(FileRingBuffer)

friend class MythMediaBuffer;

public:
~FileRingBuffer() override;
~MythFileBuffer() override;

bool IsOpen (void) const override;
long long GetReadPosition (void) const override;
bool OpenFile (const QString &Filename, uint Retry = static_cast<uint>(kDefaultOpenTimeout)) override;
bool ReOpen (const QString& Filename = "") override;

protected:
FileRingBuffer(const QString &Filename, bool Write, bool UseReadAhead, int Timeout);
MythFileBuffer(const QString &Filename, bool Write, bool UseReadAhead, int Timeout);
int SafeRead (void *Buffer, uint Size) override;
int SafeRead (int FD, void *Buffer, uint Size);
int SafeRead (RemoteFile *Remote, void *Buffer, uint Size);
Expand Down
4 changes: 2 additions & 2 deletions mythtv/libs/libmythtv/io/ringbuffer.cpp
Expand Up @@ -108,7 +108,7 @@ MythMediaBuffer *MythMediaBuffer::Create(const QString &Filename, bool Write,
QString lower = filename.toLower();

if (Write)
return new FileRingBuffer(filename, Write, UseReadAhead, Timeout);
return new MythFileBuffer(filename, Write, UseReadAhead, Timeout);

bool dvddir = false;
bool bddir = false;
Expand Down Expand Up @@ -197,7 +197,7 @@ MythMediaBuffer *MythMediaBuffer::Create(const QString &Filename, bool Write,
delete dvdstream;
}

return new FileRingBuffer(filename, Write, UseReadAhead, Timeout);
return new MythFileBuffer(filename, Write, UseReadAhead, Timeout);
}

MythMediaBuffer::MythMediaBuffer(RingBufferType Type)
Expand Down

0 comments on commit e1966fe

Please sign in to comment.