Skip to content

Commit

Permalink
libmythtv: Rename MythMediaBuffer file (was ringbuffer)
Browse files Browse the repository at this point in the history
  • Loading branch information
mark-kendall committed Apr 12, 2020
1 parent eb810cd commit f74c588
Show file tree
Hide file tree
Showing 39 changed files with 63 additions and 67 deletions.
Expand Up @@ -10,7 +10,7 @@

#include "mythmiscutil.h"
#include "mythdb.h"
#include "io/ringbuffer.h"
#include "io/mythmediabuffer.h"
#include "mythsocket.h"
#include "mythlogging.h"
#include "programinfo.h"
Expand Down
Expand Up @@ -3,7 +3,7 @@
#include <utility>

#include "filetransfer.h"
#include "io/ringbuffer.h"
#include "io/mythmediabuffer.h"
#include "programinfo.h"
#include "mythsocket.h"
#include "mythlogging.h"
Expand Down
2 changes: 1 addition & 1 deletion mythtv/libs/libmythtv/Bluray/bdringbuffer.h
Expand Up @@ -10,7 +10,7 @@

// MythTV
#include "config.h"
#include "io/ringbuffer.h"
#include "io/mythmediabuffer.h"

// BluRay
#include "libbluray/bluray.h"
Expand Down
2 changes: 1 addition & 1 deletion mythtv/libs/libmythtv/DVD/mythdvdbuffer.h
Expand Up @@ -9,7 +9,7 @@
#include <QCoreApplication>

// MythTV
#include "io/ringbuffer.h"
#include "io/mythmediabuffer.h"
#include "mythdate.h"
#include "referencecounter.h"
#include "mythdvdcontext.h"
Expand Down
2 changes: 1 addition & 1 deletion mythtv/libs/libmythtv/DVD/mythdvdstream.h
Expand Up @@ -9,7 +9,7 @@
#include <QList>

// MythTV
#include "ringbuffer.h"
#include "io/mythmediabuffer.h"

// Std
#include <cstdint>
Expand Down
2 changes: 1 addition & 1 deletion mythtv/libs/libmythtv/HLS/httplivestreambuffer.h
Expand Up @@ -24,7 +24,7 @@
#define MythXCode_hlsbuffer_h

#include "mythcorecontext.h"
#include "ringbuffer.h"
#include "io/mythmediabuffer.h"

extern "C" {
#include "libavformat/avformat.h"
Expand Down
2 changes: 1 addition & 1 deletion mythtv/libs/libmythtv/decoders/avformatdecoder.cpp
Expand Up @@ -17,7 +17,7 @@ using namespace std;
#include "privatedecoder.h"
#include "audiooutput.h"
#include "audiooutpututil.h"
#include "ringbuffer.h"
#include "io/mythmediabuffer.h"
#include "mythplayer.h"
#include "remoteencoder.h"
#include "programinfo.h"
Expand Down
2 changes: 1 addition & 1 deletion mythtv/libs/libmythtv/decoders/decoderbase.h
Expand Up @@ -5,7 +5,7 @@
#include <vector>
using namespace std;

#include "io/ringbuffer.h"
#include "io/mythmediabuffer.h"
#include "remoteencoder.h"
#include "mythcontext.h"
#include "mythdbcon.h"
Expand Down
2 changes: 1 addition & 1 deletion mythtv/libs/libmythtv/io/mythavformatbuffer.h
Expand Up @@ -2,7 +2,7 @@
#define AVFRINGBUFFER_H

// MythTV
#include "io/ringbuffer.h"
#include "io/mythmediabuffer.h"

// FFmpeg
extern "C" {
Expand Down
2 changes: 1 addition & 1 deletion mythtv/libs/libmythtv/io/mythfilebuffer.h
Expand Up @@ -2,7 +2,7 @@
#include <QCoreApplication>

// MythTV
#include "ringbuffer.h"
#include "io/mythmediabuffer.h"

class MTV_PUBLIC MythFileBuffer : public MythMediaBuffer
{
Expand Down
2 changes: 1 addition & 1 deletion mythtv/libs/libmythtv/io/mythinteractivebuffer.h
Expand Up @@ -2,7 +2,7 @@
#define ICRINGBUFFER_H

// MythTV
#include "ringbuffer.h"
#include "io/mythmediabuffer.h"

class NetStream;

Expand Down
2 changes: 1 addition & 1 deletion mythtv/libs/libmythtv/io/mythiowrapper.cpp
Expand Up @@ -10,7 +10,7 @@
#include "mythcorecontext.h"
#include "mythlogging.h"
#include "remotefile.h"
#include "ringbuffer.h"
#include "io/mythmediabuffer.h"
#include "mythiowrapper.h"

// Std
Expand Down
Expand Up @@ -21,7 +21,7 @@
#include "Bluray/bdringbuffer.h"
#include "HLS/httplivestreambuffer.h"
#include "mythcdrom.h"
#include "io/ringbuffer.h"
#include "io/mythmediabuffer.h"

// Std
#include <cmath>
Expand Down Expand Up @@ -56,15 +56,15 @@ QStringList MythMediaBuffer::s_subExtNoCheck;
A child should never lock any of the parents without locking
the parent lock before the child lock.
void RingBuffer::Example1()
void MythMediaBuffer::Example1()
{
poslock.lockForWrite();
rwlock.lockForRead(); // error!
blah(); // <- does not implicitly acquire any locks
rwlock.unlock();
poslock.unlock();
}
void RingBuffer::Example2()
void MythMediaBuffer::Example2()
{
rwlock.lockForRead();
rbrlock.lockForWrite(); // ok!
Expand Down Expand Up @@ -254,7 +254,7 @@ MythMediaBuffer::~MythMediaBuffer(void)
}
}

/** \fn RingBuffer::Reset(bool, bool, bool)
/** \fn MythMediaBuffer::Reset(bool, bool, bool)
* \brief Resets the read-ahead thread and our position in the file
*/
void MythMediaBuffer::Reset(bool Full, bool ToAdjust, bool ResetInternal)
Expand All @@ -275,7 +275,7 @@ void MythMediaBuffer::Reset(bool Full, bool ToAdjust, bool ResetInternal)
if (m_readPos != 0)
{
LOG(VB_GENERAL, LOG_ERR, LOC +
QString("RingBuffer::Reset() nonzero readpos. toAdjust: %1 "
QString("MythMediaBuffer::Reset() nonzero readpos. toAdjust: %1 "
"readpos: %2 readAdjust: %3")
.arg(ToAdjust).arg(m_readPos).arg(m_readAdjust));
}
Expand Down Expand Up @@ -322,7 +322,7 @@ void MythMediaBuffer::UpdateRawBitrate(uint RawBitrate)
m_rwLock.unlock();
}

/** \fn RingBuffer::UpdatePlaySpeed(float)
/** \fn MythMediaBuffer::UpdatePlaySpeed(float)
* \brief Set the play speed, to allow RingBuffer adjust effective bitrate.
* \param play_speed Speed to set. (1.0 for normal speed)
*/
Expand All @@ -344,7 +344,7 @@ void MythMediaBuffer::SetWaitForWrite(void)
m_waitForWrite = true;
}

/** \fn RingBuffer::SetBufferSizeFactors(bool, bool)
/** \fn MythMediaBuffer::SetBufferSizeFactors(bool, bool)
* \brief Tells RingBuffer that the raw bitrate may be inaccurate and the
* underlying container is matroska, both of which may require a larger
* buffer size.
Expand All @@ -358,7 +358,7 @@ void MythMediaBuffer::SetBufferSizeFactors(bool EstBitrate, bool Matroska)
CreateReadAheadBuffer();
}

/** \fn RingBuffer::CalcReadAheadThresh(void)
/** \fn MythMediaBuffer::CalcReadAheadThresh(void)
* \brief Calculates m_fillMin, m_fillThreshold, and m_readBlockSize
* from the estimated effective bitrate of the stream.
*
Expand Down Expand Up @@ -579,7 +579,7 @@ int MythMediaBuffer::ReadBufAvail(void) const
return ret;
}

/** \fn RingBuffer::ResetReadAhead(long long)
/** \fn MythMediaBuffer::ResetReadAhead(long long)
* \brief Restart the read-ahead thread at the 'newinternal' position.
*
* This is called after a Seek(long long, int) so that the read-ahead
Expand Down Expand Up @@ -664,7 +664,7 @@ void MythMediaBuffer::Start(void)
m_rwLock.unlock();
}

/** \fn RingBuffer::KillReadAheadThread(void)
/** \fn MythMediaBuffer::KillReadAheadThread(void)
* \brief Stops the read-ahead thread, and waits for it to stop.
*/
void MythMediaBuffer::KillReadAheadThread(void)
Expand All @@ -680,7 +680,7 @@ void MythMediaBuffer::KillReadAheadThread(void)
}
}

/** \fn RingBuffer::StopReads(void)
/** \fn MythMediaBuffer::StopReads(void)
* \sa StartReads(void), Pause(void)
*/
void MythMediaBuffer::StopReads(void)
Expand All @@ -690,7 +690,7 @@ void MythMediaBuffer::StopReads(void)
m_generalWait.wakeAll();
}

/** \fn RingBuffer::StartReads(void)
/** \fn MythMediaBuffer::StartReads(void)
* \sa StopReads(void), Unpause(void)
*/
void MythMediaBuffer::StartReads(void)
Expand All @@ -700,7 +700,7 @@ void MythMediaBuffer::StartReads(void)
m_generalWait.wakeAll();
}

/** \fn RingBuffer::Pause(void)
/** \fn MythMediaBuffer::Pause(void)
* \brief Pauses the read-ahead thread. Calls StopReads(void).
* \sa Unpause(void), WaitForPause(void)
*/
Expand All @@ -714,7 +714,7 @@ void MythMediaBuffer::Pause(void)
m_rwLock.unlock();
}

/** \fn RingBuffer::Unpause(void)
/** \fn MythMediaBuffer::Unpause(void)
* \brief Unpauses the read-ahead thread. Calls StartReads(void).
* \sa Pause(void)
*/
Expand All @@ -729,7 +729,7 @@ void MythMediaBuffer::Unpause(void)
m_rwLock.unlock();
}

/** \fn RingBuffer::WaitForPause(void)
/** \fn MythMediaBuffer::WaitForPause(void)
* \brief Waits for Pause(void) to take effect.
*/
void MythMediaBuffer::WaitForPause(void)
Expand Down Expand Up @@ -988,7 +988,7 @@ void MythMediaBuffer::run(void)

int rbwposcopy = m_rbwPos;

// FileRingBuffer::safe_read(RemoteFile*...) acquires poslock;
// MythFileBuffer::SafeRead(RemoteFile*...) acquires poslock;
// so we need to unlock this here to preserve locking order.
m_rbwLock.unlock();

Expand Down Expand Up @@ -1484,7 +1484,7 @@ int MythMediaBuffer::ReadPriv(void *Buffer, int Count, bool Peek)
return Count;
}

/** \fn RingBuffer::Read(void*, int)
/** \fn MythMediaBuffer::Read(void*, int)
* \brief 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.
Expand Down Expand Up @@ -1626,7 +1626,7 @@ uint64_t MythMediaBuffer::UpdateStorageRate(uint64_t Latest)
return average;
}

/** \fn RingBuffer::Write(const void*, uint)
/** \fn MythMediaBuffer::Write(const void*, uint)
* \brief Writes buffer to ThreadedFileWriter::Write(const void*,uint)
* \return Bytes written, or -1 on error.
*/
Expand Down Expand Up @@ -1664,7 +1664,7 @@ int MythMediaBuffer::Write(const void *Buffer, uint Count)
return result;
}

/** \fn RingBuffer::Sync(void)
/** \fn MythMediaBuffer::Sync(void)
* \brief Calls ThreadedFileWriter::Sync(void)
*/
void MythMediaBuffer::Sync(void)
Expand Down Expand Up @@ -1700,7 +1700,7 @@ long long MythMediaBuffer::WriterSeek(long long Position, int Whence, bool HasLo
return result;
}

/** \fn RingBuffer::WriterFlush(void)
/** \fn MythMediaBuffer::WriterFlush(void)
* \brief Calls ThreadedFileWriter::Flush(void)
*/
void MythMediaBuffer::WriterFlush(void)
Expand All @@ -1711,7 +1711,7 @@ void MythMediaBuffer::WriterFlush(void)
m_rwLock.unlock();
}

/** \fn RingBuffer::WriterSetBlocking(bool)
/** \fn MythMediaBuffer::WriterSetBlocking(bool)
* \brief Calls ThreadedFileWriter::SetBlocking(bool)
*/
bool MythMediaBuffer::WriterSetBlocking(bool Lock)
Expand Down Expand Up @@ -1789,7 +1789,7 @@ bool MythMediaBuffer::GetStopReads(void) const
return m_stopReads;
}

/** \fn RingBuffer::GetWritePosition(void) const
/** \fn MythMediaBuffer::GetWritePosition(void) const
* \brief Returns how far into a ThreadedFileWriter file we have written.
*/
long long MythMediaBuffer::GetWritePosition(void) const
Expand All @@ -1800,7 +1800,7 @@ long long MythMediaBuffer::GetWritePosition(void) const
return ret;
}

/** \fn RingBuffer::LiveMode(void) const
/** \fn MythMediaBuffer::LiveMode(void) const
* \brief Returns true if this RingBuffer has been assigned a LiveTVChain.
* \sa SetLiveMode(LiveTVChain*)
*/
Expand All @@ -1812,7 +1812,7 @@ bool MythMediaBuffer::LiveMode(void) const
return ret;
}

/** \fn RingBuffer::SetLiveMode(LiveTVChain*)
/** \fn MythMediaBuffer::SetLiveMode(LiveTVChain*)
* \brief Assigns a LiveTVChain to this RingBuffer
* \sa LiveMode(void)
*/
Expand Down
@@ -1,5 +1,5 @@
#ifndef RINGBUFFER_H
#define RINGBUFFER_H
#ifndef MYTHMEDIABUFFER_H
#define MYTHMEDIABUFFER_H

// Qt
#include <QReadWriteLock>
Expand Down Expand Up @@ -48,7 +48,7 @@ enum MythBufferType

class MTV_PUBLIC MythMediaBuffer : protected MThread
{
friend class ICRingBuffer;
friend class MythInteractiveBuffer;

public:
static MythMediaBuffer *Create(const QString &Filename, bool Write,
Expand Down Expand Up @@ -215,7 +215,6 @@ class MTV_PUBLIC MythMediaBuffer : protected MThread
LiveTVChain *m_liveTVChain { nullptr };
bool m_ignoreLiveEOF { false };
long long m_readAdjust { 0 };
// Internal RingBuffer Method
int m_readOffset { 0 };
bool m_readInternalMode { false };
// End of section protected by rwLock
Expand Down
2 changes: 1 addition & 1 deletion mythtv/libs/libmythtv/io/mythstreamingbuffer.h
Expand Up @@ -2,7 +2,7 @@
#define STREAMINGRINGBUFFER_H

// MythTV
#include "ringbuffer.h"
#include "io/mythmediabuffer.h"

// FFmpeg
extern "C" {
Expand Down
4 changes: 2 additions & 2 deletions mythtv/libs/libmythtv/libmythtv.pro
Expand Up @@ -138,7 +138,7 @@ HEADERS += transporteditor.h listingsources.h
HEADERS += channelgroup.h
HEADERS += recordingrule.h
HEADERS += mythsystemevent.h
HEADERS += io/ringbuffer.h
HEADERS += io/mythmediabuffer.h
HEADERS += io/mythavformatbuffer.h
HEADERS += io/mythfilebuffer.h
HEADERS += io/mythstreamingbuffer.h
Expand Down Expand Up @@ -170,7 +170,7 @@ SOURCES += transporteditor.cpp
SOURCES += channelgroup.cpp
SOURCES += recordingrule.cpp
SOURCES += mythsystemevent.cpp
SOURCES += io/ringbuffer.cpp
SOURCES += io/mythmediabuffer.cpp
SOURCES += io/mythavformatbuffer.cpp
SOURCES += io/mythfilebuffer.cpp
SOURCES += io/mythstreamingbuffer.cpp
Expand Down
1 change: 0 additions & 1 deletion mythtv/libs/libmythtv/mpeg/atscstreamdata.cpp
Expand Up @@ -9,7 +9,6 @@ using namespace std;
#include "atscstreamdata.h"
#include "atsctables.h"
#include "sctetables.h"
#include "ringbuffer.h"
#include "eithelper.h"

#define LOC QString("ATSCStream[%1]: ").arg(m_cardId)
Expand Down
1 change: 0 additions & 1 deletion mythtv/libs/libmythtv/mpeg/mpegstreamdata.cpp
Expand Up @@ -13,7 +13,6 @@ using namespace std;
// MythTV headers
#include "mpegstreamdata.h"
#include "mpegtables.h"
#include "ringbuffer.h"
#include "mpegtables.h"

#include "atscstreamdata.h"
Expand Down

0 comments on commit f74c588

Please sign in to comment.